QR.h
Go to the documentation of this file.
00001 // This file is part of Eigen, a lightweight C++ template library
00002 // for linear algebra.
00003 //
00004 // Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr>
00005 // Copyright (C) 2011 Benoit Jacob <jacob.benoit.1@gmail.com>
00006 //
00007 // This Source Code Form is subject to the terms of the Mozilla
00008 // Public License v. 2.0. If a copy of the MPL was not distributed
00009 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
00010 
00011 #ifndef EIGEN2_QR_H
00012 #define EIGEN2_QR_H
00013 
00014 namespace Eigen { 
00015 
00016 template<typename MatrixType>
00017 class QR : public HouseholderQR<MatrixType>
00018 {
00019   public:
00020 
00021     typedef HouseholderQR<MatrixType> Base;
00022     typedef Block<const MatrixType, MatrixType::ColsAtCompileTime, MatrixType::ColsAtCompileTime> MatrixRBlockType;
00023 
00024     QR() : Base() {}
00025 
00026     template<typename T>
00027     explicit QR(const T& t) : Base(t) {}
00028 
00029     template<typename OtherDerived, typename ResultType>
00030     bool solve(const MatrixBase<OtherDerived>& b, ResultType *result) const
00031     {
00032       *result = static_cast<const Base*>(this)->solve(b);
00033       return true;
00034     }
00035 
00036     MatrixType matrixQ(void) const {
00037       MatrixType ret = MatrixType::Identity(this->rows(), this->cols());
00038       ret = this->householderQ() * ret;
00039       return ret;
00040     }
00041 
00042     bool isFullRank() const {
00043       return true;
00044     }
00045     
00046     const TriangularView<MatrixRBlockType, UpperTriangular>
00047     matrixR(void) const
00048     {
00049       int cols = this->cols();
00050       return MatrixRBlockType(this->matrixQR(), 0, 0, cols, cols).template triangularView<UpperTriangular>();
00051     }
00052 };
00053 
00058 template<typename Derived>
00059 const QR<typename MatrixBase<Derived>::PlainObject>
00060 MatrixBase<Derived>::qr() const
00061 {
00062   return QR<PlainObject>(eval());
00063 }
00064 
00065 } // end namespace Eigen
00066 
00067 #endif // EIGEN2_QR_H


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:38:44