SG++-Doxygen-Documentation
|
Implements the Up/Down scheme with two dimensions with special operations: i,j. More...
#include <UpDownTwoOpDims.hpp>
Public Member Functions | |
virtual void | mult (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result) |
starts the Multiplication with the matrix More... | |
void | multParallelBuildingBlock (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t operationDimOne, size_t operationDimTwo) |
this functions provides the same functionality as the normal mult routine. More... | |
UpDownTwoOpDims (sgpp::base::GridStorage *storage, sgpp::base::DataMatrix &coef) | |
Constructor. More... | |
UpDownTwoOpDims (sgpp::base::GridStorage *storage) | |
Constructor. More... | |
virtual | ~UpDownTwoOpDims () |
Destructor. More... | |
Public Member Functions inherited from sgpp::base::OperationMatrix | |
OperationMatrix () | |
Constructor. More... | |
virtual | ~OperationMatrix () |
Destructor. More... | |
Protected Types | |
typedef sgpp::base::GridStorage::grid_iterator | grid_iterator |
Protected Member Functions | |
virtual void | down (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim)=0 |
Down-step in dimension dim for \((\phi_i(x),\phi_j(x))_{L_2}\). More... | |
virtual void | downOpDimOne (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim)=0 |
1D down if the current dim is equal to i More... | |
virtual void | downOpDimOneAndOpDimTwo (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim)=0 |
1D down, if the current dim is equal to i and j More... | |
virtual void | downOpDimTwo (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim)=0 |
1D down if the current dim is equal to j More... | |
void | specialOpOne (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim, size_t op_dim_one, size_t op_dim_two) |
All calculations for gradient, parallel version using OpenMP 3. More... | |
void | specialOpOneAndOpTwo (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim, size_t op_dim_one, size_t op_dim_two) |
if the current dimension is equal to the both special operation dimensions More... | |
void | specialOpTwo (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim, size_t op_dim_one, size_t op_dim_two) |
All calculations for gradient, Part 2, parallel version using OpenMP 3. More... | |
virtual void | up (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim)=0 |
Up-step in dimension dim for \((\phi_i(x),\phi_j(x))_{L_2}\). More... | |
void | updown (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim, size_t op_dim_one, size_t op_dim_two) |
Recursive procedure for updown, parallel version using OpenMP 3. More... | |
virtual void | upOpDimOne (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim)=0 |
1D up if the current dim is equal to i More... | |
virtual void | upOpDimOneAndOpDimTwo (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim)=0 |
1D up, if the current dim is equal to i and j More... | |
virtual void | upOpDimTwo (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result, size_t dim)=0 |
1D up if the current dim is equal to j More... | |
Protected Attributes | |
const std::vector< size_t > | algoDims |
algorithmic dimensions, operator is applied in this dimensions More... | |
sgpp::base::DataMatrix * | coefs |
Pointer to the coefficients of this bilinear form. More... | |
const size_t | numAlgoDims_ |
number of algorithmic dimensions More... | |
sgpp::base::GridStorage * | storage |
Pointer to the grid's storage object. More... | |
Static Protected Attributes | |
static const size_t | maxParallelDims_ = TASKS_PARALLEL_UPDOWN |
max number of parallel stages (dimension recursive calls) More... | |
Implements the Up/Down scheme with two dimensions with special operations: i,j.
Parallelization with OpenMP 2 / 3 is supported!
Only symmetric operations are support –> only the "left lower triangular matrix", i <= j, is calculated, please keep that in mind when designing the coefficient vector: the non-diagonal elements must be multiplied by 2 before executing this Up/down scheme!
sgpp::pde::UpDownTwoOpDims::UpDownTwoOpDims | ( | sgpp::base::GridStorage * | storage, |
sgpp::base::DataMatrix & | coef | ||
) |
Constructor.
storage | the grid's sgpp::base::GridStorage object |
coef | vector that contains the constant coefficients of this operation |
|
explicit |
Constructor.
storage | the grid's sgpp::base::GridStorage object |
|
virtual |
Destructor.
|
protectedpure virtual |
Down-step in dimension dim for \((\phi_i(x),\phi_j(x))_{L_2}\).
Applies the down-part of the one-dimensional mass matrix in one dimension. Computes
\[\int_{x=0}^1 \phi_i(x) \sum_{j, l_i\geq l_j} \alpha_j \phi_j(x) dx.\]
dim | dimension in which to apply the down-part |
alpha | vector of coefficients |
result | vector to store the results in |
Referenced by updown().
|
protectedpure virtual |
1D down if the current dim is equal to i
alpha | the coefficients of the gridpoints |
result | vector with the result of this operation |
dim | the dimension in that down-Gradient is applied |
Referenced by specialOpOne().
|
protectedpure virtual |
1D down, if the current dim is equal to i and j
alpha | the coefficients of the gridpoints |
result | vector with the result of this operation |
dim | the dimension in that down-Gradient is applied |
Referenced by specialOpOneAndOpTwo().
|
protectedpure virtual |
1D down if the current dim is equal to j
alpha | the coefficients of the gridpoints |
result | vector with the result of this operation |
dim | the dimension in that down-Gradient is applied |
Referenced by specialOpTwo().
|
virtual |
starts the Multiplication with the matrix
alpha | DataVector that contains the ansatzfunctions' coefficients |
result | DataVector into which the result of the Laplace operation is stored |
Implements sgpp::base::OperationMatrix.
References sgpp::base::DataVector::add(), sgpp::base::DataVector::axpy(), coefs, sgpp::base::DataMatrix::get(), sgpp::base::DataVector::getSize(), python.statsfileInfo::i, python.utils.statsfile2gnuplot::j, numAlgoDims_, sgpp::base::DataVector::setAll(), and updown().
void sgpp::pde::UpDownTwoOpDims::multParallelBuildingBlock | ( | sgpp::base::DataVector & | alpha, |
sgpp::base::DataVector & | result, | ||
size_t | operationDimOne, | ||
size_t | operationDimTwo | ||
) |
this functions provides the same functionality as the normal mult routine.
However, it doesn't set up an OpenMP task initialization as the mult routine. This method has to be called within a OpenMP task parallelized region.
Using this function is useful in the following case: Assuming the solver of a certain Equation requires several operators in the space discretization (e.g. Black Scholes Equations) this method can be used to parallelize their calculation which might result in a better parallel efficiency on systems with 4 or more cores hence fewer barriers are needed.
For a full calculation of this operator, in mult serval number of up/downs are needed. This number is equal to the square of the number of the grid's dimensions. All different steps can be executed in parallel. Here only one up/Down is executed, identified by its special dimensions.
Attention: A symmetric operator is assumed: This method only start a calculation if operationDimTwo is less or equal operationDimOne
alpha | vector of coefficients |
result | vector to store the results in |
operationDimOne | Dimension in which the first special operator is applied |
operationDimTwo | Dimension in which the second special operator is applied |
References sgpp::base::DataVector::add(), sgpp::base::DataVector::axpy(), coefs, sgpp::base::DataMatrix::get(), sgpp::base::DataVector::getSize(), numAlgoDims_, sgpp::base::DataVector::setAll(), and updown().
|
protected |
All calculations for gradient, parallel version using OpenMP 3.
alpha | the coefficients of the grid points |
result | the result of the operations |
dim | the current dimension in the recursion |
op_dim_one | the dimension in which to use the first gradient |
op_dim_two | the dimension in which to use the second gradient |
References sgpp::base::DataVector::add(), algoDims, downOpDimOne(), sgpp::base::DataVector::getSize(), maxParallelDims_, numAlgoDims_, updown(), and upOpDimOne().
Referenced by updown().
|
protected |
if the current dimension is equal to the both special operation dimensions
alpha | the coefficients of the grid points |
result | the result of the operations |
dim | the current dimension in the recursion |
op_dim_one | the dimension in which to use the first gradient |
op_dim_two | the dimension in which to use the second gradient |
References sgpp::base::DataVector::add(), algoDims, downOpDimOneAndOpDimTwo(), sgpp::base::DataVector::getSize(), maxParallelDims_, numAlgoDims_, updown(), and upOpDimOneAndOpDimTwo().
Referenced by updown().
|
protected |
All calculations for gradient, Part 2, parallel version using OpenMP 3.
alpha | the coefficients of the grid points |
result | the result of the operations |
dim | the current dimension in the recursion |
op_dim_one | the dimension in which to use the first gradient |
op_dim_two | the dimension in which to use the second gradient |
References sgpp::base::DataVector::add(), algoDims, downOpDimTwo(), sgpp::base::DataVector::getSize(), maxParallelDims_, numAlgoDims_, updown(), and upOpDimTwo().
Referenced by updown().
|
protectedpure virtual |
Up-step in dimension dim for \((\phi_i(x),\phi_j(x))_{L_2}\).
Applies the up-part of the one-dimensional mass matrix in one dimension. Computes
\[\int_{x=0}^1 \phi_i(x) \sum_{j, l_i < l_j} \alpha_j \phi_j(x) dx.\]
dim | dimension in which to apply the up-part |
alpha | vector of coefficients |
result | vector to store the results in |
Referenced by updown().
|
protected |
Recursive procedure for updown, parallel version using OpenMP 3.
dim | the current dimension |
op_dim_one | the dimension in which to use the first gradient |
op_dim_two | the dimension in which to use the second gradient |
alpha | vector of coefficients |
result | vector to store the results in |
References sgpp::base::DataVector::add(), algoDims, down(), sgpp::base::DataVector::getSize(), maxParallelDims_, numAlgoDims_, specialOpOne(), specialOpOneAndOpTwo(), specialOpTwo(), and up().
Referenced by mult(), multParallelBuildingBlock(), specialOpOne(), specialOpOneAndOpTwo(), and specialOpTwo().
|
protectedpure virtual |
1D up if the current dim is equal to i
alpha | the coefficients of the gridpoints |
result | vector with the result of this operation |
dim | the dimension in that up-Gradient is applied |
Referenced by specialOpOne().
|
protectedpure virtual |
1D up, if the current dim is equal to i and j
alpha | the coefficients of the gridpoints |
result | vector with the result of this operation |
dim | the dimension in that up-Gradient is applied |
Referenced by specialOpOneAndOpTwo().
|
protectedpure virtual |
1D up if the current dim is equal to j
alpha | the coefficients of the gridpoints |
result | vector with the result of this operation |
dim | the dimension in that up-Gradient is applied |
Referenced by specialOpTwo().
|
protected |
algorithmic dimensions, operator is applied in this dimensions
Referenced by specialOpOne(), specialOpOneAndOpTwo(), specialOpTwo(), and updown().
|
protected |
Pointer to the coefficients of this bilinear form.
Referenced by mult(), and multParallelBuildingBlock().
|
staticprotected |
max number of parallel stages (dimension recursive calls)
Referenced by specialOpOne(), specialOpOneAndOpTwo(), specialOpTwo(), and updown().
|
protected |
number of algorithmic dimensions
Referenced by mult(), multParallelBuildingBlock(), specialOpOne(), specialOpOneAndOpTwo(), specialOpTwo(), and updown().
|
protected |
Pointer to the grid's storage object.