Class documentation of Concepts

Loading...
Searching...
No Matches
concepts::Mapping< F, DimY, DimX > Class Template Reference

#include <vectorsMatrices.hh>

Public Member Functions

 Mapping ()
 
 Mapping (const Mapping< F, DimY, DimX > &m)
 Copy constructor.
 
template<class H >
 Mapping (const Mapping< H, DimY, DimX > &m)
 
template<class G >
 Mapping (G x)
 
template<class... FieldTs>
 Mapping (FieldTs... data)
 
 Mapping (const Point< F, DimY > first)
 
 Mapping (const Point< F, DimY > first, const Point< F, DimY > second)
 
 Mapping (const Point< F, DimY > first, const Point< F, DimY > second, const Point< F, DimY > third)
 
 Mapping (const UnitNd< DimY > &n)
 
determinant () const
 Returns the determinant of the matrix (only valid for square matrices)
 
Mapping< F, DimY, DimXadjugate () const
 
Mapping< F, DimY-1, DimX-1 > subMatrix (uint i, uint j) const
 
trace () const
 Returns the trace (only valid for square matrices)
 
Mapping< F, DimX, DimYinverse () const
 Returns the inverse of the matrix.
 
const F & operator() (uint i, uint j) const
 Returns an entry of the matrix.
 
F & operator() (uint i, uint j)
 Returns an entry of the matrix (for read / write access)
 
template<class H >
Point< typename Combtype< F, H >::type, DimYoperator* (const Point< H, DimX > &p) const
 Returns a mapped Point.
 
template<class H >
Point< H, DimYmapPoint (const Point< H, DimX > &b) const
 
template<class G , uint DimZ>
Mapping< typename Combtype< G, F >::type, DimY, DimZoperator* (const Mapping< G, DimX, DimZ > &m) const
 Multiplication operator.
 
Mapping< F, DimY, DimX > & operator*= (const F n)
 Scaling operator.
 
Mapping< F, DimY, DimX > & operator*= (const Mapping< F, DimY, DimX > &m)
 Multiplication operator ( *this = operator()(*this, m); )
 
template<class G >
Mapping< typename Combtype< G, F >::type, DimY, DimXoperator* (const G n) const
 Scaling operator.
 
Mapping< F, DimY, DimX > & operator+= (const Mapping< F, DimY, DimX > &M)
 Addition operator.
 
Mapping< F, DimY, DimX > & scaleRows (const Point< F, DimY > &s)
 Scales the rows with the respective entries in s.
 
Mapping< F, DimY, DimX > & scaleCols (const Point< F, DimX > &s)
 Scales the columns with the respective entries in s.
 
Mapping< F, DimX, DimYtranspose () const
 Returns the transpose of the matrix.
 
Mapping< F, DimY, DimYprodTranspose () const
 Returns the product with the transpose of the matrix.
 
Point< F, DimYcolumn (const uint i) const
 Returns a column of the matrix.
 
void zeros ()
 Fills the matrix with zeros.
 
template<class H >
void mapTranspose (const Point< H, DimY > &y, Point< H, DimX > &x) const
 
void rank1Product (const Point< F, DimX > x, const Point< F, DimY > y)
 Computes x yT and adds the result to the matrix.
 
template<class H , class J , uint dimy, uint dimx>
void operator() (const Point< H, dimy > &y, Point< J, dimx > &x) const
 
std::ostream & info (std::ostream &os) const
 

Detailed Description

template<class F, uint DimY, uint DimX = DimY>
class concepts::Mapping< F, DimY, DimX >

Basic class for a 2D or 3D map. The template parameters make it possible to use this class for real or complex values. The main use is to represent linear maps in 2D or 3D.

Test:
test::MappingTest
Author
Philipp Frauenfelder, 2001

Definition at line 313 of file vectorsMatrices.hh.

Constructor & Destructor Documentation

◆ Mapping() [1/9]

template<class F , uint DimY, uint DimX = DimY>
concepts::Mapping< F, DimY, DimX >::Mapping ( )
inline

Default constructor. The elements of the matrix are left uninitialized.

Definition at line 318 of file vectorsMatrices.hh.

◆ Mapping() [2/9]

template<class F , uint DimY, uint DimX = DimY>
concepts::Mapping< F, DimY, DimX >::Mapping ( const Mapping< F, DimY, DimX > &  m)
inline

Copy constructor.

Definition at line 321 of file vectorsMatrices.hh.

◆ Mapping() [3/9]

template<class F , uint DimY, uint DimX = DimY>
template<class H >
concepts::Mapping< F, DimY, DimX >::Mapping ( const Mapping< H, DimY, DimX > &  m)
inline

Constructor. Useful to generate a Mapping<Cmplx,DimX,DimY> out of a Mapping<Real,DimX,DimY>.

Precondition
F has a function F.operator=(H)

Definition at line 331 of file vectorsMatrices.hh.

◆ Mapping() [4/9]

template<class F , uint DimY, uint DimX = DimY>
template<class G >
concepts::Mapping< F, DimY, DimX >::Mapping ( x)
inline

