concepts::Point< F, dim > Class Template Reference

Basic class for a Point or a vector. More...

#include <vectorsMatrices.hh>

Public Member Functions

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

Private Attributes

data_ [dim]
 

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/6]

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/6]

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/6]

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/6]

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/6]

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.

◆ Point() [6/6]

template<class F , uint dim>
concepts::Point< F, dim >::Point ( const uchar pgm,
const Real  x,
const Real  y,
const Real  z = 0.0 
)

Constructor with a processed map.

Member Function Documentation

◆ dot()

template<class F , uint dim>
F concepts::Point< F, dim >::dot ( const Point< F, dim > &  b) const

Inner product, i.e. for complex arguments: this * conjugate(b)

◆ info()

template<class F , uint dim>
std::ostream& concepts::Point< F, dim >::info ( std::ostream &  os) const

◆ 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.

◆ l2_2()

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

Returns the square of the Euclidian norm of the vector.

◆ lincomb()

template<class F , uint dim>
void concepts::Point< F, dim >::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.

◆ linfty()

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

Returns the Maximum norm of the vector.

◆ max()

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

Sets the vector to the elementwise maximum of a and b.

◆ min()

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

Sets the vector to the elementwise minimum of a and b.

◆ 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/4]

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/4]

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

Inner product.

◆ operator*() [3/4]

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*() [4/4]

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

◆ 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.

◆ operator^() [1/2]

template<class F , uint dim>
F concepts::Point< F, dim >::operator^ ( const Point< F, 2 > &  b) const

Outer product (for 2D)

◆ operator^() [2/2]

template<class F , uint dim>
Point<F, 3> concepts::Point< F, dim >::operator^ ( const Point< F, 3 > &  b) const

Outer product (for 3D)

◆ ortho() [1/3]

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

Rotates the vector by 90 degrees (clockwise) (only 2D)

◆ ortho() [2/3]

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

Returns a by 90 degrees (clockwise) rotated vector (only 2D)

◆ ortho() [3/3]

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.

Member Data Documentation

◆ data_

template<class F , uint dim>
F concepts::Point< F, dim >::data_[dim]
private

Definition at line 209 of file vectorsMatrices.hh.


The documentation for this class was generated from the following file:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich