Class documentation of Concepts

Loading...
Searching...
No Matches
concepts::Point< F, dim > Class Template Reference

#include <vectorsMatrices.hh>

Public Member Functions

 Point ()
 
template<class G >
 Point (const Point< G, dim > &p)
 Copy constructor.
 
template<uint dim2>
 Point (const Point< F, dim2 > &p)
 Copy constructor.
 
 Point (F x)
 
 Point (const F e0, const F e1, const F e2=0)
 Constructor for a 2D or a 3D Point.
 
 Point (const uchar *pgm, const Real x, const Real y, const Real z=0.0)
 Constructor with a processed map.
 
template<uint dim2>
Point< F, dim > & operator= (const Point< F, dim2 > &b)
 Assignment operator.
 
const F & operator[] (const uint i) const
 Index operator.
 
F & operator[] (const uint i)
 Index operator.
 
 operator F* ()
 Returns a pointer to the data.
 
 operator const F * () const
 Returns a pointer to the data.
 
Point< F, dim > & operator+= (const Point< F, dim > &p)
 Addition operator.
 
Point< F, dim > operator+ (const Point< F, dim > &p) const
 Addition operator.
 
Point< F, dim > & operator-= (const Point< F, dim > &p)
 Subtraction operator.
 
Point< F, dim > operator- (const Point< F, dim > &p) const
 Subtraction operator.
 
operator* (const Point< F, dim > &b) const
 Inner product.
 
operator* (const UnitNd< dim > &b) const
 
dot (const Point< F, dim > &b) const
 Inner product, i.e. for complex arguments: this * conjugate(b)
 
template<class G >
Point< F, dim > & operator*= (const G n)
 Scaling operator.
 
template<class G >
Point< F, dim > & operator/= (const G n)
 Unscaling operator.
 
Point< Cmplx, dim > operator* (const Cmplx n) const
 Scaling operator with a complex number.
 
Point< F, dim > operator* (const Real n) const
 Scaling operator with a real number.
 
Point< Cmplx, dim > operator/ (const Cmplx n) const
 Unscaling operator with a complex number.
 
Point< F, dim > operator/ (const Real n) const
 Unscaling operator with a real number.
 
Point< F, dim > & scale (const Point< F, dim > &n)
 Scaling.
 
Point< F, 3 > operator^ (const Point< F, 3 > &b) const
 Outer product (for 3D)
 
operator^ (const Point< F, 2 > &b) const
 Outer product (for 2D)
 
Real l2 () const
 Returns the Euclidian norm of the vector.
 
Real l2_2 () const
 Returns the square of the Euclidian norm of the vector.
 
Real linfty () const
 Returns the Maximum norm of the vector.
 
void lincomb (const Point< F, dim > &a, const Point< F, dim > &b, const F ca=1.0, const F cb=1.0)
 Assign the vector the linear combination of a and b.
 
void max (const Point< F, dim > &a, const Point< F, dim > &b)
 Sets the vector to the elementwise maximum of a and b.
 
void min (const Point< F, dim > &a, const Point< F, dim > &b)
 Sets the vector to the elementwise minimum of a and b.
 
Point< F, dim > & ortho (const Point< F, dim > &a)
 
Point< F, dim > & ortho ()
 Rotates the vector by 90 degrees (clockwise) (only 2D)
 
Point< F, dim > ortho () const
 Returns a by 90 degrees (clockwise) rotated vector (only 2D)
 
std::ostream & info (std::ostream &os) const
 

Detailed Description

template<class F, uint dim>
class concepts::Point< F, dim >

Basic class for a Point or a vector. The template parameters make it possible to use this class for 2D and 3D Points and vectors with real or complex valued entries.

Test:

test::PointTest

test::MappingTest

Author
Philipp Frauenfelder, 2001

Definition at line 46 of file vectorsMatrices.hh.

Constructor & Destructor Documentation

◆ Point() [1/5]

template<class F , uint dim>
concepts::Point< F, dim >::Point ( )
inline

Constructor. Initializes all elements to 0.

Definition at line 51 of file vectorsMatrices.hh.

◆ Point() [2/5]

template<class F , uint dim>
template<class G >
concepts::Point< F, dim >::Point ( const Point< G, dim > &  p)
inline

Copy constructor.

Definition at line 54 of file vectorsMatrices.hh.

◆ Point() [3/5]

template<class F , uint dim>
template<uint dim2>
concepts::Point< F, dim >::Point ( const Point< F, dim2 > &  p)
inline

Copy constructor.

Definition at line 59 of file vectorsMatrices.hh.

◆ Point() [4/5]

template<class F , uint dim>
concepts::Point< F, dim >::Point ( x)
inline