Constructor. All elements are initialized to x.

Definition at line 344 of file vectorsMatrices.hh.

◆ Mapping() [5/9]

template<class F , uint DimY, uint DimX = DimY>
template<class... FieldTs>
concepts::Mapping< F, DimY, DimX >::Mapping ( FieldTs...  data)
inline

Constructor with variadic templates. Can be sed to construct matrices of any size by giving the entries as parameters, e.g. Mapping<Real,2,2>(1.,2.,3.,4.) creates a 2x2 matrix, while Mapping<Real,2,2>(1.,2.,3.) will produce an assertion as the number of entries (i.e. 3) mismatches the dimension 2x2.

Note
The flag MappingConstructorHack has to be set to 1 considering Py++ with C++11 standard

Definition at line 359 of file vectorsMatrices.hh.

◆ Mapping() [6/9]

template<class F , uint DimY, uint DimX = DimY>
concepts::Mapping< F, DimY, DimX >::Mapping ( const Point< F, DimY first)

Constructor for a 1D.

Parameters
firstFirst column of the matrix

◆ Mapping() [7/9]

template<class F , uint DimY, uint DimX = DimY>
concepts::Mapping< F, DimY, DimX >::Mapping ( const Point< F, DimY first,
const Point< F, DimY second 
)

Constructor for a 2D mapping.

Parameters
firstFirst column of the matrix
secondSecond column of the matrix

◆ Mapping() [8/9]

template<class F , uint DimY, uint DimX = DimY>
concepts::Mapping< F, DimY, DimX >::Mapping ( const Point< F, DimY first,
const Point< F, DimY second,
const Point< F, DimY third 
)

Constructor for a 3D mapping.

Parameters
firstFirst column of the matrix
secondSecond column of the matrix
thirdThird column of the matrix

◆ Mapping() [9/9]

template<class F , uint DimY, uint DimX = DimY>
concepts::Mapping< F, DimY, DimX >::Mapping ( const UnitNd< DimY > &  n)

Constructor for rotation

Parameters
nNormal vector of the rotation

Member Function Documentation

◆ adjugate()

template<class F , uint DimY, uint DimX = DimY>
Mapping< F, DimY, DimX > concepts::Mapping< F, DimY, DimX >::adjugate ( ) const

Returns the adjugate of the matrix (only valid for square matrices) [f \mbox{adj}(M) = M^{-1}\det(M) \f]

◆ mapPoint()

template<class F , uint DimY, uint DimX = DimY>
template<class H >
Point< H, DimY > concepts::Mapping< F, DimY, DimX >::mapPoint ( const Point< H, DimX > &  b) const
inline

Definition at line 459 of file vectorsMatrices.hh.

◆ mapTranspose()

template<class F , uint DimY, uint DimX>
template<class H >
void concepts::Mapping< F, DimY, DimX >::mapTranspose ( const Point< H, DimY > &  y,
Point< H, DimX > &  x 
) const
inline

Computes x = AT y

Parameters
Hcan be F or any more general class that can operate on instances of F.

Definition at line 540 of file vectorsMatrices.hh.

◆ operator()() [1/3]

template<class F , uint DimY, uint DimX>
template<class H , class J , uint dimy, uint dimx>
void concepts::Mapping< F, DimY, DimX >::operator() ( const Point< H, dimy > &  y,
Point< J, dimx > &  x 
) const

Application operator. Computes x = A y where A is the matrix. If the dimensions do not match the matrix A is extended by the identity matrix.

Definition at line 557 of file vectorsMatrices.hh.

◆ operator()() [2/3]

template<class F , uint DimY, uint DimX = DimY>
F & concepts::Mapping< F, DimY, DimX >::operator() ( uint  i,
uint  j 
)
inline

Returns an entry of the matrix (for read / write access)

Definition at line 446 of file vectorsMatrices.hh.

◆ operator()() [3/3]

template<class F , uint DimY, uint DimX = DimY>
const F & concepts::Mapping< F, DimY, DimX >::operator() ( uint  i,
uint  j 
) const
inline

Returns an entry of the matrix.

Definition at line 437 of file vectorsMatrices.hh.

◆ operator*()

template<class F , uint DimY, uint DimX>
template<class H >
Point< typename Combtype< F, H >::type, DimY > concepts::Mapping< F, DimY, DimX >::operator* ( const Point< H, DimX > &  p) const

Returns a mapped Point.

Definition at line 531 of file vectorsMatrices.hh.

◆ subMatrix()

template<class F , uint DimY, uint DimX = DimY>
Mapping< F, DimY-1, DimX-1 > concepts::Mapping< F, DimY, DimX >::subMatrix ( uint  i,
uint  j 
) const

Returns the submatrix where the ith and jth column are erased

◆ zeros()

template<class F , uint DimY, uint DimX = DimY>
void concepts::Mapping< F, DimY, DimX >::zeros ( )
inline

Fills the matrix with zeros.

Definition at line 497 of file vectorsMatrices.hh.


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