PeTar
N-body code for collisional gravitational systems
PIKG::Vector2< T > Class Template Reference

#include <pikg_vector.hpp>

Public Member Functions

 Vector2 ()
 
 Vector2 (const T _x, const T _y)
 
 Vector2 (const T s)
 
 Vector2 (const Vector2 &src)
 
const Vector2operator= (const Vector2 &rhs)
 
const Vector2operator= (const T s)
 
Vector2 operator+ (const Vector2 &rhs) const
 
const Vector2operator+= (const Vector2 &rhs)
 
Vector2 operator- (const Vector2 &rhs) const
 
const Vector2operator-= (const Vector2 &rhs)
 
Vector2 operator* (const T s) const
 
const Vector2operator*= (const T s)
 
Vector2 operator/ (const T s) const
 
const Vector2operator/= (const T s)
 
const Vector2operator+ () const
 
const Vector2 operator- () const
 
operator* (const Vector2 &rhs) const
 
operator^ (const Vector2 &rhs) const
 
template<typename U >
 operator Vector2< U > () const
 
getMax () const
 
getMin () const
 
template<class F >
Vector2 applyEach (F f) const
 
T & operator[] (const int i)
 
const T & operator[] (const int i) const
 
bool operator== (const Vector2 &u) const
 
bool operator!= (const Vector2 &u) const
 
Vector2< float > operator/ (const float s) const
 
Vector2< double > operator/ (const double s) const
 

Public Attributes

x
 
y
 

Static Public Attributes

static const int DIM = 2
 

Friends

Vector2 operator* (const T s, const Vector2 &v)
 
template<class F >
Vector2 ApplyEach (F f, const Vector2 &arg1, const Vector2 &arg2)
 
std::ostream & operator<< (std::ostream &c, const Vector2 &u)
 
std::istream & operator>> (std::istream &c, Vector2 &u)
 

Constructor & Destructor Documentation

◆ Vector2() [1/4]

template<typename T >
PIKG::Vector2< T >::Vector2 ( )
inline

◆ Vector2() [2/4]

template<typename T >
PIKG::Vector2< T >::Vector2 ( const T  _x,
const T  _y 
)
inline

◆ Vector2() [3/4]

template<typename T >
PIKG::Vector2< T >::Vector2 ( const T  s)
inline

◆ Vector2() [4/4]

template<typename T >
PIKG::Vector2< T >::Vector2 ( const Vector2< T > &  src)
inline

Member Function Documentation

◆ applyEach()

template<typename T >
template<class F >
Vector2 PIKG::Vector2< T >::applyEach ( f) const
inline

◆ getMax()

template<typename T >
T PIKG::Vector2< T >::getMax ( ) const
inline

◆ getMin()

template<typename T >
T PIKG::Vector2< T >::getMin ( ) const
inline

◆ operator Vector2< U >()

template<typename T >
template<typename U >
PIKG::Vector2< T >::operator Vector2< U > ( ) const
inline

◆ operator!=()

template<typename T >
bool PIKG::Vector2< T >::operator!= ( const Vector2< T > &  u) const
inline

◆ operator*() [1/2]

template<typename T >
Vector2 PIKG::Vector2< T >::operator* ( const T  s) const
inline

◆ operator*() [2/2]

template<typename T >
T PIKG::Vector2< T >::operator* ( const Vector2< T > &  rhs) const
inline

◆ operator*=()

template<typename T >
const Vector2& PIKG::Vector2< T >::operator*= ( const T  s)
inline

◆ operator+() [1/2]

template<typename T >
const Vector2& PIKG::Vector2< T >::operator+ ( ) const
inline

◆ operator+() [2/2]

template<typename T >
Vector2 PIKG::Vector2< T >::operator+ ( const Vector2< T > &  rhs) const
inline

◆ operator+=()

template<typename T >
const Vector2& PIKG::Vector2< T >::operator+= ( const Vector2< T > &  rhs)
inline

◆ operator-() [1/2]

template<typename T >
const Vector2 PIKG::Vector2< T >::operator- ( ) const
inline

◆ operator-() [2/2]

template<typename T >
Vector2 PIKG::Vector2< T >::operator- ( const Vector2< T > &  rhs) const
inline

◆ operator-=()

template<typename T >
const Vector2& PIKG::Vector2< T >::operator-= ( const Vector2< T > &  rhs)
inline

◆ operator/() [1/3]

Vector2< double > PIKG::Vector2< double >::operator/ ( const double  s) const
inline

◆ operator/() [2/3]

Vector2< float > PIKG::Vector2< float >::operator/ ( const float  s) const
inline

◆ operator/() [3/3]

template<typename T >
Vector2 PIKG::Vector2< T >::operator/ ( const T  s) const
inline

◆ operator/=()

template<typename T >
const Vector2& PIKG::Vector2< T >::operator/= ( const T  s)
inline

◆ operator=() [1/2]

template<typename T >
const Vector2& PIKG::Vector2< T >::operator= ( const T  s)
inline

◆ operator=() [2/2]

template<typename T >
const Vector2& PIKG::Vector2< T >::operator= ( const Vector2< T > &  rhs)
inline

◆ operator==()

template<typename T >
bool PIKG::Vector2< T >::operator== ( const Vector2< T > &  u) const
inline

◆ operator[]() [1/2]

template<typename T >
T& PIKG::Vector2< T >::operator[] ( const int  i)
inline

◆ operator[]() [2/2]

template<typename T >
const T& PIKG::Vector2< T >::operator[] ( const int  i) const
inline

◆ operator^()

template<typename T >
T PIKG::Vector2< T >::operator^ ( const Vector2< T > &  rhs) const
inline

Friends And Related Function Documentation

◆ ApplyEach

template<typename T >
template<class F >
Vector2 ApplyEach ( f,
const Vector2< T > &  arg1,
const Vector2< T > &  arg2 
)
friend

◆ operator*

template<typename T >
Vector2 operator* ( const T  s,
const Vector2< T > &  v 
)
friend

◆ operator<<

template<typename T >
std::ostream& operator<< ( std::ostream &  c,
const Vector2< T > &  u 
)
friend

◆ operator>>

template<typename T >
std::istream& operator>> ( std::istream &  c,
Vector2< T > &  u 
)
friend

Member Data Documentation

◆ DIM

template<typename T >
const int PIKG::Vector2< T >::DIM = 2
static

◆ x

template<typename T >
T PIKG::Vector2< T >::x

◆ y

template<typename T >
T PIKG::Vector2< T >::y

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