boca::Vector2< Value_ > Class Template Reference

Two dimensional Vector. More...

#include <PseudoJet.hh>

Inheritance diagram for boca::Vector2< Value_ >:
[legend]
Collaboration diagram for boca::Vector2< Value_ >:
[legend]

Public Member Functions

Constructor
constexpr Vector2 ()
 Default constructor. More...
 
constexpr Vector2 (Value_ x, Value_ y)
 Constructor from two scalars. More...
 
 Vector2 (Value_ value, Dim2 dim)
 Constructor one scalar and its direction. More...
 
template<typename Value_2 >
constexpr Vector2 (Vector2< Value_2 > const &vector)
 Constructor from a two-vector. More...
 
constexpr Vector2 (TVector2 const &vector)
 Constructor accepting a root::TVector2. More...
 
Setter
void SetUniform (Value_ value)
 Set both both entries according to the value. More...
 
void SetMagPhi (Value_ magnitude, Angle const &phi)
 Setter for the magnitude and angle. More...
 
void SetMag (Value_ mag)
 Set the magnitude keeping \(\phi\) constant. More...
 
void SetPhi (boca::Angle const &phi)
 Set azimuth \(\phi\) keeping the magnitue constant. More...
 
Accessors and Getters
constexpr Value_ const & X () const
 Getter for X. More...
 
constexpr Value_ const & Y () const
 Getter for Y. More...
 
Value_ & X ()
 Accessor for X. More...
 
Value_ & Y ()
 Accessor for Y. More...
 
Magnitudes
constexpr auto Mag2 () const
 Square of the magnitude \(x^2 + y^2\). More...
 
constexpr Value_ Mag () const
 Magnitude \(\sqrt{x^2 + y^2}\). More...
 
Angles
Angle Phi () const
 The azimuth \(\phi\) defined in \([-\pi, \pi]\). More...
 
template<typename Value_2 >
Angle DeltaPhiTo (Vector2< Value_2 > const &vector) const
 Difference of azimuth \(\Delta\phi\) defined in \([-\pi, \pi]\). More...
 
Vectors
constexpr auto Unit () const
 Unit vector in the direction of this vector. More...
 
template<typename Value_2 >
constexpr auto Project (Vector2< Value_2 > const &vector) const
 Projection onto the direction of vector. More...
 
template<typename Value_2 >
constexpr Vector2 Norm (Vector2< Value_2 > const &vector) const
 Component normal to the vector. More...
 
Vector2Rotate (Angle const &phi)
 Rotate this vector by \(\phi\). More...
 
Vector2 Rotate (Angle const &phi) const
 Rotate this vector by \(\phi\). More...
 
Products
template<typename Value_2 >
constexpr ValueProduct< Value_2 > Dot (Vector2< Value_2 > const &vector) const
 Dot product between two vectors. More...
 
template<typename Value_2 >
Vector2< ValueProduct< Value_2 > > Scale (Value_2 const &scalar) const
 Scale this vector with a scalar. More...
 
template<typename Value_2 >
constexpr ValueProduct< Value_2 > SignedArea (Vector2< Value_2 > const &vector) const
 Signed area. More...
 

Operators

template<typename Value_2 >
Vector2operator= (Vector2< Value_2 > const &vector)
 Assignment operator including casting. More...
 
template<typename Value_2 , typename = OnlyIfNotOrSameQuantity<Value_2>>
Vector2operator+= (Vector2< Value_2 > const &vector)
 Sum of two vectors. More...
 
template<typename Value_2 , typename = OnlyIfNotOrSameQuantity<Value_2>>
Vector2operator-= (Vector2< Value_2 > const &vector)
 Difference of two vectors. More...
 
template<typename Value_2 , typename = OnlyIfNotQuantity<Value_2>>
Vector2operator*= (Value_2 scalar)
 Product with scalar. More...
 
template<typename Value_2 , typename = OnlyIfNotQuantity<Value_2>>
Vector2operator/= (Value_2 scalar)
 Division by scalar. More...
 
constexpr Vector2 operator- () const
 Unary minus. More...
 
constexpr bool operator< (Vector2 const &vector) const
 Less than comparison. More...
 
constexpr bool operator== (Vector2 const &vector) const
 Equal comparison. More...
 
Value_ const & operator[] (Dim2 dim_2) const
 Components by index. More...
 
