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

Implements the householder matrix, the householder vector and some operations with them like as premultiply a householder matrix with other matrix. More...

Defines

#define _OPENMP_HOUSEHOLDER_DIMENSION   1e2
 Minimum value for using openmp in Householder.

Functions

void * householder_vector (size_t n, double *const x, double *const v)
 Derive the householder vector.
void * householder_matrix (size_t m, double **const A, double *const v, size_t idx)
 Derive the householder vector using a matrix.
void * premult_matrix (size_t m, size_t n, double **const A, double **const QR, double *const v, double *const w, size_t idx)
 Compute $P_vA$ where $A$ and $P_v$ are respectively m-by-n and n-by-n matrixs.
void premult_vector (size_t n, double *const v, double *const b)
 Compute $P_vb$ where $b$ and $P_v$ are respectively n-by-1 and n-by-n matrixs.
void postmult (size_t m, size_t n, double **const A, double *const v, double *const w)
 Compute $AP_v$ where $A$ and $P_v$ are respectively m-by-n and n-by-n matrixs.

Detailed Description

Implements the householder matrix, the householder vector and some operations with them like as premultiply a householder matrix with other matrix.

The householder matrix with householder vector $ v $ is

\[ P_v = I - \frac{2}{v^t v} vv^t \]

And the householder vector of a vector $ x \ne 0 $ is $ v = x + sign(x_1)||x||_2 $.


Define Documentation

Minimum value for using openmp in Householder.


Function Documentation

void * householder_matrix ( size_t  m,
double **const  A,
double *const  v,
size_t  idx 
)

Derive the householder vector using a matrix.

Parameters:
[in]mDimension of vector
[in]AMatrix m-by-n
[in]idxIndex of matrix where is started to compute the vector householder
[out]vHouseholder vector
Return values:
NULLIf the vector's elements of v[idx:] are all 0
1Otherwise
Precondition:
The dimension is > 0 and idx is < than number of columns of A
Postcondition:
v[idx:] has been modified

References print_vector().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void * householder_vector ( size_t  n,
double *const  x,
double *const  v 
)

Derive the householder vector.

Parameters:
[in]nDimension of vector
[in]xInput vector
[out]vHouseholder vector
Return values:
NULLIf the vector's elements of x are all 0
1Otherwise
Precondition:
The dimension is not zero
Note:
The vector pointers x and v can be the same

References euclidian_norm().

+ Here is the call graph for this function:

void postmult ( size_t  m,
size_t  n,
double **const  A,
double *const  v,
double *const  w 
)

Compute $AP_v$ where $A$ and $P_v$ are respectively m-by-n and n-by-n matrixs.

Parameters:
[in]mRows
[in]nColumns
[in,out]AMatrix m-by-n where will be saved the result
[in]vHouseholder vector of dimension n
[in]wAuxiliar vector of dimension m

References inner_product().

+ Here is the call graph for this function:

void premult_matrix ( size_t  m,
size_t  n,
double **const  A,
double **const  QR,
double *const  v,
double *const  w,
size_t  idx 
)

Compute $P_vA$ where $A$ and $P_v$ are respectively m-by-n and n-by-n matrixs.

Parameters:
[in]mRows
[in]nColumns
[in]AMatrix m-by-n
[in]vHouseholder vector of dimension m
[in]wAuxiliar vector of dimension n
[in]idxIndex of vectors where is started to compute
[out]QRMatrix m-by-n where will be saved the result
Precondition:
n <= m and idx < m

+ Here is the caller graph for this function:

void premult_vector ( size_t  n,
double *const  v,
double *const  b 
)

Compute $P_vb$ where $b$ and $P_v$ are respectively n-by-1 and n-by-n matrixs.

Parameters:
[in]mRows
[in]nColumns
[in]vHouseholder vector of dimension n
[in,out]bVector n-dimensional where will be saved the result