concepts::Mapping< F, DimY, DimX > Class Template Reference
Basic class for a 2D or 3D map. More...
#include <vectorsMatrices.hh>
Public Member Functions | |
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]. More... | |
Point< F, DimY > | column (const uint i) const |
Returns a column of the matrix. More... | |
F | determinant () const |
Returns the determinant of the matrix (only valid for square matrices) More... | |
std::ostream & | info (std::ostream &os) const |
Mapping< F, DimX, DimY > | inverse () const |
Returns the inverse of the matrix. More... | |
Mapping () | |
Default constructor. More... | |
Mapping (const Mapping< F, DimY, DimX > &m) | |
Copy constructor. More... | |
template<class H > | |
Mapping (const Mapping< H, DimY, DimX > &m) | |
Constructor. More... | |
Mapping (const Point< F, DimY > first) | |
Constructor for a 1D. More... | |
Mapping (const Point< F, DimY > first, const Point< F, DimY > second) | |
Constructor for a 2D mapping. More... | |
Mapping (const Point< F, DimY > first, const Point< F, DimY > second, const Point< F, DimY > third) | |
Constructor for a 3D mapping. More... | |
Mapping (const UnitNd< DimY > &n) | |
Constructor for rotation. More... | |
template<class... FieldTs> | |
Mapping (FieldTs... data) | |
Constructor with variadic templates. More... | |
template<class G > | |
Mapping (G x) | |
Constructor. More... | |
template<class H > | |
Point< H, DimY > | mapPoint (const Point< H, DimX > &b) const |
template<class H > | |
void | mapTranspose (const Point< H, DimY > &y, Point< H, DimX > &x) const |
Computes x = AT y. More... | |
template<class H , class J , uint dimy, uint dimx> | |
void | operator() (const Point< H, dimy > &y, Point< J, dimx > &x) const |
Application operator. More... | |
F & | operator() (uint i, uint j) |
Returns an entry of the matrix (for read / write access) More... | |
const F & | operator() (uint i, uint j) const |
Returns an entry of the matrix. More... | |
template<class G > | |
Mapping< typename Combtype< G, F >::type, DimY, DimX > | operator* (const G n) const |
Scaling operator. More... | |
template<class G , uint DimZ> | |
Mapping< typename Combtype< G, F >::type, DimY, DimZ > | operator* (const Mapping< G, DimX, DimZ > &m) const |
Multiplication operator. More... | |
template<class H > | |
Point< typename Combtype< F, H >::type, DimY > | operator* (const Point< H, DimX > &p) const |
Returns a mapped Point. More... | |
Mapping< F, DimY, DimX > & | operator*= (const F n) |
Scaling operator. More... | |
Mapping< F, DimY, DimX > & | operator*= (const Mapping< F, DimY, DimX > &m) |
Multiplication operator ( *this = operator()(*this, m); ) More... | |
Mapping< F, DimY, DimX > & | operator+= (const Mapping< F, DimY, DimX > &M) |
Addition operator. More... | |
Mapping< F, DimY, DimY > | prodTranspose () const |
Returns the product with the transpose of the matrix. More... | |
void | rank1Product (const Point< F, DimX > x, const Point< F, DimY > y) |
Computes x yT and adds the result to the matrix. More... | |
Mapping< F, DimY, DimX > & | scaleCols (const Point< F, DimX > &s) |
Scales the columns with the respective entries in s . More... | |
Mapping< F, DimY, DimX > & | scaleRows (const Point< F, DimY > &s) |
Scales the rows with the respective entries in s . More... | |
Mapping< F, DimY-1, DimX-1 > | subMatrix (uint i, uint j) const |
Returns the submatrix where the ith and jth column are erased. More... | |
F | trace () const |
Returns the trace (only valid for square matrices) More... | |
Mapping< F, DimX, DimY > | transpose () const |
Returns the transpose of the matrix. More... | |
void | zeros () |
Fills the matrix with zeros. More... | |
Private Member Functions | |
const uint | lin_ (uint i, uint j) const |
index in stack array of entry (i,j) of row-based matrix More... | |
Private Attributes | |
F | data_ [DimX *DimY] |
entries of the matrix More... | |
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.
Definition at line 313 of file vectorsMatrices.hh.
Constructor & Destructor Documentation
◆ Mapping() [1/9]
|
inline |
Default constructor.
The elements of the matrix are left uninitialized.
Definition at line 318 of file vectorsMatrices.hh.
◆ Mapping() [2/9]
|
inline |
Copy constructor.
Definition at line 321 of file vectorsMatrices.hh.
◆ Mapping() [3/9]
|
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]
|
inline |
◆ Mapping() [5/9]
|
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]
concepts::Mapping< F, DimY, DimX >::Mapping | ( | const Point< F, DimY > | first | ) |
Constructor for a 1D.
- Parameters
-
first First column of the matrix
◆ Mapping() [7/9]
concepts::Mapping< F, DimY, DimX >::Mapping | ( | const Point< F, DimY > | first, |
const Point< F, DimY > | second | ||
) |
Constructor for a 2D mapping.
- Parameters
-
first First column of the matrix second Second column of the matrix
◆ Mapping() [8/9]
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
-
first First column of the matrix second Second column of the matrix third Third column of the matrix
◆ Mapping() [9/9]
concepts::Mapping< F, DimY, DimX >::Mapping | ( | const UnitNd< DimY > & | n | ) |
Constructor for rotation.
- Parameters
-
n Normal vector of the rotation
Member Function Documentation
◆ adjugate()
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].
◆ column()
Point<F, DimY> concepts::Mapping< F, DimY, DimX >::column | ( | const uint | i | ) | const |
Returns a column of the matrix.
◆ determinant()
F concepts::Mapping< F, DimY, DimX >::determinant | ( | ) | const |
Returns the determinant of the matrix (only valid for square matrices)
◆ info()
std::ostream& concepts::Mapping< F, DimY, DimX >::info | ( | std::ostream & | os | ) | const |
◆ inverse()
Mapping<F, DimX, DimY> concepts::Mapping< F, DimY, DimX >::inverse | ( | ) | const |
Returns the inverse of the matrix.
◆ lin_()
|
inlineprivate |
index in stack array of entry (i,j) of row-based matrix
Definition at line 524 of file vectorsMatrices.hh.
◆ mapPoint()
|
inline |
Definition at line 459 of file vectorsMatrices.hh.
◆ mapTranspose()
|
inline |
Computes x = AT y.
- Parameters
-
H can 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]
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]
|
inline |
Returns an entry of the matrix (for read / write access)
Definition at line 446 of file vectorsMatrices.hh.
◆ operator()() [3/3]
|
inline |
Returns an entry of the matrix.
Definition at line 437 of file vectorsMatrices.hh.
◆ operator*() [1/3]
Mapping<typename Combtype<G,F>::type, DimY, DimX> concepts::Mapping< F, DimY, DimX >::operator* | ( | const G | n | ) | const |
Scaling operator.
◆ operator*() [2/3]
Mapping<typename Combtype<G,F>::type, DimY, DimZ> concepts::Mapping< F, DimY, DimX >::operator* | ( | const Mapping< G, DimX, DimZ > & | m | ) | const |
Multiplication operator.
◆ operator*() [3/3]
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.
◆ operator*=() [1/2]
Mapping<F, DimY, DimX>& concepts::Mapping< F, DimY, DimX >::operator*= | ( | const F | n | ) |
Scaling operator.
◆ operator*=() [2/2]
Mapping<F, DimY, DimX>& concepts::Mapping< F, DimY, DimX >::operator*= | ( | const Mapping< F, DimY, DimX > & | m | ) |
Multiplication operator ( *this = operator()(*this, m); )
◆ operator+=()
Mapping<F, DimY, DimX>& concepts::Mapping< F, DimY, DimX >::operator+= | ( | const Mapping< F, DimY, DimX > & | M | ) |
Addition operator.
◆ prodTranspose()
Mapping<F, DimY, DimY> concepts::Mapping< F, DimY, DimX >::prodTranspose | ( | ) | const |
Returns the product with the transpose of the matrix.
◆ rank1Product()
void concepts::Mapping< F, DimY, DimX >::rank1Product | ( | const Point< F, DimX > | x, |
const Point< F, DimY > | y | ||
) |
Computes x yT and adds the result to the matrix.
◆ scaleCols()
Mapping<F, DimY, DimX>& concepts::Mapping< F, DimY, DimX >::scaleCols | ( | const Point< F, DimX > & | s | ) |
Scales the columns with the respective entries in s
.
◆ scaleRows()
Mapping<F, DimY, DimX>& concepts::Mapping< F, DimY, DimX >::scaleRows | ( | const Point< F, DimY > & | s | ) |
Scales the rows with the respective entries in s
.
◆ subMatrix()
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.
◆ trace()
F concepts::Mapping< F, DimY, DimX >::trace | ( | ) | const |
Returns the trace (only valid for square matrices)
◆ transpose()
Mapping<F, DimX, DimY> concepts::Mapping< F, DimY, DimX >::transpose | ( | ) | const |
Returns the transpose of the matrix.
◆ zeros()
|
inline |
Fills the matrix with zeros.
Definition at line 497 of file vectorsMatrices.hh.
Member Data Documentation
◆ data_
|
private |
entries of the matrix
Definition at line 521 of file vectorsMatrices.hh.
The documentation for this class was generated from the following file:
- basics/vectorsMatrices.hh