Driver class for sparse QR decomposition. More...

#include <driver.hh>

Inheritance diagram for sparseqr::Driver:
concepts::Operator< Real >

Public Member Functions

 Driver (const concepts::SparseMatrix< Real > &A)
 Constructor. More...
 
concepts::TrivExtendRestrict< Real > * extension ()
 Returns the extension from the last n-r to n degrees of freedom. More...
 
virtual void operator() (const concepts::Function< Real > &fncY, concepts::Function< Real > &fncX)
 
void operator() (const concepts::Vector< Real > &fncY, concepts::Vector< Real > &fncX)
 
concepts::Permutation< Real > * Pcol ()
 Returns $P_c$. More...
 
concepts::Permutation< Real > * Prow ()
 Returns $P_r$. More...
 
sparseqr::GivensRotations< Real > * Q ()
 Returns $Q$. More...
 
sparseqr::GivensRotations< Real > * Qt ()
 Returns $Q^\top$. More...
 
int rank ()
 Returns the rank of the matrix. More...
 
concepts::TrivExtendRestrict< Real > * restriction ()
 Returns the restriction from n to the last n-r degrees of freedom. More...
 
virtual ~Driver ()
 

Protected Member Functions

virtual std::ostream & info (std::ostream &os) const
 

Private Types

typedef Cmplxtype< Real >::type c_type
 Real type of data type. More...
 
typedef Realtype< Real >::type r_type
 Real type of data type. More...
 
typedef Real type
 Type of data, e.g. matrix entries. More...
 

Private Member Functions

void compute_ ()
 
virtual const uint dimX () const
 Returns the size of the image space of the operator (number of rows of the corresponding matrix) More...
 
virtual const uint dimY () const
 Returns the size of the source space of the operator (number of columns of the corresponding matrix) More...
 
virtual void operator() ()
 Application operator without argument. More...
 
virtual void operator() (const Function< c_type > &fncY, Function< c_type > &fncX)
 Application operator for complex function fncY. More...
 
virtual void operator() (const Function< r_type > &fncY, Function< Real > &fncX)
 Application operator for real function fncY. More...
 
virtual void show_messages ()
 

Private Attributes

const concepts::SparseMatrix< Real > & A_
 
bool computed_
 
uint dimX_
 Dimension of image space and the source space. More...
 
uint dimY_
 
std::unique_ptr< concepts::TrivExtendRestrict< Real > > ext_
 
std::unique_ptr< concepts::Permutation< Real > > Pcol_
 
concepts::Array< int > pcol_
 
std::unique_ptr< concepts::Permutation< Real > > Prow_
 
concepts::Array< int > prow_
 
std::unique_ptr< sparseqr::GivensRotations< Real > > Q_
 
sparseqr::Qmatrix q_
 
std::unique_ptr< QRqr_
 
std::unique_ptr< sparseqr::GivensRotations< Real > > Qt_
 
int rank_
 
std::unique_ptr< concepts::TrivExtendRestrict< Real > > restr_
 

Detailed Description

Driver class for sparse QR decomposition.

Performs a QR factorization on a sparse mxn matrix A, m>=n, such that

\[ P_r \cdot Q^\top \cdot A \cdot P_c^\top = \begin{pmatrix} R \\ 0 \end{pmatrix} \]

the different matrices can be asked for individually. At the same time, this class can act as a linear solver using the QR decomposition of the matrix.

Author
Philipp Frauenfelder, 2004
Test:

test::DriverTest

test::DeepCompositionsTest

Definition at line 34 of file driver.hh.

Member Typedef Documentation

◆ c_type

typedef Cmplxtype<Real >::type concepts::Operator< Real >::c_type
inherited

Real type of data type.

Definition at line 49 of file compositions.hh.

◆ r_type

typedef Realtype<Real >::type concepts::Operator< Real >::r_type
inherited

Real type of data type.

Definition at line 47 of file compositions.hh.

◆ type

typedef Real concepts::Operator< Real >::type
inherited

Type of data, e.g. matrix entries.

Definition at line 45 of file compositions.hh.

Constructor & Destructor Documentation

◆ Driver()

sparseqr::Driver::Driver ( const concepts::SparseMatrix< Real > &  A)
inline

Constructor.

The constructor does not compute or copy anything, just initialises local variables.

Parameters
AMatrix to decompose

Definition at line 41 of file driver.hh.

◆ ~Driver()

virtual sparseqr::Driver::~Driver ( )
virtual

Member Function Documentation

◆ compute_()

void sparseqr::Driver::compute_ ( )
private

◆ dimX()

virtual const uint concepts::Operator< Real >::dimX ( ) const
inlinevirtualinherited

Returns the size of the image space of the operator (number of rows of the corresponding matrix)

Definition at line 93 of file compositions.hh.

◆ dimY()

virtual const uint concepts::Operator< Real >::dimY ( ) const
inlinevirtualinherited

Returns the size of the source space of the operator (number of columns of the corresponding matrix)

Definition at line 98 of file compositions.hh.

◆ extension()

concepts::TrivExtendRestrict<Real>* sparseqr::Driver::extension ( )

Returns the extension from the last n-r to n degrees of freedom.

◆ info()

virtual std::ostream& sparseqr::Driver::info ( std::ostream &  os) const
protectedvirtual

Reimplemented from concepts::Operator< Real >.

◆ operator()() [1/5]

virtual void concepts::Operator< Real >::operator() ( )
virtualinherited

Application operator without argument.

Reimplemented in concepts::VecOperator< Real >.

◆ operator()() [2/5]

virtual void sparseqr::Driver::operator() ( const concepts::Function< Real > &  fncY,
concepts::Function< Real > &  fncX 
)
virtual

◆ operator()() [3/5]

void sparseqr::Driver::operator() ( const concepts::Vector< Real > &  fncY,
concepts::Vector< Real > &  fncX 
)

◆ operator()() [4/5]

virtual void concepts::Operator< Real >::operator() ( const Function< c_type > &  fncY,
Function< c_type > &  fncX 
)
virtualinherited

Application operator for complex function fncY.

Computes fncX = A(fncY) where A is this operator. fncX becomes complex.

In derived classes its enough to implement the operator() for complex Operator's. If a real counterpart is not implemented, the function fncY is splitted into real and imaginary part and the application operator for real functions is called for each. Then the result is combined.

If in a derived class the operator() for complex Operator's is not implemented, a exception is thrown from here.

Reimplemented in concepts::VecOperator< Real >.

◆ operator()() [5/5]

virtual void concepts::Operator< Real >::operator() ( const Function< r_type > &  fncY,
Function< F > &  fncX 
)
virtualinherited

Application operator for real function fncY.

Computes fncX = A(fncY) where A is this operator.

fncX becomes the type of the operator, for real data it becomes real, for complex data it becomes complex.

In derived classes its enough to implement the operator() for real Operator's. If a complex counterpart is not implemented, the function fncY is transformed to a complex function and then the application operator for complex functions is called.

If in a derived class the operator() for real Operator's is not implemented, a exception is thrown from here.

Reimplemented in concepts::VecOperator< Real >.

◆ Pcol()

concepts::Permutation<Real>* sparseqr::Driver::Pcol ( )

Returns $P_c$.

◆ Prow()

concepts::Permutation<Real>* sparseqr::Driver::Prow ( )

Returns $P_r$.

◆ Q()

sparseqr::GivensRotations<Real>* sparseqr::Driver::Q ( )

Returns $Q$.

◆ Qt()

sparseqr::GivensRotations<Real>* sparseqr::Driver::Qt ( )

Returns $Q^\top$.

◆ rank()

int sparseqr::Driver::rank ( )
inline

Returns the rank of the matrix.

Definition at line 81 of file driver.hh.

◆ restriction()

concepts::TrivExtendRestrict<Real>* sparseqr::Driver::restriction ( )

Returns the restriction from n to the last n-r degrees of freedom.

◆ show_messages()

virtual void concepts::Operator< Real >::show_messages ( )
inlinevirtualinherited

Definition at line 100 of file compositions.hh.

Member Data Documentation

◆ A_

const concepts::SparseMatrix<Real>& sparseqr::Driver::A_
private

Definition at line 71 of file driver.hh.

◆ computed_

bool sparseqr::Driver::computed_
private

Definition at line 72 of file driver.hh.

◆ dimX_

uint concepts::Operator< Real >::dimX_
protectedinherited

Dimension of image space and the source space.

Definition at line 104 of file compositions.hh.

◆ dimY_

uint concepts::Operator< Real >::dimY_
protectedinherited

Definition at line 104 of file compositions.hh.

◆ ext_

std::unique_ptr<concepts::TrivExtendRestrict<Real> > sparseqr::Driver::ext_
private

Definition at line 75 of file driver.hh.

◆ Pcol_

std::unique_ptr<concepts::Permutation<Real> > sparseqr::Driver::Pcol_
private

Definition at line 73 of file driver.hh.

◆ pcol_

concepts::Array<int> sparseqr::Driver::pcol_
private

Definition at line 76 of file driver.hh.

◆ Prow_

std::unique_ptr<concepts::Permutation<Real> > sparseqr::Driver::Prow_
private

Definition at line 73 of file driver.hh.

◆ prow_

concepts::Array<int> sparseqr::Driver::prow_
private

Definition at line 76 of file driver.hh.

◆ Q_

std::unique_ptr<sparseqr::GivensRotations<Real> > sparseqr::Driver::Q_
private

Definition at line 74 of file driver.hh.

◆ q_

sparseqr::Qmatrix sparseqr::Driver::q_
private

Definition at line 78 of file driver.hh.

◆ qr_

std::unique_ptr<QR> sparseqr::Driver::qr_
private

Definition at line 77 of file driver.hh.

◆ Qt_

std::unique_ptr<sparseqr::GivensRotations<Real> > sparseqr::Driver::Qt_
private

Definition at line 74 of file driver.hh.

◆ rank_

int sparseqr::Driver::rank_
private

Definition at line 70 of file driver.hh.

◆ restr_

std::unique_ptr<concepts::TrivExtendRestrict<Real> > sparseqr::Driver::restr_
private

Definition at line 75 of file driver.hh.


The documentation for this class was generated from the following file:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich