WireCellToolkit
Wire Cell Simulation, Signal Process and Reconstruction Toolki for Liquid Argon Detectors
WireCell::D3Vector< T > Class Template Reference

#include <D3Vector.h>

Public Member Functions

 D3Vector (const T &a=0, const T &b=0, const T &c=0)
 Construct from elements. More...
 
 D3Vector (const D3Vector &o)
 
 D3Vector (const T d[3])
 
D3Vectoroperator= (const D3Vector &o)
 
void set (const T &a=0, const T &b=0, const T &c=0)
 Set vector from elements;. More...
 
x (const T &val)
 
y (const T &val)
 
z (const T &val)
 
template<class TT >
 D3Vector (const D3Vector< TT > &o)
 Convert from other typed vector. More...
 
x () const
 Access elements by name. More...
 
y () const
 
z () const
 
operator[] (std::size_t index) const
 Access elements by copy. More...
 
T & operator[] (std::size_t index)
 Access elements by reference. More...
 
dot (const D3Vector &rhs) const
 Return the dot product of this vector and the other. More...
 
magnitude () const
 Return the magnitude of this vector. More...
 
D3Vector norm () const
 Return a normalized vector in the direction of this vector. More...
 
D3Vector cross (const D3Vector &rhs) const
 Return the cross product of this vector and the other. More...
 
D3Vector triplevec (D3Vector &a, D3Vector &b) const
 Return the triple cross product of this vector and the other two. More...
 
triplescal (D3Vector &a, D3Vector &b) const
 Return the dot-cross product of this vector and the other two. More...
 
bool operator< (const D3Vector &rhs) const
 
D3Vectoroperator+= (const D3Vector &other)
 
bool operator! () const
 
 operator bool () const
 
void invalidate ()
 

Friends

template<class U >
std::ostream & operator<< (std::ostream &, const D3Vector< U > &)
 

Detailed Description

template<class T>
class WireCell::D3Vector< T >

Dimension-3 vector class.

Adapted in laziness from: http://rosettacode.org/wiki/Vector_products#C.2B.2B

Definition at line 23 of file D3Vector.h.

Constructor & Destructor Documentation

◆ D3Vector() [1/4]

template<class T>
WireCell::D3Vector< T >::D3Vector ( const T &  a = 0,
const T &  b = 0,
const T &  c = 0 
)
inline

Construct from elements.

Definition at line 35 of file D3Vector.h.

◆ D3Vector() [2/4]

template<class T>
WireCell::D3Vector< T >::D3Vector ( const D3Vector< T > &  o)
inline

Definition at line 38 of file D3Vector.h.

◆ D3Vector() [3/4]

template<class T>
WireCell::D3Vector< T >::D3Vector ( const T  d[3])
inline

Definition at line 40 of file D3Vector.h.

◆ D3Vector() [4/4]

template<class T>
template<class TT >
WireCell::D3Vector< T >::D3Vector ( const D3Vector< TT > &  o)
inline

Convert from other typed vector.

Definition at line 62 of file D3Vector.h.

Member Function Documentation

◆ cross()

template<class T>
D3Vector WireCell::D3Vector< T >::cross ( const D3Vector< T > &  rhs) const
inline

Return the cross product of this vector and the other.

Definition at line 100 of file D3Vector.h.

Here is the caller graph for this function:

◆ dot()

template<class T>
T WireCell::D3Vector< T >::dot ( const D3Vector< T > &  rhs) const
inline

Return the dot product of this vector and the other.

Definition at line 80 of file D3Vector.h.

Here is the caller graph for this function:

◆ invalidate()

template<class T>
void WireCell::D3Vector< T >::invalidate ( )
inline

Definition at line 136 of file D3Vector.h.

◆ magnitude()

template<class T>
T WireCell::D3Vector< T >::magnitude ( ) const
inline

Return the magnitude of this vector.

Definition at line 86 of file D3Vector.h.

◆ norm()

template<class T>
D3Vector WireCell::D3Vector< T >::norm ( ) const
inline

Return a normalized vector in the direction of this vector.

Definition at line 91 of file D3Vector.h.

Here is the caller graph for this function:

◆ operator bool()

template<class T>
WireCell::D3Vector< T >::operator bool ( ) const
inline

Definition at line 132 of file D3Vector.h.

◆ operator!()

template<class T>
bool WireCell::D3Vector< T >::operator! ( ) const
inline

Definition at line 129 of file D3Vector.h.

◆ operator+=()

template<class T>
D3Vector& WireCell::D3Vector< T >::operator+= ( const D3Vector< T > &  other)
inline

Definition at line 124 of file D3Vector.h.

◆ operator<()

template<class T>
bool WireCell::D3Vector< T >::operator< ( const D3Vector< T > &  rhs) const
inline

Definition at line 117 of file D3Vector.h.

◆ operator=()

template<class T>
D3Vector& WireCell::D3Vector< T >::operator= ( const D3Vector< T > &  o)
inline

Definition at line 43 of file D3Vector.h.

◆ operator[]() [1/2]

template<class T>
T WireCell::D3Vector< T >::operator[] ( std::size_t  index) const
inline

Access elements by copy.

Definition at line 70 of file D3Vector.h.

◆ operator[]() [2/2]

template<class T>
T& WireCell::D3Vector< T >::operator[] ( std::size_t  index)
inline

Access elements by reference.

Definition at line 75 of file D3Vector.h.

◆ set()

template<class T>
void WireCell::D3Vector< T >::set ( const T &  a = 0,
const T &  b = 0,
const T &  c = 0 
)
inline

Set vector from elements;.

Definition at line 49 of file D3Vector.h.

◆ triplescal()

template<class T>
T WireCell::D3Vector< T >::triplescal ( D3Vector< T > &  a,
D3Vector< T > &  b 
) const
inline

Return the dot-cross product of this vector and the other two.

Definition at line 113 of file D3Vector.h.

◆ triplevec()

template<class T>
D3Vector WireCell::D3Vector< T >::triplevec ( D3Vector< T > &  a,
D3Vector< T > &  b 
) const
inline

Return the triple cross product of this vector and the other two.

Definition at line 109 of file D3Vector.h.

◆ x() [1/2]

template<class T>
T WireCell::D3Vector< T >::x ( const T &  val)
inline

Definition at line 55 of file D3Vector.h.

Here is the caller graph for this function:

◆ x() [2/2]

template<class T>
T WireCell::D3Vector< T >::x ( ) const
inline

Access elements by name.

Definition at line 65 of file D3Vector.h.

Here is the caller graph for this function:

◆ y() [1/2]

template<class T>
T WireCell::D3Vector< T >::y ( const T &  val)
inline

Definition at line 56 of file D3Vector.h.

Here is the caller graph for this function:

◆ y() [2/2]

template<class T>
T WireCell::D3Vector< T >::y ( ) const
inline

Definition at line 66 of file D3Vector.h.

Here is the caller graph for this function:

◆ z() [1/2]

template<class T>
T WireCell::D3Vector< T >::z ( const T &  val)
inline

Definition at line 57 of file D3Vector.h.

Here is the caller graph for this function:

◆ z() [2/2]

template<class T>
T WireCell::D3Vector< T >::z ( ) const
inline

Definition at line 67 of file D3Vector.h.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

template<class T>
template<class U >
std::ostream& operator<< ( std::ostream &  ,
const D3Vector< U > &   
)
friend

The documentation for this class was generated from the following file: