CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
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, Noperator* (const RKSmallVector< T, N > &v, const Scal &s)
 
template<class T , class Scal , int N>
RKSmallVector< T, Noperator* (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 More...
 
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, Noperator/ (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 More...
 

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.

119  {
120  T t = static_cast<T>(s);
122  for (int i=0; i<N; ++i) r[i] = t*v[i];
123  return r;
124 }
int i
Definition: DBlmapReader.cc:9
#define N
Definition: blowfish.cc:9
long double T
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.

126  {
127  T t = static_cast<T>(s);
129  for (int i=0; i<N; ++i) r[i] = t*v[i];
130  return r;
131 }
int i
Definition: DBlmapReader.cc:9
#define N
Definition: blowfish.cc:9
long double T
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.

100  {
102  RT r;
103  for (int i=0; i<N; ++i) r[i] = a[i]+b[i];
104  return r;
105 }
int i
Definition: DBlmapReader.cc:9
#define N
Definition: blowfish.cc:9
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.

108  {
110  RT r;
111  for (int i=0; i<N; ++i) r[i] = a[i]-b[i];
112  return r;
113 }
int i
Definition: DBlmapReader.cc:9
#define N
Definition: blowfish.cc:9
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.

137  {
138  T t = static_cast<T>(s);
140  for (int i=0; i<N; ++i) r[i] = v[i]/t;
141  return r;
142 }
int i
Definition: DBlmapReader.cc:9
#define N
Definition: blowfish.cc:9
long double T
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.

91  {
92  s << std::endl;
93  for (int i=0; i<N; ++i) s << "v[" << i << "] = " << v[i] << std::endl;
94  return s;
95 }
int i
Definition: DBlmapReader.cc:9
#define N
Definition: blowfish.cc:9