SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Used to construct instances of the QR decomposition class, RWQRDecomp<T,QRCalc> . More...
#include <rw/lapack/qr.h>
Public Member Functions | |
RWQRDecompServer () | |
void | setPivoting (bool) |
void | setInitialIndex (int i) |
void | setFreeIndex (int i) |
RWQRDecomp< TypeT, QRCalc > | operator() (const RWGenMat< TypeT > &) const |
The QR decomposition server class, RWQRDecompServer<T,QRCalc>, is used to construct instances of the QR decomposition class, RWQRDecomp<T,QRCalc>. 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.
#include <rw/lapack/qr.h> #include <rw/lapack/qrcalcp3.h> RWQRDecompServer<double, RWQRCalcP3<double> > server;
// 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() { RWGenMat<double> A; std::cin >> A; RWQRDecompServer<double, RWQRCalcP3<double> > server; server.setPivoting(false); RWQRDecomp<double, RWQRCalcP3<double> > QR = server(A); std::cout << "Q=" << QR.Q() << std::endl; std::cout << "R=" << QR.R() << std::endl; return 0; }
RWQRDecompServer< TypeT, QRCalc >::RWQRDecompServer | ( | ) |
Default constructor. Builds a new server, which does pivoting by default.
RWQRDecomp<TypeT,QRCalc> RWQRDecompServer< TypeT, QRCalc >::operator() | ( | const RWGenMat< TypeT > & | ) | const |
Computes a QR decomposition.
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.
void RWQRDecompServer< TypeT, QRCalc >::setInitialIndex | ( | int | i | ) |
Moves i to an initial position in the decomposition.
void RWQRDecompServer< TypeT, QRCalc >::setPivoting | ( | bool | ) |
Controls whether pivoting is done.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.