CMS 3D CMS Logo

RKSmallVector< T, N > Class Template Reference

#include <TrackPropagation/RungeKutta/interface/RKSmallVector.h>

List of all members.

Public Types

typedef T Scalar

Public Member Functions

int dim () const
dot (const RKSmallVector &v) const
 Scalar product, or "dot" product, with a vector of same type.
template<class U>
RKSmallVectorincrement (const RKSmallVector< U, N > &v, const T &t)
 Increment by another vector multiplied by a scalar.
RKSmallVectoroperator *= (const T &t)
 Scaling by a scalar value (multiplication).
T & operator() (int i)
const T & operator() (int i) const
 access to values
template<class U>
RKSmallVectoroperator+= (const RKSmallVector< U, N > &v)
 Operations with vector of same size.
RKSmallVector operator- () const
 Unary minus, returns a vector with negated components.
template<class U>
RKSmallVectoroperator-= (const RKSmallVector< U, N > &v)
RKSmallVectoroperator/= (const T &t)
 Scaling by a scalar value (division).
T & operator[] (int i)
const T & operator[] (int i) const
template<class Iter>
 RKSmallVector (Iter begin, Iter end)
 construct from pair of iterators; when dereferenced, they should return a type convertible to Scalar.
 RKSmallVector (const Scalar *d)
 Construct from array.
 RKSmallVector ()
int size () const

Private Attributes

Scalar data_ [N]


Detailed Description

template<typename T, int N>
class RKSmallVector< T, N >

Definition at line 9 of file RKSmallVector.h.


Member Typedef Documentation

template<typename T, int N>
typedef T RKSmallVector< T, N >::Scalar

Definition at line 11 of file RKSmallVector.h.


Constructor & Destructor Documentation

template<typename T, int N>
RKSmallVector< T, N >::RKSmallVector (  )  [inline]

Definition at line 13 of file RKSmallVector.h.

00013 {}

template<typename T, int N>
RKSmallVector< T, N >::RKSmallVector ( const Scalar d  )  [inline]

Construct from array.

Definition at line 16 of file RKSmallVector.h.

References RKSmallVector< T, N >::data_, i, and N.

00016                                   {
00017     for (int i=0; i<N; ++i) data_[i] = d[i];
00018   }

template<typename T, int N>
template<class Iter>
RKSmallVector< T, N >::RKSmallVector ( Iter  begin,
Iter  end 
) [inline]

construct from pair of iterators; when dereferenced, they should return a type convertible to Scalar.

The iterator range shold be exactly N

Definition at line 22 of file RKSmallVector.h.

References RKSmallVector< T, N >::data_, i, and N.

00022                                                             {
00023     for (int i=0; i<N; i++) data_[i] = *begin++;
00024   }


Member Function Documentation

template<typename T, int N>
int RKSmallVector< T, N >::dim (  )  const [inline]

Definition at line 27 of file RKSmallVector.h.

References N.

00027 {return N;}

template<typename T, int N>
T RKSmallVector< T, N >::dot ( const RKSmallVector< T, N > &  v  )  const [inline]

Scalar product, or "dot" product, with a vector of same type.

Definition at line 76 of file RKSmallVector.h.

References RKSmallVector< T, N >::data_, i, N, and r.

00076                                        {
00077     RKSmallVector r;
00078     for (int i=0; i<N; ++i) r[i] = data_[i]*data_[i];
00079     return r;
00080   }

template<typename T, int N>
template<class U>
RKSmallVector& RKSmallVector< T, N >::increment ( const RKSmallVector< U, N > &  v,
const T &  t 
) [inline]

Increment by another vector multiplied by a scalar.

Definition at line 51 of file RKSmallVector.h.

References RKSmallVector< T, N >::data_, i, and N.

00051                                                                      {
00052     for (int i=0; i<N; ++i) data_[i] += t*v[i];
00053     return *this;
00054   } 

template<typename T, int N>
RKSmallVector& RKSmallVector< T, N >::operator *= ( const T &  t  )  [inline]

Scaling by a scalar value (multiplication).

Definition at line 65 of file RKSmallVector.h.

References RKSmallVector< T, N >::data_, i, and N.

00065                                           {
00066     for (int i=0; i<N; ++i) data_[i] *= t;
00067     return *this;
00068   }

template<typename T, int N>
T& RKSmallVector< T, N >::operator() ( int  i  )  [inline]

Definition at line 31 of file RKSmallVector.h.

References RKSmallVector< T, N >::data_.

00031 {return data_[i];}

template<typename T, int N>
const T& RKSmallVector< T, N >::operator() ( int  i  )  const [inline]

access to values

Definition at line 30 of file RKSmallVector.h.

References RKSmallVector< T, N >::data_.

00030 {return data_[i];}

template<typename T, int N>
template<class U>
RKSmallVector& RKSmallVector< T, N >::operator+= ( const RKSmallVector< U, N > &  v  )  [inline]

Operations with vector of same size.

Definition at line 38 of file RKSmallVector.h.

References RKSmallVector< T, N >::data_, i, and N.

00038                                                            {
00039     for (int i=0; i<N; ++i) data_[i] += v[i];
00040     return *this;
00041   } 

template<typename T, int N>
RKSmallVector RKSmallVector< T, N >::operator- (  )  const [inline]

Unary minus, returns a vector with negated components.

Definition at line 58 of file RKSmallVector.h.

References RKSmallVector< T, N >::data_, i, N, and r.

00058                                   { 
00059     RKSmallVector r;
00060     for (int i=0; i<N; ++i) r[i] = -data_[i];
00061     return r;
00062   }

template<typename T, int N>
template<class U>
RKSmallVector& RKSmallVector< T, N >::operator-= ( const RKSmallVector< U, N > &  v  )  [inline]

Definition at line 44 of file RKSmallVector.h.

References RKSmallVector< T, N >::data_, i, and N.

00044                                                            {
00045     for (int i=0; i<N; ++i) data_[i] -= v[i];
00046     return *this;
00047   } 

template<typename T, int N>
RKSmallVector& RKSmallVector< T, N >::operator/= ( const T &  t  )  [inline]

Scaling by a scalar value (division).

Definition at line 70 of file RKSmallVector.h.

References RKSmallVector< T, N >::data_, i, and N.

00070                                           {
00071     for (int i=0; i<N; ++i) data_[i] /= t;
00072     return *this;
00073   }

template<typename T, int N>
T& RKSmallVector< T, N >::operator[] ( int  i  )  [inline]

Definition at line 33 of file RKSmallVector.h.

References RKSmallVector< T, N >::data_.

00033 {return data_[i];}

template<typename T, int N>
const T& RKSmallVector< T, N >::operator[] ( int  i  )  const [inline]

Definition at line 32 of file RKSmallVector.h.

References RKSmallVector< T, N >::data_.

00032 {return data_[i];}

template<typename T, int N>
int RKSmallVector< T, N >::size ( void   )  const [inline]

Definition at line 26 of file RKSmallVector.h.

References N.

00026 {return N;}


Member Data Documentation

template<typename T, int N>
Scalar RKSmallVector< T, N >::data_[N] [private]

Definition at line 84 of file RKSmallVector.h.

Referenced by RKSmallVector< T, N >::dot(), RKSmallVector< T, N >::increment(), RKSmallVector< T, N >::operator *=(), RKSmallVector< T, N >::operator()(), RKSmallVector< T, N >::operator+=(), RKSmallVector< T, N >::operator-(), RKSmallVector< T, N >::operator-=(), RKSmallVector< T, N >::operator/=(), RKSmallVector< T, N >::operator[](), and RKSmallVector< T, N >::RKSmallVector().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:30:48 2009 for CMSSW by  doxygen 1.5.4