CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
RKSmallVector.h File Reference
#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 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, 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 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 118 of file RKSmallVector.h.

References i, MultiGaussianStateTransform::N, csvReporter::r, asciidump::s, and matplotRender::t.

118  {
119  T t = static_cast<T>(s);
121  for (int i=0; i<N; ++i) r[i] = t*v[i];
122  return r;
123 }
int i
Definition: DBlmapReader.cc:9
string s
Definition: asciidump.py:422
template<class T , class Scal , int N>
RKSmallVector<T,N> operator* ( const Scal &  s,
const RKSmallVector< T, N > &  v 
)
inline

Definition at line 125 of file RKSmallVector.h.

References i, MultiGaussianStateTransform::N, csvReporter::r, asciidump::s, and matplotRender::t.

125  {
126  T t = static_cast<T>(s);
128  for (int i=0; i<N; ++i) r[i] = t*v[i];
129  return r;
130 }
int i
Definition: DBlmapReader.cc:9
string s
Definition: asciidump.py:422
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 99 of file RKSmallVector.h.

References i, MultiGaussianStateTransform::N, and csvReporter::r.

99  {
101  RT r;
102  for (int i=0; i<N; ++i) r[i] = a[i]+b[i];
103  return r;
104 }
int i
Definition: DBlmapReader.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 107 of file RKSmallVector.h.

References i, MultiGaussianStateTransform::N, and csvReporter::r.

107  {
109  RT r;
110  for (int i=0; i<N; ++i) r[i] = a[i]-b[i];
111  return r;
112 }
int i
Definition: DBlmapReader.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 136 of file RKSmallVector.h.

References i, MultiGaussianStateTransform::N, csvReporter::r, asciidump::s, and matplotRender::t.

136  {
137  T t = static_cast<T>(s);
139  for (int i=0; i<N; ++i) r[i] = v[i]/t;
140  return r;
141 }
int i
Definition: DBlmapReader.cc:9
string s
Definition: asciidump.py:422
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 90 of file RKSmallVector.h.

References i, MultiGaussianStateTransform::N, asciidump::s, and v.

90  {
91  s << std::endl;
92  for (int i=0; i<N; ++i) s << "v[" << i << "] = " << v[i] << std::endl;
93  return s;
94 }
int i
Definition: DBlmapReader.cc:9
string s
Definition: asciidump.py:422