Bachelor's degree final project  v1.0
Faculty of Mathematics, University of Barcelona
Defines | Functions
Vector permutation

The act of permuting objects or values is called permutation and we implement a permutation to a vector. More...

Defines

#define _OPENMP_PERMUTATION_DIMENSION   1e2
 Minimum value for using the openmp library in permutation.

Functions

void permutation_init (size_t n, size_t *const p)
 Initialize a identity vector permutation.
void permutation_vector (size_t n, size_t *const p, double *const x, double *const px)
 Permute the values of the vector x into px based on the vector permutation p.

Detailed Description

The act of permuting objects or values is called permutation and we implement a permutation to a vector.

A permutation $ \tau $ of $ n+1 $ elements is a bijection of $ \{0,\ldots,n\} $ from that set onto itself and with the composition is a non-commutative group. The Cauchy's two-line notation is

\[ \tau = \begin{pmatrix} 0 & \cdots & n \\ \tau(0) & \cdots & \tau(n) \end{pmatrix}. \]

In one-line notation, one gives only the second row of this array. In this functions, one-line notation will be used.


Define Documentation

Minimum value for using the openmp library in permutation.


Function Documentation

void permutation_init ( size_t  n,
size_t *const  p 
)

Initialize a identity vector permutation.

Parameters:
[in]nDimension of vector
[out]pVector permutation
Precondition:
Dimension is not zero
Note:
If vector permutation is NULL, anything is done

+ Here is the caller graph for this function:

void permutation_vector ( size_t  n,
size_t *const  p,
double *const  x,
double *const  px 
)

Permute the values of the vector x into px based on the vector permutation p.

Parameters:
[in]nDimension of vectors
[in]pVector permutation
[in]xVector n-dimensional where will be read the data
[out]pxVector n-dimensional where will be saved the permutations by the vector permutation
Precondition:
Dimension is not 0 and the pointers x and px are not NULL
Note:
The vectors can be the same If the vector permutation is NULL, anything is done

+ Here is the caller graph for this function: