NEST  2.6.0,not_revisioned_source_dir@0
Public Member Functions | Protected Attributes | Friends | List of all members
nest::Position< D, T > Class Template Reference

#include <position.h>

Public Member Functions

 Position ()
 Default constructor, initializing all coordinates to zero. More...
 
 Position (const T &, const T &)
 2D Constructor. More...
 
 Position (const T &, const T &, const T &)
 3D Constructor. More...
 
 Position (const T *const y)
 Constructor initializing a Position from an array. More...
 
 Position (const std::vector< T > &y)
 Constructor initializing a Position from a std::vector. More...
 
 Position (const Position &other)
 Copy constructor. More...
 
template<class U >
 Position (const Position< D, U > &other)
 
 operator std::vector< T > () const
 
T & operator[] (int i)
 
const T & operator[] (int i) const
 
Token getToken () const
 Moves Position variables into an array. More...
 
template<class OT >
Position operator+ (const Position< D, OT > &other) const
 Elementwise addition. More...
 
template<class OT >
Position operator- (const Position< D, OT > &other) const
 Elementwise subtraction. More...
 
Position operator- () const
 Unary minus. More...
 
template<class OT >
Position operator* (const Position< D, OT > &other) const
 Elementwise multiplication. More...
 
template<class OT >
Position operator/ (const Position< D, OT > &other) const
 Elementwise division. More...
 
Position operator+ (const T &) const
 Elementwise addition with scalar. More...
 
Position operator- (const T &) const
 Elementwise subtraction with scalar. More...
 
Position operator* (const T &) const
 Multiplication with scalar. More...
 
Position operator/ (const T &) const
 Division with scalar. More...
 
template<class OT >
Positionoperator+= (const Position< D, OT > &)
 In-place elementwise addition. More...
 
template<class OT >
Positionoperator-= (const Position< D, OT > &)
 In-place elementwise subtraction. More...
 
template<class OT >
Positionoperator*= (const Position< D, OT > &)
 In-place elementwise multiplication. More...
 
template<class OT >
Positionoperator/= (const Position< D, OT > &)
 In-place elementwise division. More...
 
Positionoperator+= (const T &)
 In-place elementwise addition with scalar. More...
 
Positionoperator-= (const T &)
 In-place elementwise subtraction with scalar. More...
 
Positionoperator*= (const T &)
 In-place multiplication by scalar. More...
 
Positionoperator/= (const T &)
 In-place elementwise division. More...
 
bool operator== (const Position &y) const
 
bool operator!= (const Position &y) const
 
bool operator< (const Position &y) const
 
bool operator> (const Position &y) const
 
bool operator<= (const Position &y) const
 
bool operator>= (const Position &y) const
 
length () const
 Length of Position vector. More...
 
 operator std::string () const
 
void print (std::ostream &out, char sep= ' ') const
 Print position to output stream. More...
 
template<class OT >
Position< D, T > operator+ (const Position< D, OT > &other) const
 
template<class OT >
Position< D, T > operator- (const Position< D, OT > &other) const
 
template<class OT >
Position< D, T > operator* (const Position< D, OT > &other) const
 
template<class OT >
Position< D, T > operator/ (const Position< D, OT > &other) const
 
template<class OT >
Position< D, T > & operator+= (const Position< D, OT > &other)
 
template<class OT >
Position< D, T > & operator-= (const Position< D, OT > &other)
 
template<class OT >
Position< D, T > & operator*= (const Position< D, OT > &other)
 
template<class OT >
Position< D, T > & operator/= (const Position< D, OT > &other)
 

Protected Attributes

x_ [D]
 

Friends

template<int OD, class OT >
class Position
 
std::ostream & operator<< (std::ostream &os, const Position< D, T > &pos)
 Output the Position to an ostream. More...
 

Constructor & Destructor Documentation

template<int D, class T >
nest::Position< D, T >::Position ( )
inline

Default constructor, initializing all coordinates to zero.

template<int D, class T>
nest::Position< D, T >::Position ( const T &  x,
const T &  y 
)
inline

2D Constructor.

References assert(), nest::names::x, and nest::names::y.

template<int D, class T>
nest::Position< D, T >::Position ( const T &  x,
const T &  y,
const T &  z 
)
inline

3D Constructor.

References assert(), nest::names::x, and nest::names::y.

template<int D, class T>
nest::Position< D, T >::Position ( const T *const  y)
inline

Constructor initializing a Position from an array.

template<int D, class T>
nest::Position< D, T >::Position ( const std::vector< T > &  y)
inline

Constructor initializing a Position from a std::vector.

template<int D, class T>
nest::Position< D, T >::Position ( const Position< D, T > &  other)
inline

Copy constructor.

References nest::Position< D, T >::x_.

template<int D, class T >
template<class U >
nest::Position< D, T >::Position ( const Position< D, U > &  other)
inline

Member Function Documentation

template<int D, class T >
Token nest::Position< D, T >::getToken ( ) const

Moves Position variables into an array.

Returns
array of positions stored as a token object.
template<int D, class T >
T nest::Position< D, T >::length ( ) const

Length of Position vector.

Returns
Euclidian norm of the vector.

Referenced by nest::RadialParameter::raw_value().

template<int D, class T >
nest::Position< D, T >::operator std::string ( ) const
Returns
string representation of Position
template<int D, class T >
nest::Position< D, T >::operator std::vector< T > ( ) const
Returns
the Position as a std::vector
template<int D, class T >
bool nest::Position< D, T >::operator!= ( const Position< D, T > &  y) const
inline
Returns
true if not all coordinates are equal

References nest::Position< D, T >::x_.

template<int D, class T>
template<class OT >
Position nest::Position< D, T >::operator* ( const Position< D, OT > &  other) const

Elementwise multiplication.

Returns
elementwise product of coordinates.
template<int D, class T>
Position< D, T > nest::Position< D, T >::operator* ( const T &  a) const
inline

Multiplication with scalar.

Returns
position vector multiplied with the scalar.

References nest::names::a, and nest::names::p.

template<int D, class T>
template<class OT >
Position<D,T> nest::Position< D, T >::operator* ( const Position< D, OT > &  other) const
inline
template<int D, class T>
template<class OT >
Position& nest::Position< D, T >::operator*= ( const Position< D, OT > &  )

In-place elementwise multiplication.

Returns
the Position itself after multiplying with the other Position elementwise.
template<int D, class T>
Position< D, T > & nest::Position< D, T >::operator*= ( const T &  a)
inline

In-place multiplication by scalar.

Returns
the Position itself after multiplying with the scalar.
template<int D, class T>
template<class OT >
Position<D,T>& nest::Position< D, T >::operator*= ( const Position< D, OT > &  other)
inline
template<int D, class T>
template<class OT >
Position nest::Position< D, T >::operator+ ( const Position< D, OT > &  other) const

Elementwise addition.

Returns
elementwise sum of coordinates.
template<int D, class T>
Position< D, T > nest::Position< D, T >::operator+ ( const T &  a) const
inline

Elementwise addition with scalar.

Returns
position vector with scalar added to all coordinates

References nest::names::a, and nest::names::p.

template<int D, class T>
template<class OT >
Position<D,T> nest::Position< D, T >::operator+ ( const Position< D, OT > &  other) const
inline
template<int D, class T>
template<class OT >
Position& nest::Position< D, T >::operator+= ( const Position< D, OT > &  )

In-place elementwise addition.

Returns
the Position itself after adding the other Position elementwise.
template<int D, class T>
Position< D, T > & nest::Position< D, T >::operator+= ( const T &  a)
inline

In-place elementwise addition with scalar.

Returns
the Position itself after adding the scalar to all coordinates.
template<int D, class T>
template<class OT >
Position<D,T>& nest::Position< D, T >::operator+= ( const Position< D, OT > &  other)
inline
template<int D, class T>
template<class OT >
Position nest::Position< D, T >::operator- ( const Position< D, OT > &  other) const

Elementwise subtraction.

Returns
elementwise difference of coordinates.
template<int D, class T >
Position< D, T > nest::Position< D, T >::operator- ( ) const
inline

