OSVR-Core
QR.h
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr>
5 // Copyright (C) 2011 Benoit Jacob <jacob.benoit.1@gmail.com>
6 //
7 // This Source Code Form is subject to the terms of the Mozilla
8 // Public License v. 2.0. If a copy of the MPL was not distributed
9 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11 #ifndef EIGEN2_QR_H
12 #define EIGEN2_QR_H
13 
14 namespace Eigen {
15 
16 template<typename MatrixType>
17 class QR : public HouseholderQR<MatrixType>
18 {
19  public:
20 
23 
24  QR() : Base() {}
25 
26  template<typename T>
27  explicit QR(const T& t) : Base(t) {}
28 
29  template<typename OtherDerived, typename ResultType>
30  bool solve(const MatrixBase<OtherDerived>& b, ResultType *result) const
31  {
32  *result = static_cast<const Base*>(this)->solve(b);
33  return true;
34  }
35 
36  MatrixType matrixQ(void) const {
37  MatrixType ret = MatrixType::Identity(this->rows(), this->cols());
38  ret = this->householderQ() * ret;
39  return ret;
40  }
41 
42  bool isFullRank() const {
43  return true;
44  }
45 
47  matrixR(void) const
48  {
49  int cols = this->cols();
50  return MatrixRBlockType(this->matrixQR(), 0, 0, cols, cols).template triangularView<UpperTriangular>();
51  }
52 };
53 
58 template<typename Derived>
61 {
62  return QR<PlainObject>(eval());
63 }
64 
65 } // end namespace Eigen
66 
67 #endif // EIGEN2_QR_H
const MatrixType & matrixQR() const
Definition: HouseholderQR.h:145
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: TestIMU_Common.h:87
HouseholderSequenceType householderQ() const
This method returns an expression of the unitary matrix Q as a sequence of Householder transformation...
Definition: HouseholderQR.h:136
Definition: QR.h:17
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:103
Householder QR decomposition of a matrix.
Definition: ForwardDeclarations.h:221
Base class for triangular part in a matrix.
Definition: TriangularMatrix.h:158
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48