Value_ & operator[] (Dim2 dim_2)
 Components by index. More...
 
template<typename Value_2 >
constexpr friend ValueProduct< Value_2 > operator^ (Vector2 const &vector_1, Vector2< Value_2 > const &vector_2)
 Coefficient of wedge product. More...
 
template<typename Value_2 >
constexpr friend auto operator/ (Vector2 const &vector, Value_2 const &scalar)
 Division by scalar. More...
 
auto & operator<< (std::ostream &stream, Vector2< Value_ > const &vector)
 Output stream operator. More...
 

Iterators

using Dimension = Dim2
 Const begin. More...
 
constexpr ConstIterator< boca::Vector2, Value_ > begin () const
 Const begin. More...
 
constexpr ConstIterator< boca::Vector2, Value_ > end () const
 Const end. More...
 
Iterator< boca::Vector2, Value_ > begin ()
 Begin. More...
 
Iterator< boca::Vector2, Value_ > end ()
 End. More...
 

Detailed Description

template<typename Value_>
class boca::Vector2< Value_ >

Two dimensional Vector.

Member Typedef Documentation

template<typename Value_>
using boca::Vector2< Value_ >::Dimension = Dim2

Const begin.

Constructor & Destructor Documentation

template<typename Value_>
constexpr boca::Vector2< Value_ >::Vector2 ( )
inline

Default constructor.

template<typename Value_>
constexpr boca::Vector2< Value_ >::Vector2 ( Value_  x,
Value_  y 
)
inline

Constructor from two scalars.

template<typename Value_>
boca::Vector2< Value_ >::Vector2 ( Value_  value,
Dim2  dim 
)
inline

Constructor one scalar and its direction.

template<typename Value_>
template<typename Value_2 >
constexpr boca::Vector2< Value_ >::Vector2 ( Vector2< Value_2 > const &  vector)
inline

Constructor from a two-vector.

template<typename Value_>
constexpr boca::Vector2< Value_ >::Vector2 ( TVector2< Value_ > const &  vector)
inline

Constructor accepting a root::TVector2.

Member Function Documentation

template<typename Value_>
constexpr ConstIterator<boca::Vector2, Value_> boca::Vector2< Value_ >::begin ( ) const
inline

Const begin.

template<typename Value_>
Iterator<boca::Vector2, Value_> boca::Vector2< Value_ >::begin ( )
inline

Begin.

template<typename Value_>
template<typename Value_2 >
Angle boca::Vector2< Value_ >::DeltaPhiTo ( Vector2< Value_2 > const &  vector) const
inline

Difference of azimuth \(\Delta\phi\) defined in \([-\pi, \pi]\).

template<typename Value_>
template<typename Value_2 >
constexpr ValueProduct<Value_2> boca::Vector2< Value_ >::Dot ( Vector2< Value_2 > const &  vector) const
inline

Dot product between two vectors.

template<typename Value_>
constexpr ConstIterator<boca::Vector2, Value_> boca::Vector2< Value_ >::end ( ) const
inline

Const end.

template<typename Value_>
Iterator<boca::Vector2, Value_> boca::Vector2< Value_ >::end ( )
inline

End.

template<typename Value_>
constexpr Value_ boca::Vector2< Value_ >::Mag ( ) const
inline

Magnitude \(\sqrt{x^2 + y^2}\).

template<typename Value_>
constexpr auto boca::Vector2< Value_ >::Mag2 ( ) const
inline

Square of the magnitude \(x^2 + y^2\).

template<typename Value_>
template<typename Value_2 >
constexpr Vector2 boca::Vector2< Value_ >::Norm ( Vector2< Value_2 > const &  vector) const
inline

Component normal to the vector.

template<typename Value_>
template<typename Value_2 , typename = OnlyIfNotQuantity<Value_2>>
Vector2& boca::Vector2< Value_ >::operator*= ( Value_2  scalar)
inline

Product with scalar.

template<typename Value_>
template<typename Value_2 , typename = OnlyIfNotOrSameQuantity<Value_2>>
Vector2& boca::Vector2< Value_ >::operator+= ( Vector2< Value_2 > const &  vector)
inline

Sum of two vectors.

template<typename Value_>
constexpr Vector2 boca::Vector2< Value_ >::operator- ( ) const
inline

Unary minus.

template<typename Value_>
template<typename Value_2 , typename = OnlyIfNotOrSameQuantity<Value_2>>
Vector2& boca::Vector2< Value_ >::operator-= ( Vector2< Value_2 > const &  vector)
inline

Difference of two vectors.

template<typename Value_>
template<typename Value_2 , typename = OnlyIfNotQuantity<Value_2>>
Vector2& boca::Vector2< Value_ >::operator/= ( Value_2  scalar)
inline

Division by scalar.

template<typename Value_>
constexpr bool boca::Vector2< Value_ >::operator< ( Vector2< Value_ > const &  vector) const
inline

Less than comparison.

template<typename Value_>
template<typename Value_2 >
Vector2& boca::Vector2< Value_ >::operator= ( Vector2< Value_2 > const &  vector)
inline

Assignment operator including casting.

template<typename Value_>
constexpr bool boca::Vector2< Value_ >::operator== ( Vector2< Value_ > const &  vector) const
inline

Equal comparison.

template<typename Value_>
Value_ const& boca::Vector2< Value_ >::operator[] ( Dim2  dim_2) const
inline

Components by index.

template<typename Value_>
Value_& boca::Vector2< Value_ >::operator[] ( Dim2  dim_2)
inline

Components by index.

template<typename Value_>
Angle boca::Vector2< Value_ >::Phi ( ) const
inline

The azimuth \(\phi\) defined in \([-\pi, \pi]\).

template<typename Value_>
template<typename Value_2 >
constexpr auto boca::Vector2< Value_ >::Project ( Vector2< Value_2 > const &  vector) const
inline

Projection onto the direction of vector.

template<typename Value_>
Vector2& boca::Vector2< Value_ >::Rotate ( Angle const &  phi)
inline

Rotate this vector by \(\phi\).

template<typename Value_>
Vector2 boca::Vector2< Value_ >::Rotate ( Angle const &  phi) const
inline

Rotate this vector by \(\phi\).

template<typename Value_>
template<typename Value_2 >
Vector2<ValueProduct<Value_2> > boca::Vector2< Value_ >::Scale ( Value_2 const &  scalar) const
inline

Scale this vector with a scalar.

template<typename Value_>
void boca::Vector2< Value_ >::SetMag ( Value_  mag)
inline

Set the magnitude keeping \(\phi\) constant.

template<typename Value_>
void boca::Vector2< Value_ >::SetMagPhi ( Value_  magnitude,
Angle const &  phi 
)
inline

Setter for the magnitude and angle.

template<typename Value_>
void boca::Vector2< Value_ >::SetPhi ( boca::Angle const &  phi)
inline

Set azimuth \(\phi\) keeping the magnitue constant.

template<typename Value_>
void boca::Vector2< Value_ >::SetUniform ( Value_  value)
inline

Set both both entries according to the value.

template<typename Value_>
template<typename Value_2 >
constexpr ValueProduct<Value_2> boca::Vector2< Value_ >::SignedArea ( Vector2< Value_2 > const &  vector) const
inline

Signed area.

template<typename Value_>
constexpr auto boca::Vector2< Value_ >::Unit ( ) const
inline

Unit vector in the direction of this vector.

template<typename Value_>
constexpr Value_ const& boca::Vector2< Value_ >::X ( ) const
inline

Getter for X.

template<typename Value_>
Value_& boca::Vector2< Value_ >::X ( )
inline

Accessor for X.

template<typename Value_>
constexpr Value_ const& boca::Vector2< Value_ >::Y ( ) const
inline

Getter for Y.

template<typename Value_>
Value_& boca::Vector2< Value_ >::Y ( )
inline

Accessor for Y.

Friends And Related Function Documentation

template<typename Value_>
template<typename Value_2 >
constexpr friend auto operator/ ( Vector2< Value_ > const &  vector,
Value_2 const &  scalar 
)
friend

Division by scalar.

template<typename Value_>
auto& operator<< ( std::ostream &  stream,
Vector2< Value_ > const &  vector 
)
friend

Output stream operator.

template<typename Value_>
template<typename Value_2 >
constexpr friend ValueProduct<Value_2> operator^ ( Vector2< Value_ > const &  vector_1,
Vector2< Value_2 > const &  vector_2 
)
friend

Coefficient of wedge product.


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