concepts::Permutation< F > Class Template Reference
Permutation operator. More...
#include <permutation.hh>
Public Types | |
typedef Cmplxtype< F >::type | c_type |
Complex type of data type. More... | |
typedef _Matrix_iterator< F, const F &, const F * > | const_iterator |
typedef std::conditional< std::is_same< typename Realtype< F >::type, F >::value, typename Realtype< F >::type, typename Cmplxtype< F >::type >::type | d_type |
Data type, depending if F is real or complex. More... | |
typedef _Matrix_iterator< F, F &, F * > | iterator |
typedef Realtype< F >::type | r_type |
Real type of data type. More... | |
typedef F | value_type |
Public Member Functions | |
virtual void | add (const uint i, const uint j, const F value, const bool use_threshold=false, const Real threshold_value=1e-8) |
Addition operator Add the value to the entry (i,j) if not zero (for use_threshold = false), or if the absolute avlue is bigger than the threshold_value (for use_threshold = true) More... | |
iterator | begin (uint r=0) |
Iterator over the elements, standing at position (r,0). More... | |
const_iterator | begin (uint r=0) const |
Constant iterator over the elements, standing at position (r,0) More... | |
void | composeRestr (const TrivExtendRestrict< F > &restr, Matrix< F > &dest) const |
Computes the composition of a Permutation and a TrivExtendRestrict and stores the result in dest . More... | |
void | convertToMatrix (Matrix< F > &dest) const |
Convertes this permutation to the matrix dest . More... | |
iterator | end () |
Iterator, standing behind last element. More... | |
const_iterator | end () const |
Constant iterator, standing behind last element. More... | |
const uint | nofCols () const |
Number of columns. More... | |
const uint | nofRows () const |
Number of rows. More... | |
virtual void | operator() (const Function< c_type > &fncY, Function< c_type > &fncX) |
virtual void | operator() (const Function< r_type > &fncY, Function< F > &fncX) |
Computes fncX = A(fncY ) where A is this matrix. More... | |
virtual F & | operator() (const uint i, const uint j) |
Returns and allows access to entry with indices i and j . More... | |
virtual F | operator() (const uint i, const uint j) const |
Returns entry with indices i and j . More... | |
virtual bool | operator== (const Matrix< F > &otherMat) const |
int | operator[] (const uint i) const |
Returns the permutation of index i . More... | |
Permutation (const Permutation< F > &perm, bool transpose=false) | |
Copy constructor. More... | |
template<class G > | |
Permutation (const Space< G > &space, const Array< int > &perm, bool transpose=false) | |
Constructor. More... | |
Permutation (uint dim, const Array< int > &perm, bool transpose=false) | |
virtual void | set (const uint i, const uint j, const F value, const bool use_threshold=false, const Real threshold_value=1e-8) |
Affectation operator Affet the value to the entry (i,j) if not zero (for use_threshold = false), or if the absolute value is bigger than the threshold_value (for use_threshold = true) More... | |
virtual void | transpMult (const Vector< c_type > &fncY, Vector< c_type > &fncX) |
virtual void | transpMult (const Vector< r_type > &fncY, Vector< F > &fncX) |
Computes fncX = AT fncY where A is this matrix. More... | |
Static Public Member Functions | |
template<class G > | |
static void | assembly (Matrix< F > &dest, const BilinearForm< F, G > &bf, const ElementPairList< G > &pairs) |
Assembly operator for dest using the bilinear form bf . More... | |
template<class G > | |
static void | assembly (Matrix< F > &dest, const Sequence< ElementWithCell< G > * > seq, const BilinearForm< F, G > &bf, const Real threshold=0.0) |
Assembly operator for dest using the bilinear form bf . More... | |
template<class G > | |
static void | assembly (Matrix< F > &dest, const Sequence< ElementWithCell< G > * > seqX, const Space< G > &spcY, const BilinearForm< F, G > &bf, const Real threshold=0.0) |
Assembly operator for dest using the bilinear form bf . More... | |
template<class G > | |
static void | assembly (Matrix< F > &dest, const Space< G > &spc, const BilinearForm< F, G > &bf, const Real threshold=0.0) |
Assembly operator for dest using the bilinear form bf . More... | |
template<class G > | |
static void | assembly (Matrix< F > &dest, const Space< G > &spc, const Sequence< bool > &seq, const BilinearForm< F, G > &bf, const Real threshold=0.0) |
Assembly operator for dest using the bilinear form bf on space spc . More... | |
template<class G > | |
static void | assembly (Matrix< F > &dest, const Space< G > &spcX, const Space< G > &spcY, const BilinearForm< F, G > &bf, const Real threshold=0.0, const bool single=false) |
Assembly operator for dest using the bilinear form bf . More... | |
template<class G > | |
static void | assembly (Matrix< F > &dest, const Space< G > &spcX, const Space< G > &spcY, const Sequence< bool > &seq, const BilinearForm< F, G > &bf, const Real threshold=0.0, const bool single=false) |
Assembly operator for dest using the bilinear form bf . More... | |
template<class G > | |
static void | assembly (Matrix< F > &dest, Scan< Element< G > > *sc, const BilinearForm< F, G > &bf, const Real threshold=0.0) |
Assembly operator for dest using the bilinear form bf . More... | |
Protected Member Functions | |
virtual std::ostream & | info (std::ostream &os) const |
Private Attributes | |
Array< int > | p_ |
Array defining the permutation. More... | |
Timing Interface | |
These functions are used to get timings from class internal computations. The values are stored in a user defined concepts::InOutParameters structure in different arrays (see concepts::ResultsTable table;
std::ofstream ofs("table.gnuplot");
ofs << std::setprecision(20);
table.print<concepts::ResultsTable::GNUPLOT>(ofs);
| |
static InOutParameters * | timings_ |
Place to store timing values. More... | |
static uint | timeCntr_ |
Counter for timing table. More... | |
static void | setTimings (InOutParameters *timings) |
Sets the class to store the timing values in. More... | |
static bool | timings () |
Returns true if the class is able to do timings. More... | |
Detailed Description
template<typename F>
class concepts::Permutation< F >
Permutation operator.
This operator permutes a vector according to a given permutation (given as an array of indices).
The forward permutation acts like x
[i] = y
[perm[i]] on the vectors. The inverse acts like x
[perm[i]] = y
[i].
Definition at line 41 of file permutation.hh.
Member Typedef Documentation
◆ c_type
typedef Cmplxtype<F>::type concepts::Permutation< F >::c_type |
Complex type of data type.
Definition at line 46 of file permutation.hh.
◆ const_iterator
|
inherited |
◆ d_type
typedef std::conditional<std::is_same<typename Realtype<F>::type, F>::value , typename Realtype<F>::type, typename Cmplxtype<F>::type >::type concepts::Permutation< F >::d_type |
Data type, depending if F is real or complex.
Definition at line 49 of file permutation.hh.
◆ iterator
|
inherited |
◆ r_type
typedef Realtype<F>::type concepts::Permutation< F >::r_type |
Real type of data type.
Definition at line 44 of file permutation.hh.
◆ value_type
|
inherited |
Constructor & Destructor Documentation
◆ Permutation() [1/3]
concepts::Permutation< F >::Permutation | ( | const Space< G > & | space, |
const Array< int > & | perm, | ||
bool | transpose = false |
||
) |
Constructor.
- Parameters
-
space Source and image space perm Array defining the permutation transpose Applies the permutation ( false
) or its transpose (ie. its inverse,true
)
◆ Permutation() [2/3]
concepts::Permutation< F >::Permutation | ( | uint | dim, |
const Array< int > & | perm, | ||
bool | transpose = false |
||
) |
◆ Permutation() [3/3]
concepts::Permutation< F >::Permutation | ( | const Permutation< F > & | perm, |
bool | transpose = false |
||
) |
Copy constructor.
- Parameters
-
perm Permutation transpose Transposes the permutation while copying
Member Function Documentation
◆ add()
|
virtualinherited |
Addition operator Add the value to the entry (i,j) if not zero (for use_threshold
= false), or if the absolute avlue is bigger than the threshold_value
(for use_threshold
= true)
◆ assembly() [1/8]
|
staticinherited |
Assembly operator for dest
using the bilinear form bf
.
This assembly operator uses the element pairs taken from pairs
. For every two elements found in a ElementPair in pairs
, the bilinear form is evaluated and the result assembled into dest
.
◆ assembly() [2/8]
|
staticinherited |
Assembly operator for dest
using the bilinear form bf
.
This assembly operator does not compute element matrices for two different elements. The elements are taken from the element sequence seq
.
◆ assembly() [3/8]
|
staticinherited |
Assembly operator for dest
using the bilinear form bf
.
This assembly operator computes also the element matrices for two different elements. The elements are taken from the element sequence seqX
for the test space, and the trial space spcY
is fully taken into account.
◆ assembly() [4/8]
|
staticinherited |
Assembly operator for dest
using the bilinear form bf
.
This assembly operator does not compute element matrices for two different elements. The elements are taken from the space spc
.
- Examples
- linearDG1d.cc.
◆ assembly() [5/8]
|
staticinherited |
Assembly operator for dest
using the bilinear form bf
on space spc
.
This assembly operator does not compute element matrices for two different elements. The elements are computing on the cells that are flagged by seq
.
◆ assembly() [6/8]
|
staticinherited |
Assembly operator for dest
using the bilinear form bf
.
This assembly operator computes also the element matrices for two different elements (coming from test space spcX
and trial space spcY
).
◆ assembly() [7/8]
|
staticinherited |
Assembly operator for dest
using the bilinear form bf
.
This assembly operator computes also the element matrices for two different elements (coming from test space spcX
and trial space spcY
). The elements are computing on the cells that are flagged by seq
.
◆ assembly() [8/8]
|
staticinherited |
Assembly operator for dest
using the bilinear form bf
.
This assembly operator does not compute element matrices for two different elements. The elements are taken from the space scanner sc
.
◆ begin() [1/2]
|
inlineinherited |
◆ begin() [2/2]
|
inlineinherited |
◆ composeRestr()
void concepts::Permutation< F >::composeRestr | ( | const TrivExtendRestrict< F > & | restr, |
Matrix< F > & | dest | ||
) | const |
Computes the composition of a Permutation
and a TrivExtendRestrict
and stores the result in dest
.
◆ convertToMatrix()
void concepts::Permutation< F >::convertToMatrix | ( | Matrix< F > & | dest | ) | const |
Convertes this permutation to the matrix dest
.
- Precondition
dest
is empty
◆ end() [1/2]
|
inlineinherited |
◆ end() [2/2]
|
inlineinherited |
◆ info()
|
protectedvirtual |
◆ nofCols()
|
inlineinherited |
◆ nofRows()
|
inlineinherited |
◆ operator()() [1/4]
|
virtual |
Implements concepts::Matrix< F >.
◆ operator()() [2/4]
|
virtual |
Computes fncX
= A(fncY
) where A is this matrix.
Implements concepts::Matrix< F >.
◆ operator()() [3/4]
|
virtual |
Returns and allows access to entry with indices i
and j
.
Implements concepts::Matrix< F >.
◆ operator()() [4/4]
|
virtual |
Returns entry with indices i
and j
.
Implements concepts::Matrix< F >.
◆ operator==()
|
inlinevirtualinherited |
◆ operator[]()
|
inline |
Returns the permutation of index i
.
Definition at line 74 of file permutation.hh.
◆ set()
|
virtualinherited |
Affectation operator Affet the value to the entry (i,j) if not zero (for use_threshold
= false), or if the absolute value is bigger than the threshold_value
(for use_threshold
= true)
◆ setTimings()
|
staticinherited |
Sets the class to store the timing values in.
Additionally, the timeCntr_
is reset to 0. This counter is used to fill in the values into the arrays listed below in subsequent calls. The following timings are taken and stored in timings:
-
evaluation of bilinear form in
bilinear_form
-
application of T matrix in
tmatrix_apply
-
assembling into global matrix in
global_assembly
◆ timings()
|
staticinherited |
Returns true if the class is able to do timings.
The ability to do timings depends on a compiler switch in matrix.cc
file.
◆ transpMult() [1/2]
|
virtual |
Implements concepts::Matrix< F >.
◆ transpMult() [2/2]
|
virtual |
Computes fncX
= AT fncY
where A is this matrix.
Implements concepts::Matrix< F >.
Member Data Documentation
◆ p_
|
private |
Array defining the permutation.
Definition at line 98 of file permutation.hh.
◆ timeCntr_
|
staticprivateinherited |
◆ timings_
|
staticprivateinherited |
The documentation for this class was generated from the following file:
- operator/permutation.hh