mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-05 02:04:07 +08:00
bug #694: document that SparseQR::matrixR is not sorted.
This commit is contained in:
parent
ec469700dc
commit
ff1157bcbf
@ -128,6 +128,17 @@ class SparseQR : public SparseSolverBase<SparseQR<_MatrixType,_OrderingType> >
|
||||
inline Index cols() const { return m_pmat.cols();}
|
||||
|
||||
/** \returns a const reference to the \b sparse upper triangular matrix R of the QR factorization.
|
||||
* \warning The entries of the returned matrix are not sorted. This means that using it in algorithms
|
||||
* expecting sorted entries will fail. This include random coefficient accesses (SpaseMatrix::coeff()),
|
||||
* and coefficient-wise operations. Matrix products and triangular solves are fine though.
|
||||
*
|
||||
* To sort the entries, you can assign it to a row-major matrix, and if a column-major matrix
|
||||
* is required, you can copy it again:
|
||||
* \code
|
||||
* SparseMatrix<double> R = qr.matrixR(); // column-major, not sorted!
|
||||
* SparseMatrix<double,RowMajor> Rr = qr.matrixR(); // row-major, sorted
|
||||
* SparseMatrix<double> Rc = Rr; // column-major, sorted
|
||||
* \endcode
|
||||
*/
|
||||
const QRMatrixType& matrixR() const { return m_R; }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user