CMS 3D CMS Logo

Classes | Functions

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/TrackPropagation/RungeKutta/src/RKSmallVector.h File Reference

#include "FWCore/Utilities/interface/Visibility.h"
#include "DataFormats/GeometryVector/interface/PreciseFloatType.h"
#include <iostream>

Go to the source code of this file.

Classes

class  RKSmallVector< T, N >

Functions

template<class T , class Scal , int N>
RKSmallVector< T, N > operator* (const RKSmallVector< T, N > &v, const Scal &s)
template<class T , class Scal , int N>
RKSmallVector< T, N > operator* (const Scal &s, const RKSmallVector< T, N > &v)
template<class T , class U , int N>
RKSmallVector< typename
PreciseFloatType< T, U >::Type,
N > 
operator+ (const RKSmallVector< T, N > &a, const RKSmallVector< U, N > &b)
 vector sum and subtraction of vectors of possibly different precision
template<class T , class U , int N>
RKSmallVector< typename
PreciseFloatType< T, U >::Type,
N > 
operator- (const RKSmallVector< T, N > &a, const RKSmallVector< U, N > &b)
template<class T , class Scal , int N>
RKSmallVector< T, N > operator/ (const RKSmallVector< T, N > &v, const Scal &s)
template<class T , int N>
std::ostream & operator<< (std::ostream &s, const RKSmallVector< T, N > &v)
 simple text output to standard streams

Function Documentation

template<class T , class Scal , int N>
RKSmallVector<T,N> operator* ( const RKSmallVector< T, N > &  v,
const Scal &  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 119 of file RKSmallVector.h.

References i, N, alignCSCRings::r, alignCSCRings::s, and lumiQTWidget::t.

                                                                                 {
  T t = static_cast<T>(s);
  RKSmallVector<T,N> r;
  for (int i=0; i<N; ++i) r[i] = t*v[i];
  return r;
}
template<class T , class Scal , int N>
RKSmallVector<T,N> operator* ( const Scal &  s,
const RKSmallVector< T, N > &  v 
) [inline]

Definition at line 126 of file RKSmallVector.h.

References i, N, alignCSCRings::r, alignCSCRings::s, and lumiQTWidget::t.

                                                                                 {
  T t = static_cast<T>(s);
  RKSmallVector<T,N> r;
  for (int i=0; i<N; ++i) r[i] = t*v[i];
  return r;
}
template<class T , class U , int N>
RKSmallVector<typename PreciseFloatType<T,U>::Type, N> operator+ ( const RKSmallVector< T, N > &  a,
const RKSmallVector< U, N > &  b 
) [inline]

vector sum and subtraction of vectors of possibly different precision

Definition at line 100 of file RKSmallVector.h.

References i, N, and alignCSCRings::r.

                                                                       {
  typedef RKSmallVector<typename PreciseFloatType<T,U>::Type, N> RT;
  RT r;
  for (int i=0; i<N; ++i) r[i] = a[i]+b[i];
  return r;
}
template<class T , class U , int N>
RKSmallVector<typename PreciseFloatType<T,U>::Type, N> operator- ( const RKSmallVector< T, N > &  a,
const RKSmallVector< U, N > &  b 
) [inline]

Definition at line 108 of file RKSmallVector.h.

References i, N, and alignCSCRings::r.

                                                                       {
  typedef RKSmallVector<typename PreciseFloatType<T,U>::Type, N> RT;
  RT r;
  for (int i=0; i<N; ++i) r[i] = a[i]-b[i];
  return r;
}
template<class T , class Scal , int N>
RKSmallVector<T,N> operator/ ( const RKSmallVector< T, N > &  v,
const Scal &  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 137 of file RKSmallVector.h.

References i, N, alignCSCRings::r, alignCSCRings::s, and lumiQTWidget::t.

                                                                                 {
  T t = static_cast<T>(s);
  RKSmallVector<T,N> r;
  for (int i=0; i<N; ++i) r[i] = v[i]/t;
  return r;
}
template<class T , int N>
std::ostream& operator<< ( std::ostream &  s,
const RKSmallVector< T, N > &  v 
) [inline]

simple text output to standard streams

Definition at line 91 of file RKSmallVector.h.

References i, N, alignCSCRings::s, and v.

                                                                            {
  s << std::endl;
  for (int i=0; i<N; ++i) s << "v[" << i << "] = " << v[i] << std::endl;
  return s;
}