| 1 | // This file is part of Eigen, a lightweight C++ template librarycxx . . $ `<file>/lib/fab/vendor/Eigen/src/QR/HouseholderQR.h`/ |
| 2 | // for linear algebra. |
| 3 | // |
| 4 | // Copyright (C) 2008-2010 Gael Guennebaud <[email protected]> |
| 5 | // Copyright (C) 2009 Benoit Jacob <[email protected]> |
| 6 | // Copyright (C) 2010 Vincent Lejeune |
| 7 | // |
| 8 | // This Source Code Form is subject to the terms of the Mozilla |
| 9 | // Public License v. 2.0. If a copy of the MPL was not distributed |
| 10 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 11 | |
| 12 | #ifndef EIGEN_QR_H |
| 13 | #define EIGEN_QR_Hcxx . . $ `lib/fab/vendor/Eigen/src/QR/HouseholderQR.h:13:9`! |
| 14 | |
| 15 | namespace Eigencxx . . $ Eigen/ { |
| 16 | |
| 17 | /** \ingroup QR_Module |
| 18 | * |
| 19 | * |
| 20 | * \class HouseholderQR |
| 21 | * |
| 22 | * \brief Householder QR decomposition of a matrix |
| 23 | * |
| 24 | * \param MatrixType the type of the matrix of which we are computing the QR decomposition |
| 25 | * |
| 26 | * This class performs a QR decomposition of a matrix \b A into matrices \b Q and \b R |
| 27 | * such that |
| 28 | * \f[ |
| 29 | * \mathbf{A} = \mathbf{Q} \, \mathbf{R} |
| 30 | * \f] |
| 31 | * by using Householder transformations. Here, \b Q a unitary matrix and \b R an upper triangular matrix. |
| 32 | * The result is stored in a compact way compatible with LAPACK. |
| 33 | * |
| 34 | * Note that no pivoting is performed. This is \b not a rank-revealing decomposition. |
| 35 | * If you want that feature, use FullPivHouseholderQR or ColPivHouseholderQR instead. |
| 36 | * |
| 37 | * This Householder QR decomposition is faster, but less numerically stable and less feature-full than |
| 38 | * FullPivHouseholderQR or ColPivHouseholderQR. |
| 39 | * |
| 40 | * \sa MatrixBase::householderQr() |
| 41 | */ |
| 42 | template<typename _MatrixType> class HouseholderQRcxx . . $ Eigen/HouseholderQR# |
| 43 | { |
| 44 | public: |
| 45 | |
| 46 | typedef _MatrixType MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType#; |
| 47 | enumcxx . . $ Eigen/HouseholderQR#$anonymous_type_0# { |
| 48 | RowsAtCompileTimecxx . . $ Eigen/HouseholderQR#RowsAtCompileTime. = MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType#::RowsAtCompileTime, |
| 49 | ColsAtCompileTimecxx . . $ Eigen/HouseholderQR#ColsAtCompileTime. = MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType#::ColsAtCompileTime, |
| 50 | Optionscxx . . $ Eigen/HouseholderQR#Options. = MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType#::Options, |
| 51 | MaxRowsAtCompileTimecxx . . $ Eigen/HouseholderQR#MaxRowsAtCompileTime. = MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType#::MaxRowsAtCompileTime, |
| 52 | MaxColsAtCompileTimecxx . . $ Eigen/HouseholderQR#MaxColsAtCompileTime. = MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType#::MaxColsAtCompileTime |
| 53 | }; |
| 54 | typedef typename MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType#::Scalar Scalarcxx . . $ Eigen/HouseholderQR#Scalar#; |
| 55 | typedef typename MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType#::RealScalar RealScalarcxx . . $ Eigen/HouseholderQR#RealScalar#; |
| 56 | typedef typename MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType#::Index Indexcxx . . $ Eigen/HouseholderQR#Index#; |
| 57 | typedef Matrixcxx . . $ Eigen/Matrix#<Scalarcxx . . $ Eigen/HouseholderQR#Scalar#, RowsAtCompileTimecxx . . $ Eigen/HouseholderQR#RowsAtCompileTime., RowsAtCompileTimecxx . . $ Eigen/HouseholderQR#RowsAtCompileTime., (MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType#::Flags&RowMajorBitcxx . . $ Eigen/RowMajorBit.) ? RowMajorcxx . . $ Eigen/RowMajor. : ColMajorcxx . . $ Eigen/ColMajor., MaxRowsAtCompileTimecxx . . $ Eigen/HouseholderQR#MaxRowsAtCompileTime., MaxRowsAtCompileTimecxx . . $ Eigen/HouseholderQR#MaxRowsAtCompileTime.> MatrixQTypecxx . . $ Eigen/HouseholderQR#MatrixQType#; |
| 58 | typedef typename internalcxx . . $ Eigen/internal/::plain_diag_typecxx . . $ Eigen/internal/plain_diag_type#<MatrixType>::type HCoeffsTypecxx . . $ Eigen/HouseholderQR#HCoeffsType#; |
| 59 | typedef typename internalcxx . . $ Eigen/internal/::plain_row_typecxx . . $ Eigen/internal/plain_row_type#<MatrixType>::type RowVectorTypecxx . . $ Eigen/HouseholderQR#RowVectorType#; |
| 60 | typedef HouseholderSequencecxx . . $ Eigen/HouseholderSequence#<MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType#,typename internalcxx . . $ Eigen/internal/::remove_allcxx . . $ Eigen/internal/remove_all#<typename HCoeffsType::ConjugateReturnType>::type> HouseholderSequenceTypecxx . . $ Eigen/HouseholderQR#HouseholderSequenceType#; |
| 61 | |
| 62 | /** |
| 63 | * \brief Default Constructor. |
| 64 | * |
| 65 | * The default constructor is useful in cases in which the user intends to |
| 66 | * perform decompositions via HouseholderQR::compute(const MatrixType&). |
| 67 | */ |
| 68 | HouseholderQRcxx . . $ Eigen/HouseholderQR#`HouseholderQR<MatrixType>`(49f6e7a06ebc5aa8).() : m_qrcxx . . $ Eigen/HouseholderQR#m_qr.(), m_hCoeffscxx . . $ Eigen/HouseholderQR#m_hCoeffs.(), m_tempcxx . . $ Eigen/HouseholderQR#m_temp.(), m_isInitializedcxx . . $ Eigen/HouseholderQR#m_isInitialized.(false) {} |
| 69 | |
| 70 | /** \brief Default Constructor with memory preallocation |
| 71 | * |
| 72 | * Like the default constructor but with preallocation of the internal data |
| 73 | * according to the specified problem \a size. |
| 74 | * \sa HouseholderQR() |
| 75 | */ |
| 76 | HouseholderQRcxx . . $ Eigen/HouseholderQR#`HouseholderQR<MatrixType>`(9addb7853eb318a7).(Indexcxx . . $ Eigen/HouseholderQR#Index# rows, Indexcxx . . $ Eigen/HouseholderQR#Index# cols) |
| 77 | : m_qrcxx . . $ Eigen/HouseholderQR#m_qr.(rows, cols), |
| 78 | m_hCoeffscxx . . $ Eigen/HouseholderQR#m_hCoeffs.((stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).)(rows,cols)), |
| 79 | m_tempcxx . . $ Eigen/HouseholderQR#m_temp.(cols), |
| 80 | m_isInitializedcxx . . $ Eigen/HouseholderQR#m_isInitialized.(false) {} |
| 81 | |
| 82 | /** \brief Constructs a QR factorization from a given matrix |
| 83 | * |
| 84 | * This constructor computes the QR factorization of the matrix \a matrix by calling |
| 85 | * the method compute(). It is a short cut for: |
| 86 | * |
| 87 | * \code |
| 88 | * HouseholderQR<MatrixType> qr(matrix.rows(), matrix.cols()); |
| 89 | * qr.compute(matrix); |
| 90 | * \endcode |
| 91 | * |
| 92 | * \sa compute() |
| 93 | */ |
| 94 | HouseholderQRcxx . . $ Eigen/HouseholderQR#`HouseholderQR<MatrixType>`(77d9f17553126ecb).(const MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType#& matrix) |
| 95 | : m_qrcxx . . $ Eigen/HouseholderQR#m_qr.(matrix.rows(), matrix.cols()), |
| 96 | m_hCoeffscxx . . $ Eigen/HouseholderQR#m_hCoeffs.((stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).)(matrix.rows(),matrix.cols())), |
| 97 | m_tempcxx . . $ Eigen/HouseholderQR#m_temp.(matrix.cols()), |
| 98 | m_isInitializedcxx . . $ Eigen/HouseholderQR#m_isInitialized.(false) |
| 99 | { |
| 100 | computecxx . . $ Eigen/HouseholderQR#compute(9fde7616a40c34c2).(matrix); |
| 101 | } |
| 102 | |
| 103 | /** This method finds a solution x to the equation Ax=b, where A is the matrix of which |
| 104 | * *this is the QR decomposition, if any exists. |
| 105 | * |
| 106 | * \param b the right-hand-side of the equation to solve. |
| 107 | * |
| 108 | * \returns a solution. |
| 109 | * |
| 110 | * \note The case where b is a matrix is not yet implemented. Also, this |
| 111 | * code is space inefficient. |
| 112 | * |
| 113 | * \note_about_checking_solutions |
| 114 | * |
| 115 | * \note_about_arbitrary_choice_of_solution |
| 116 | * |
| 117 | * Example: \include HouseholderQR_solve.cpp |
| 118 | * Output: \verbinclude HouseholderQR_solve.out |
| 119 | */ |
| 120 | template<typename Rhs> |
| 121 | inline const internalcxx . . $ Eigen/internal/::solve_retvalcxx . . $ Eigen/internal/solve_retval#<HouseholderQR, Rhs> |
| 122 | solvecxx . . $ Eigen/HouseholderQR#solve(3b15b0ed52afe40c).(const MatrixBasecxx . . $ Eigen/MatrixBase#<Rhs>& b) const |
| 123 | { |
| 124 | eigen_assertcxx . . $ `lib/fab/vendor/Eigen/src/Core/util/Macros.h:214:9`!(m_isInitialized && "HouseholderQR is not initialized."); |
| 125 | return internalcxx . . $ Eigen/internal/::solve_retvalcxx . . $ Eigen/internal/solve_retval#<HouseholderQR, Rhs>(*this, b.derived()); |
| 126 | } |
| 127 | |
| 128 | /** This method returns an expression of the unitary matrix Q as a sequence of Householder transformations. |
| 129 | * |
| 130 | * The returned expression can directly be used to perform matrix products. It can also be assigned to a dense Matrix object. |
| 131 | * Here is an example showing how to recover the full or thin matrix Q, as well as how to perform matrix products using operator*: |
| 132 | * |
| 133 | * Example: \include HouseholderQR_householderQ.cpp |
| 134 | * Output: \verbinclude HouseholderQR_householderQ.out |
| 135 | */ |
| 136 | HouseholderSequenceTypecxx . . $ Eigen/HouseholderQR#HouseholderSequenceType# householderQcxx . . $ Eigen/HouseholderQR#householderQ(2b3a63f8e9920815).() const |
| 137 | { |
| 138 | eigen_assertcxx . . $ `lib/fab/vendor/Eigen/src/Core/util/Macros.h:214:9`!(m_isInitialized && "HouseholderQR is not initialized."); |
| 139 | return HouseholderSequenceTypecxx . . $ Eigen/HouseholderQR#HouseholderSequenceType#(m_qrcxx . . $ Eigen/HouseholderQR#m_qr., m_hCoeffscxx . . $ Eigen/HouseholderQR#m_hCoeffs..conjugate()); |
| 140 | } |
| 141 | |
| 142 | /** \returns a reference to the matrix where the Householder QR decomposition is stored |
| 143 | * in a LAPACK-compatible way. |
| 144 | */ |
| 145 | const MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType#& matrixQRcxx . . $ Eigen/HouseholderQR#matrixQR(ea465e50d690edfe).() const |
| 146 | { |
| 147 | eigen_assertcxx . . $ `lib/fab/vendor/Eigen/src/Core/util/Macros.h:214:9`!(m_isInitialized && "HouseholderQR is not initialized."); |
| 148 | return m_qrcxx . . $ Eigen/HouseholderQR#m_qr.; |
| 149 | } |
| 150 | |
| 151 | HouseholderQR& computecxx . . $ Eigen/HouseholderQR#compute(9fde7616a40c34c2).(const MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType#& matrix); |
| 152 | |
| 153 | /** \returns the absolute value of the determinant of the matrix of which |
| 154 | * *this is the QR decomposition. It has only linear complexity |
| 155 | * (that is, O(n) where n is the dimension of the square matrix) |
| 156 | * as the QR decomposition has already been computed. |
| 157 | * |
| 158 | * \note This is only for square matrices. |
| 159 | * |
| 160 | * \warning a determinant can be very big or small, so for matrices |
| 161 | * of large enough dimension, there is a risk of overflow/underflow. |
| 162 | * One way to work around that is to use logAbsDeterminant() instead. |
| 163 | * |
| 164 | * \sa logAbsDeterminant(), MatrixBase::determinant() |
| 165 | */ |
| 166 | typename MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType#::RealScalar absDeterminantcxx . . $ Eigen/HouseholderQR#absDeterminant(381599f3fc815456).() const; |
| 167 | |
| 168 | /** \returns the natural log of the absolute value of the determinant of the matrix of which |
| 169 | * *this is the QR decomposition. It has only linear complexity |
| 170 | * (that is, O(n) where n is the dimension of the square matrix) |
| 171 | * as the QR decomposition has already been computed. |
| 172 | * |
| 173 | * \note This is only for square matrices. |
| 174 | * |
| 175 | * \note This method is useful to work around the risk of overflow/underflow that's inherent |
| 176 | * to determinant computation. |
| 177 | * |
| 178 | * \sa absDeterminant(), MatrixBase::determinant() |
| 179 | */ |
| 180 | typename MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType#::RealScalar logAbsDeterminantcxx . . $ Eigen/HouseholderQR#logAbsDeterminant(381599f3fc815456).() const; |
| 181 | |
| 182 | inline Indexcxx . . $ Eigen/HouseholderQR#Index# rowscxx . . $ Eigen/HouseholderQR#rows(2c7b05c1f1314d58).() const { return m_qrcxx . . $ Eigen/HouseholderQR#m_qr..rows(); } |
| 183 | inline Indexcxx . . $ Eigen/HouseholderQR#Index# colscxx . . $ Eigen/HouseholderQR#cols(2c7b05c1f1314d58).() const { return m_qrcxx . . $ Eigen/HouseholderQR#m_qr..cols(); } |
| 184 | |
| 185 | /** \returns a const reference to the vector of Householder coefficients used to represent the factor \c Q. |
| 186 | * |
| 187 | * For advanced uses only. |
| 188 | */ |
| 189 | const HCoeffsTypecxx . . $ Eigen/HouseholderQR#HCoeffsType#& hCoeffscxx . . $ Eigen/HouseholderQR#hCoeffs(611e2a70091626fd).() const { return m_hCoeffscxx . . $ Eigen/HouseholderQR#m_hCoeffs.; } |
| 190 | |
| 191 | protected: |
| 192 | MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType# m_qrcxx . . $ Eigen/HouseholderQR#m_qr.; |
| 193 | HCoeffsTypecxx . . $ Eigen/HouseholderQR#HCoeffsType# m_hCoeffscxx . . $ Eigen/HouseholderQR#m_hCoeffs.; |
| 194 | RowVectorTypecxx . . $ Eigen/HouseholderQR#RowVectorType# m_tempcxx . . $ Eigen/HouseholderQR#m_temp.; |
| 195 | bool m_isInitializedcxx . . $ Eigen/HouseholderQR#m_isInitialized.; |
| 196 | }; |
| 197 | |
| 198 | template<typename MatrixType> |
| 199 | typename MatrixType::RealScalar HouseholderQRcxx . . $ Eigen/HouseholderQR#<MatrixType>::absDeterminantcxx . . $ Eigen/HouseholderQR#absDeterminant(381599f3fc815456).() const |
| 200 | { |
| 201 | using stdcxx . . $ std/::abscxx . . $ Eigen/HouseholderQR#absDeterminant(381599f3fc815456).abs(bb57395c51337e15).; |
| 202 | eigen_assertcxx . . $ `lib/fab/vendor/Eigen/src/Core/util/Macros.h:214:9`!(m_isInitialized && "HouseholderQR is not initialized."); |
| 203 | eigen_assertcxx . . $ `lib/fab/vendor/Eigen/src/Core/util/Macros.h:214:9`!(m_qr.rows() == m_qr.cols() && "You can't take the determinant of a non-square matrix!"); |
| 204 | return abscxx . . $ Eigen/HouseholderQR#absDeterminant(381599f3fc815456).abs(bb57395c51337e15).(m_qrcxx . . $ Eigen/HouseholderQR#m_qr..diagonal().prod()); |
| 205 | } |
| 206 | |
| 207 | template<typename MatrixType> |
| 208 | typename MatrixType::RealScalar HouseholderQRcxx . . $ Eigen/HouseholderQR#<MatrixType>::logAbsDeterminantcxx . . $ Eigen/HouseholderQR#logAbsDeterminant(381599f3fc815456).() const |
| 209 | { |
| 210 | eigen_assertcxx . . $ `lib/fab/vendor/Eigen/src/Core/util/Macros.h:214:9`!(m_isInitialized && "HouseholderQR is not initialized."); |
| 211 | eigen_assertcxx . . $ `lib/fab/vendor/Eigen/src/Core/util/Macros.h:214:9`!(m_qr.rows() == m_qr.cols() && "You can't take the determinant of a non-square matrix!"); |
| 212 | return m_qrcxx . . $ Eigen/HouseholderQR#m_qr..diagonal().cwiseAbs().array().log().sum(); |
| 213 | } |
| 214 | |
| 215 | namespace internalcxx . . $ Eigen/internal/ { |
| 216 | |
| 217 | /** \internal */ |
| 218 | template<typename MatrixQR, typename HCoeffs> |
| 219 | void householder_qr_inplace_unblockedcxx . . $ Eigen/internal/householder_qr_inplace_unblocked(ba2093385d4accb6).(MatrixQR& mat, HCoeffs& hCoeffs, typename MatrixQR::Scalar* tempData = 0) |
| 220 | { |
| 221 | typedef typename MatrixQR::Index Indexcxx . . $ Eigen/internal/householder_qr_inplace_unblocked(ba2093385d4accb6).Index#; |
| 222 | typedef typename MatrixQR::Scalar Scalarcxx . . $ Eigen/internal/householder_qr_inplace_unblocked(ba2093385d4accb6).Scalar#; |
| 223 | typedef typename MatrixQR::RealScalar RealScalarcxx . . $ Eigen/internal/householder_qr_inplace_unblocked(ba2093385d4accb6).RealScalar#; |
| 224 | Indexcxx . . $ Eigen/internal/householder_qr_inplace_unblocked(ba2093385d4accb6).Index# rows = mat.rows(); |
| 225 | Indexcxx . . $ Eigen/internal/householder_qr_inplace_unblocked(ba2093385d4accb6).Index# cols = mat.cols(); |
| 226 | Indexcxx . . $ Eigen/internal/householder_qr_inplace_unblocked(ba2093385d4accb6).Index# size = (stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).)(rows,cols); |
| 227 | |
| 228 | eigen_assertcxx . . $ `lib/fab/vendor/Eigen/src/Core/util/Macros.h:214:9`!(hCoeffs.size() == size); |
| 229 | |
| 230 | typedef Matrixcxx . . $ Eigen/Matrix#<Scalarcxx . . $ Eigen/internal/householder_qr_inplace_unblocked(ba2093385d4accb6).Scalar#,MatrixQR::ColsAtCompileTime,1> TempTypecxx . . $ Eigen/internal/householder_qr_inplace_unblocked(ba2093385d4accb6).TempType#; |
| 231 | TempTypecxx . . $ Eigen/internal/householder_qr_inplace_unblocked(ba2093385d4accb6).TempType# tempVector; |
| 232 | if(tempData==0) |
| 233 | { |
| 234 | tempVector.resizecxx . . $ Eigen/PlainObjectBase#resize(f61ba36a3fd3eb36).(cols); |
| 235 | tempData = tempVector.datacxx . . $ Eigen/PlainObjectBase#data(87a5acce5289920).(); |
| 236 | } |
| 237 | |
| 238 | for(Indexcxx . . $ Eigen/internal/householder_qr_inplace_unblocked(ba2093385d4accb6).Index# k = 0; k < size; ++k) |
| 239 | { |
| 240 | Indexcxx . . $ Eigen/internal/householder_qr_inplace_unblocked(ba2093385d4accb6).Index# remainingRows = rows - k; |
| 241 | Indexcxx . . $ Eigen/internal/householder_qr_inplace_unblocked(ba2093385d4accb6).Index# remainingCols = cols - k - 1; |
| 242 | |
| 243 | RealScalarcxx . . $ Eigen/internal/householder_qr_inplace_unblocked(ba2093385d4accb6).RealScalar# beta; |
| 244 | mat.col(k).tail(remainingRows).makeHouseholderInPlace(hCoeffs.coeffRef(k), beta); |
| 245 | mat.coeffRef(k,k) = beta; |
| 246 | |
| 247 | // apply H to remaining part of m_qr from the left |
| 248 | mat.bottomRightCorner(remainingRows, remainingCols) |
| 249 | .applyHouseholderOnTheLeft(mat.col(k).tail(remainingRows-1), hCoeffs.coeffRef(k), tempData+k+1); |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | /** \internal */ |
| 254 | template<typename MatrixQR, typename HCoeffs> |
| 255 | void householder_qr_inplace_blockedcxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).(MatrixQR& mat, HCoeffs& hCoeffs, |
| 256 | typename MatrixQR::Index maxBlockSize=32, |
| 257 | typename MatrixQR::Scalar* tempData = 0) |
| 258 | { |
| 259 | typedef typename MatrixQR::Index Indexcxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).Index#; |
| 260 | typedef typename MatrixQR::Scalar Scalarcxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).Scalar#; |
| 261 | typedef Blockcxx . . $ Eigen/Block#<MatrixQR,Dynamiccxx . . $ Eigen/Dynamic.,Dynamiccxx . . $ Eigen/Dynamic.> BlockTypecxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).BlockType#; |
| 262 | |
| 263 | Indexcxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).Index# rows = mat.rows(); |
| 264 | Indexcxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).Index# cols = mat.cols(); |
| 265 | Indexcxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).Index# size = (stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).)(rows, cols); |
| 266 | |
| 267 | typedef Matrixcxx . . $ Eigen/Matrix#<Scalarcxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).Scalar#,Dynamiccxx . . $ Eigen/Dynamic.,1,ColMajorcxx . . $ Eigen/ColMajor.,MatrixQR::MaxColsAtCompileTime,1> TempTypecxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).TempType#; |
| 268 | TempTypecxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).TempType# tempVector; |
| 269 | if(tempData==0) |
| 270 | { |
| 271 | tempVector.resizecxx . . $ Eigen/PlainObjectBase#resize(f61ba36a3fd3eb36).(cols); |
| 272 | tempData = tempVector.datacxx . . $ Eigen/PlainObjectBase#data(87a5acce5289920).(); |
| 273 | } |
| 274 | |
| 275 | Indexcxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).Index# blockSize = (stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).)(maxBlockSize,size); |
| 276 | |
| 277 | Indexcxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).Index# k = 0; |
| 278 | for (k = 0; k < size; k += blockSize) |
| 279 | { |
| 280 | Indexcxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).Index# bs = (stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).)(size-k,blockSize); // actual size of the block |
| 281 | Indexcxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).Index# tcols = cols - k - bs; // trailing columns |
| 282 | Indexcxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).Index# brows = rows-k; // rows of the block |
| 283 | |
| 284 | // partition the matrix: |
| 285 | // A00 | A01 | A02 |
| 286 | // mat = A10 | A11 | A12 |
| 287 | // A20 | A21 | A22 |
| 288 | // and performs the qr dec of [A11^T A12^T]^T |
| 289 | // and update [A21^T A22^T]^T using level 3 operations. |
| 290 | // Finally, the algorithm continue on A22 |
| 291 | |
| 292 | BlockTypecxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).BlockType# A11_21 = mat.block(k,k,brows,bs); |
| 293 | Blockcxx . . $ Eigen/Block#<HCoeffs,Dynamiccxx . . $ Eigen/Dynamic.,1> hCoeffsSegment = hCoeffs.segment(k,bs); |
| 294 | |
| 295 | householder_qr_inplace_unblockedcxx . . $ Eigen/internal/householder_qr_inplace_unblocked(ba2093385d4accb6).(A11_21, hCoeffsSegment, tempData); |
| 296 | |
| 297 | if(tcols) |
| 298 | { |
| 299 | BlockTypecxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).BlockType# A21_22 = mat.block(k,k+bs,brows,tcols); |
| 300 | apply_block_householder_on_the_leftcxx . . $ Eigen/internal/apply_block_householder_on_the_left(24c06d9c65e079c1).(A21_22,A11_21,hCoeffsSegment.adjoint()); |
| 301 | } |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | template<typename _MatrixType, typename Rhs> |
| 306 | struct solve_retvalcxx . . $ Eigen/internal/solve_retval#<HouseholderQRcxx . . $ Eigen/HouseholderQR#<_MatrixType>, Rhs> |
| 307 | : solve_retval_basecxx . . $ Eigen/internal/solve_retval_base#<HouseholderQRcxx . . $ Eigen/HouseholderQR#<_MatrixType>, Rhs> |
| 308 | { |
| 309 | EIGEN_MAKE_SOLVE_HELPERScxx . . $ `lib/fab/vendor/Eigen/src/misc/Solve.h:61:9`!(HouseholderQR<_MatrixType>,Rhs) |
| 310 | |
| 311 | template<typename Dest> void evalTocxx . . $ Eigen/internal/solve_retval#evalTo(b7b72e2ad5578bfe).(Dest& dst) const |
| 312 | { |
| 313 | const Indexcxx . . $ Eigen/internal/solve_retval#Index# rows = dec().rows(), cols = dec().cols(); |
| 314 | const Indexcxx . . $ Eigen/internal/solve_retval#Index# rank = (stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).)(rows, cols); |
| 315 | eigen_assertcxx . . $ `lib/fab/vendor/Eigen/src/Core/util/Macros.h:214:9`!(rhs().rows() == rows); |
| 316 | |
| 317 | typename Rhs::PlainObject c(rhs()); |
| 318 | |
| 319 | // Note that the matrix Q = H_0^* H_1^*... so its inverse is Q^* = (H_0 H_1 ...)^T |
| 320 | c.applyOnTheLeft(householderSequencecxx . . $ Eigen/householderSequence(2cd81b1b0956416e).( |
| 321 | dec().matrixQR().leftCols(rank), |
| 322 | dec().hCoeffs().head(rank)).transpose() |
| 323 | ); |
| 324 | |
| 325 | dec().matrixQR() |
| 326 | .topLeftCorner(rank, rank) |
| 327 | .template triangularView<Uppercxx . . $ Eigen/Upper.>() |
| 328 | .solveInPlace(c.topRows(rank)); |
| 329 | |
| 330 | dst.topRows(rank) = c.topRows(rank); |
| 331 | dst.bottomRows(cols-rank).setZero(); |
| 332 | } |
| 333 | }; |
| 334 | |
| 335 | } // end namespace internal |
| 336 | |
| 337 | /** Performs the QR factorization of the given matrix \a matrix. The result of |
| 338 | * the factorization is stored into \c *this, and a reference to \c *this |
| 339 | * is returned. |
| 340 | * |
| 341 | * \sa class HouseholderQR, HouseholderQR(const MatrixType&) |
| 342 | */ |
| 343 | template<typename MatrixType> |
| 344 | HouseholderQRcxx . . $ Eigen/HouseholderQR#<MatrixType>& HouseholderQRcxx . . $ Eigen/HouseholderQR#<MatrixType>::computecxx . . $ Eigen/HouseholderQR#compute(9fde7616a40c34c2).(const MatrixTypecxx . . $ Eigen/HouseholderQR#MatrixType#& matrix) |
| 345 | { |
| 346 | Indexcxx . . $ Eigen/HouseholderQR#Index# rows = matrix.rows(); |
| 347 | Indexcxx . . $ Eigen/HouseholderQR#Index# cols = matrix.cols(); |
| 348 | Indexcxx . . $ Eigen/HouseholderQR#Index# size = (stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).)(rows,cols); |
| 349 | |
| 350 | m_qrcxx . . $ Eigen/HouseholderQR#m_qr. = matrix; |
| 351 | m_hCoeffscxx . . $ Eigen/HouseholderQR#m_hCoeffs..resize(size); |
| 352 | |
| 353 | m_tempcxx . . $ Eigen/HouseholderQR#m_temp..resize(cols); |
| 354 | |
| 355 | internalcxx . . $ Eigen/internal/::householder_qr_inplace_blockedcxx . . $ Eigen/internal/householder_qr_inplace_blocked(ad6e3bb89fcd32bb).(m_qrcxx . . $ Eigen/HouseholderQR#m_qr., m_hCoeffscxx . . $ Eigen/HouseholderQR#m_hCoeffs., 48, m_tempcxx . . $ Eigen/HouseholderQR#m_temp..data()); |
| 356 | |
| 357 | m_isInitializedcxx . . $ Eigen/HouseholderQR#m_isInitialized. = true; |
| 358 | return *this; |
| 359 | } |
| 360 | |
| 361 | /** \return the Householder QR decomposition of \c *this. |
| 362 | * |
| 363 | * \sa class HouseholderQR |
| 364 | */ |
| 365 | template<typename Derived> |
| 366 | const HouseholderQRcxx . . $ Eigen/HouseholderQR#<typename MatrixBasecxx . . $ Eigen/MatrixBase#<Derived>::PlainObjectcxx . . $ Eigen/MatrixBase#PlainObject#> |
| 367 | MatrixBasecxx . . $ Eigen/MatrixBase#<Derived>::householderQrcxx . . $ Eigen/MatrixBase#householderQr(8d0393b702c627b6).() const |
| 368 | { |
| 369 | return HouseholderQRcxx . . $ Eigen/HouseholderQR#<PlainObjectcxx . . $ Eigen/MatrixBase#PlainObject#>(evalcxx . . $ Eigen/DenseBase#eval(9f3b338ec4d83bf0).()); |
| 370 | } |
| 371 | |
| 372 | } // end namespace Eigen |
| 373 | |
| 374 | #endif // EIGEN_QR_H |