SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
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>
Used to construct instances of the QR decomposition class, RWQRDecomp.
Definition qr.h:303
Example
// Read a matrix from standard input and print its
// QR decomposition.
// Use a QR decomposition server to prevent pivoting.
#include <rw/lapack/qr.h>
#include <rw/lapack/qrcalcp3.h>
#include <rw/math/genmat.h>
#include <iostream>
int main() {
std::cin >> A;
server.setPivoting(false);
std::cout << "Q=" << QR.Q() << std::endl;
std::cout << "R=" << QR.R() << std::endl;
return 0;
}
A templatized general matrix class.
Definition genmat.h:741
void setPivoting(bool)
Used to construct and work with QR decompositions.
Definition qr.h:99
RWGenMat< TypeT > R() const
RWGenMat< TypeT > Q() const

Constructor & Destructor Documentation

◆ RWQRDecompServer()

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

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

Member Function Documentation

◆ operator()()

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

Computes a QR decomposition.

◆ setFreeIndex()

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.

◆ setInitialIndex()

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

Moves i to an initial position in the decomposition.

◆ setPivoting()

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

Controls whether pivoting is done.

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