Unary minus.

Returns
opposite vector.

References nest::names::p.

template<int D, class T>
Position< D, T > nest::Position< D, T >::operator- ( const T &  a) const
inline

Elementwise subtraction with scalar.

Returns
position vector with scalar subtracted from all coordinates

References nest::names::a, and nest::names::p.

template<int D, class T>
template<class OT >
Position<D,T> nest::Position< D, T >::operator- ( const Position< D, OT > &  other) const
inline
template<int D, class T>
template<class OT >
Position& nest::Position< D, T >::operator-= ( const Position< D, OT > &  )

In-place elementwise subtraction.

Returns
the Position itself after subtracting the other Position elementwise.
template<int D, class T>
Position< D, T > & nest::Position< D, T >::operator-= ( const T &  a)
inline

In-place elementwise subtraction with scalar.

Returns
the Position itself after subtracting the scalar from all coordinates.
template<int D, class T>
template<class OT >
Position<D,T>& nest::Position< D, T >::operator-= ( const Position< D, OT > &  other)
inline
template<int D, class T>
template<class OT >
Position nest::Position< D, T >::operator/ ( const Position< D, OT > &  other) const

Elementwise division.

Returns
elementwise quotient of coordinates.
template<int D, class T>
Position< D, T > nest::Position< D, T >::operator/ ( const T &  a) const
inline

Division with scalar.

Returns
position vector divided by the scalar.

References nest::names::a, and nest::names::p.

template<int D, class T>
template<class OT >
Position<D,T> nest::Position< D, T >::operator/ ( const Position< D, OT > &  other) const
inline
template<int D, class T>
template<class OT >
Position& nest::Position< D, T >::operator/= ( const Position< D, OT > &  )

In-place elementwise division.

Returns
the Position itself after dividing by the other Position elementwise.
template<int D, class T>
Position< D, T > & nest::Position< D, T >::operator/= ( const T &  a)
inline

In-place elementwise division.

Returns
the Position itself after dividing by the scalar.
template<int D, class T>
template<class OT >
Position<D,T>& nest::Position< D, T >::operator/= ( const Position< D, OT > &  other)
inline
template<int D, class T >
bool nest::Position< D, T >::operator< ( const Position< D, T > &  y) const
inline
Returns
true if all coordinates are less

References nest::Position< D, T >::x_.

template<int D, class T >
bool nest::Position< D, T >::operator<= ( const Position< D, T > &  y) const
inline
Returns
true if all coordinates are less or equal

References nest::Position< D, T >::x_.

template<int D, class T >
bool nest::Position< D, T >::operator== ( const Position< D, T > &  y) const
inline
Returns
true if all coordinates are equal

References nest::Position< D, T >::x_.

template<int D, class T >
bool nest::Position< D, T >::operator> ( const Position< D, T > &  y) const
inline
Returns
true if all coordinates are greater

References nest::Position< D, T >::x_.

template<int D, class T >
bool nest::Position< D, T >::operator>= ( const Position< D, T > &  y) const
inline
Returns
true if all coordinates are greater or equal

References nest::Position< D, T >::x_.

template<int D, class T >
T & nest::Position< D, T >::operator[] ( int  i)
inline
Returns
an element (coordinate) of the Position
template<int D, class T >
const T & nest::Position< D, T >::operator[] ( int  i) const
inline
Returns
an element (coordinate) of the Position
template<int D, class T >
void nest::Position< D, T >::print ( std::ostream &  out,
char  sep = ' ' 
) const

Print position to output stream.

Format: Only as many coordinates as dimensions, separated by spaces [default], no trailing space.

Parameters
outoutput stream
sepseparator character

Friends And Related Function Documentation

template<int D, class T>
std::ostream& operator<< ( std::ostream &  os,
const Position< D, T > &  pos 
)
friend

Output the Position to an ostream.

template<int D, class T>
template<int OD, class OT >
friend class Position
friend

Member Data Documentation

template<int D, class T>
T nest::Position< D, T >::x_[D]
protected

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