QR.h
Go to the documentation of this file.
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
HouseholderSequenceType householderQ() const
Block< const MatrixType, MatrixType::ColsAtCompileTime, MatrixType::ColsAtCompileTime > MatrixRBlockType
Definition: QR.h:22
USING_NAMESPACE_ACADO typedef TaylorVariable< Interval > T
const TriangularView< MatrixRBlockType, UpperTriangular > matrixR(void) const
Definition: QR.h:47
QR()
Definition: QR.h:24
bool solve(const MatrixBase< OtherDerived > &b, ResultType *result) const
Definition: QR.h:30
HouseholderQR< MatrixType > Base
Definition: QR.h:21
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: matrix.hpp:471
QR(const T &t)
Definition: QR.h:27
MatrixType matrixQ(void) const
Definition: QR.h:36
Definition: QR.h:17
Expression of a fixed-size or dynamic-size block.
Definition: Core/Block.h:102
Householder QR decomposition of a matrix.
Base class for triangular part in a matrix.
bool isFullRank() const
Definition: QR.h:42
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
const MatrixType & matrixQR() const


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:02