Constructor. All elements are initialized to x.

Definition at line 68 of file vectorsMatrices.hh.

◆ Point() [5/5]

template<class F , uint dim>
concepts::Point< F, dim >::Point ( const F  e0,
const F  e1,
const F  e2 = 0 
)
inline

Constructor for a 2D or a 3D Point.

Definition at line 70 of file vectorsMatrices.hh.

Member Function Documentation

◆ l2()

template<class F , uint dim>
Real concepts::Point< F, dim >::l2 ( ) const
inline

Returns the Euclidian norm of the vector.

Definition at line 182 of file vectorsMatrices.hh.

◆ operator const F *()

template<class F , uint dim>
concepts::Point< F, dim >::operator const F * ( ) const
inline

Returns a pointer to the data.

Definition at line 101 of file vectorsMatrices.hh.

◆ operator F*()

template<class F , uint dim>
concepts::Point< F, dim >::operator F* ( )
inline

Returns a pointer to the data.

Definition at line 99 of file vectorsMatrices.hh.

◆ operator*() [1/2]

template<class F , uint dim>
Point< Cmplx, dim > concepts::Point< F, dim >::operator* ( const Cmplx  n) const
inline

Scaling operator with a complex number.

Definition at line 148 of file vectorsMatrices.hh.

◆ operator*() [2/2]

template<class F , uint dim>
Point< F, dim > concepts::Point< F, dim >::operator* ( const Real  n) const
inline

Scaling operator with a real number.

Definition at line 153 of file vectorsMatrices.hh.

◆ operator*=()

template<class F , uint dim>
template<class G >
Point< F, dim > & concepts::Point< F, dim >::operator*= ( const G  n)
inline

Scaling operator.

Definition at line 134 of file vectorsMatrices.hh.

◆ operator+()

template<class F , uint dim>
Point< F, dim > concepts::Point< F, dim >::operator+ ( const Point< F, dim > &  p) const
inline

Addition operator.

Definition at line 110 of file vectorsMatrices.hh.

◆ operator+=()

template<class F , uint dim>
Point< F, dim > & concepts::Point< F, dim >::operator+= ( const Point< F, dim > &  p)
inline

Addition operator.

Definition at line 104 of file vectorsMatrices.hh.

◆ operator-()

template<class F , uint dim>
Point< F, dim > concepts::Point< F, dim >::operator- ( const Point< F, dim > &  p) const
inline

Subtraction operator.

Definition at line 121 of file vectorsMatrices.hh.

◆ operator-=()

template<class F , uint dim>
Point< F, dim > & concepts::Point< F, dim >::operator-= ( const Point< F, dim > &  p)
inline

Subtraction operator.

Definition at line 115 of file vectorsMatrices.hh.

◆ operator/() [1/2]

template<class F , uint dim>
Point< Cmplx, dim > concepts::Point< F, dim >::operator/ ( const Cmplx  n) const
inline

Unscaling operator with a complex number.

Definition at line 159 of file vectorsMatrices.hh.

◆ operator/() [2/2]

template<class F , uint dim>
Point< F, dim > concepts::Point< F, dim >::operator/ ( const Real  n) const
inline

Unscaling operator with a real number.

Definition at line 164 of file vectorsMatrices.hh.

◆ operator/=()

template<class F , uint dim>
template<class G >
Point< F, dim > & concepts::Point< F, dim >::operator/= ( const G  n)
inline

Unscaling operator.

Definition at line 142 of file vectorsMatrices.hh.

◆ operator=()

template<class F , uint dim>
template<uint dim2>
Point< F, dim > & concepts::Point< F, dim >::operator= ( const Point< F, dim2 > &  b)
inline

Assignment operator.

Definition at line 83 of file vectorsMatrices.hh.

◆ operator[]() [1/2]

template<class F , uint dim>
F & concepts::Point< F, dim >::operator[] ( const uint  i)
inline

Index operator.

Definition at line 94 of file vectorsMatrices.hh.

◆ operator[]() [2/2]

template<class F , uint dim>
const F & concepts::Point< F, dim >::operator[] ( const uint  i) const
inline

Index operator.

Definition at line 90 of file vectorsMatrices.hh.

◆ ortho()

template<class F , uint dim>
Point< F, dim > & concepts::Point< F, dim >::ortho ( const Point< F, dim > &  a)

Change vector to the by 90 degrees (clockwise) rotated vector a (only 2D)

◆ scale()

template<class F , uint dim>
Point< F, dim > & concepts::Point< F, dim >::scale ( const Point< F, dim > &  n)
inline

Scaling.

Definition at line 170 of file vectorsMatrices.hh.


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