lsp::householder_transform< T > Class Template Reference

A functor for the Householder transformation. More...

#include <householder_transform.h>

List of all members.

Public Types

typedef T vector_type
 The type of vector object used to construct the transformation.
typedef vector_type::value_type value_type
 The type of elements of that vector.
typedef vector_type::size_type size_type
 The type for seeking in the vector object.

Public Member Functions

 householder_transform (size_type l, size_type p, vector_type v)
 An object constructor.
template<class M >
void apply (matrix_row< M > v) const
template<class M >
void apply (matrix_column< M > v) const
template<class U >
void apply (U &v) const
template<class U >
void apply (U v, vector_tag) const
template<class U >
void apply (U &w, row_major_tag) const
 Transformation operaton.
template<class U >
void apply (U &w, column_major_tag) const
const value_type s () const
const value_type h () const


Detailed Description

template<class T>
class lsp::householder_transform< T >

A functor for the Householder transformation.

Housholder transformation is a transformation with three arguments: v, l, p. It is defined as:

\[ Qv = \left(\begin{array}{c} v_1 \\ v_2 \\ \cdots \\ v_{p-1} \\ s \equiv -\sigma \left(v_p^2+\sum_{i=l}^m v_i^2\right)^{\frac{1}{2}} \\ v_{p+1} \\ \cdots \\ v_{l-1} \\ 0 \\ \cdots \\ 0 \end{array}\right) \equiv u \]


Constructor & Destructor Documentation

template<class T >
lsp::householder_transform< T >::householder_transform ( size_type  l,
size_type  p,
vector_type  v 
) [inline]

An object constructor.

Parameters:
[in] l The number of nonzero coordinates of the result vector
[in] p The index of coordinate to be altered
[in,out] v The initial vector.
The elements of transformation matrix $ Q $ are calculated in this routine. Not all of them but only that that are needed to perform the transformation on the any vector object.


Member Function Documentation

template<class T >
template<class U >
void lsp::householder_transform< T >::apply ( U &  w,
row_major_tag   
) const [inline]

Transformation operaton.

Parameters:
[in,out] w Matrix or vector to be transformed
It computes result of $ Qw $ or $ wQ $ and stores it in the w. Both vector and matrix productions are available.

template<class T >
const value_type lsp::householder_transform< T >::h (  )  const [inline]

Returns:
$ h = v_p - s $

template<class T >
const value_type lsp::householder_transform< T >::s (  )  const [inline]

Returns:
$ s $ value is described above


The documentation for this class was generated from the following file:

doxygen