![]() |
Bachelor's degree final project
v1.0
Faculty of Mathematics, University of Barcelona
|
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 ![]() ![]() ![]() | |
void | premult_vector (size_t n, double *const v, double *const b) |
Compute ![]() ![]() ![]() | |
void | postmult (size_t m, size_t n, double **const A, double *const v, double *const w) |
Compute ![]() ![]() ![]() |
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 is
And the householder vector of a vector is
.
#define _OPENMP_HOUSEHOLDER_DIMENSION 1e2 |
Minimum value for using openmp in Householder.
void * householder_matrix | ( | size_t | m, |
double **const | A, | ||
double *const | v, | ||
size_t | idx | ||
) |
Derive the householder vector using a matrix.
[in] | m | Dimension of vector |
[in] | A | Matrix m-by-n |
[in] | idx | Index of matrix where is started to compute the vector householder |
[out] | v | Householder vector |
NULL | If the vector's elements of v[idx:] are all 0 |
1 | Otherwise |
References print_vector().
void * householder_vector | ( | size_t | n, |
double *const | x, | ||
double *const | v | ||
) |
Derive the householder vector.
[in] | n | Dimension of vector |
[in] | x | Input vector |
[out] | v | Householder vector |
NULL | If the vector's elements of x are all 0 |
1 | Otherwise |
References euclidian_norm().
void postmult | ( | size_t | m, |
size_t | n, | ||
double **const | A, | ||
double *const | v, | ||
double *const | w | ||
) |
Compute where
and
are respectively m-by-n and n-by-n matrixs.
[in] | m | Rows |
[in] | n | Columns |
[in,out] | A | Matrix m-by-n where will be saved the result |
[in] | v | Householder vector of dimension n |
[in] | w | Auxiliar vector of dimension m |
References inner_product().
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 where
and
are respectively m-by-n and n-by-n matrixs.
[in] | m | Rows |
[in] | n | Columns |
[in] | A | Matrix m-by-n |
[in] | v | Householder vector of dimension m |
[in] | w | Auxiliar vector of dimension n |
[in] | idx | Index of vectors where is started to compute |
[out] | QR | Matrix m-by-n where will be saved the result |
void premult_vector | ( | size_t | n, |
double *const | v, | ||
double *const | b | ||
) |
Compute where
and
are respectively n-by-1 and n-by-n matrixs.
[in] | m | Rows |
[in] | n | Columns |
[in] | v | Householder vector of dimension n |
[in,out] | b | Vector n-dimensional where will be saved the result |