libtpcmodel
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Functions
hholder.c File Reference
#include <stdlib.h>
#include <math.h>
#include "include/hholder.h"
Include dependency graph for hholder.c:

Go to the source code of this file.

Functions

double householder_transform (double *vector, int N, double *help)
int householder_hm (double tau, double *vector, double **matrix, int rowNr, int columnNr)
int householder_hv (double tau, int size, double *v, double *w)
double householder_norm (double *v, int size)

Function Documentation

int householder_hm ( double  tau,
double *  vector,
double **  matrix,
int  rowNr,
int  columnNr 
)

applies a householder transformation defined by vector "vector" and scalar tau to the left-hand side of the matrix. (I - tau vector vector^T)*matrix The result of the transform is stored in matrix.

Returns:
Returns 0 if ok.
Parameters:
tauCoefficient defining householder transform
vectorVector defining householder transform
matrixthe matrix that is to be transformed
rowNrNr of rows in matrix
columnNrNr of columns in matrix

Definition at line 97 of file hholder.c.

Referenced by qr_decomp().

int householder_hv ( double  tau,
int  size,
double *  v,
double *  w 
)

applies a householder transformation defined by vector v and coeffiecient tau to vector w w = (I - tau v v^T) w

Returns:
Returns 0 if ok.

Definition at line 155 of file hholder.c.

Referenced by qr_QTvec(), and qr_Qvec().

double householder_norm ( double *  v,
int  size 
)

Returns the euclidean norm of a vector

Definition at line 193 of file hholder.c.

Referenced by householder_transform().

double householder_transform ( double *  vector,
int  N,
double *  help 
)

This function prepares a Householder transformation P = I - tau h h^T which can be used to zero all the elements of the input vector except the first one that will get value beta. On output the elements 1 - size-1 of the vector h are stored in locations vector[1] - vector[size-1] of the input vector and value of beta is stored in location vector[0].

Returns:
The scalar tau is returned.
Parameters:
vectorThe N-vector to be transformed
Nsize of the vector
helpN-array of working space

Definition at line 36 of file hholder.c.

References householder_norm().

Referenced by qr_decomp().

Here is the call graph for this function: