SourcePro® API Reference Guide

Product Documentation:
   SourcePro
Documentation Home
List of all members | Public Member Functions
RWQRDecompServer< TypeT, QRCalc > Class Template Reference

Used to construct instances of the QR decomposition class, RWQRDecomp. More...

#include <rw/lapack/qr.h>

Inherits QRCalc.

Public Member Functions

 RWQRDecompServer ()
 
RWQRDecomp< TypeT, QRCalc > operator() (const RWGenMat< TypeT > &) const
 
void setFreeIndex (int i)
 
void setInitialIndex (int i)
 
void setPivoting (bool)
 

Detailed Description

template<class TypeT, class QRCalc>
class RWQRDecompServer< TypeT, QRCalc >

The QR decomposition server class, RWQRDecompServer, is used to construct instances of the QR decomposition class, RWQRDecomp. Using a server rather than the standard QR decomposition constructor gives you control over how pivoting is done.

Normally, columns in the input matrix may be moved in order to increase the robustness of the computation of the QR decomposition. This is called pivoting. In some cases, you may want to ensure that certain columns of the input matrix are kept at the front of the QR decomposition, or you may want to disable pivoting altogether. Using a server object gives you this control.

Note
For greater flexibility, the user can implement this method, or the Linear Algebra Module provides two classes to perform this function — RWQRCalc and RWQRCalcP3. Please see their descriptions in this reference guide for more information.
Synopsis
#include <rw/lapack/qr.h>
#include <rw/lapack/qrcalcp3.h>
Example
// Read a matrix from standard input and print its
// QR decomposition.
// Use a QR decomposition server to prevent pivoting.
#include <iostream>
#include <rw/math/genmat.h>
#include <rw/lapack/qr.h>
#include <rw/lapack/qrcalcp3.h>
int main()
{
std::cin >> A;
server;
server.setPivoting(false);
server(A);
std::cout << "Q=" << QR.Q() << std::endl;
std::cout << "R=" << QR.R() << std::endl;
return 0;
}

Constructor & Destructor Documentation

template<class TypeT, class QRCalc>
RWQRDecompServer< TypeT, QRCalc >::RWQRDecompServer ( )

Default constructor. Builds a new server, which does pivoting by default.

Member Function Documentation

template<class TypeT, class QRCalc>
RWQRDecomp<TypeT, QRCalc> RWQRDecompServer< TypeT, QRCalc >::operator() ( const RWGenMat< TypeT > &  ) const

Computes a QR decomposition.

template<class TypeT, class QRCalc>
void RWQRDecompServer< TypeT, QRCalc >::setFreeIndex ( int  i)

Makes i a free index, so that it may be pivoted to any column of the decomposition. Initially, all indices are free.

template<class TypeT, class QRCalc>
void RWQRDecompServer< TypeT, QRCalc >::setInitialIndex ( int  i)

Moves i to an initial position in the decomposition.

template<class TypeT, class QRCalc>
void RWQRDecompServer< TypeT, QRCalc >::setPivoting ( bool  )

Controls whether pivoting is done.

Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.