24 typedef typename Real_::DoubleType Double_;
28 typedef BackSub<Real> BackSub;
48 sdt m = a.rows(), n = a.cols();
53 householder(_h, _q, _r);
61 template<
class B,
class X>
64 sdt m = _q.rows(), n = _r.rows();
65 bool full = m == _q.cols();
66 if (full) _q.
block(0,0,m,n).transposeMul(b, _y);
72 const Matrix&
q()
const {
return _q; }
74 const Matrix&
r()
const {
return _r; }
76 const Matrix&
h()
const {
return _h; }
80 static void householder(Matrix& a, Matrix&
q, Matrix&
r);
88 extern template class Qrd<Float>;
89 extern template class Qrd<Double>;
90 extern template class Qrd<Quad>;
static bool isFullRank(const MatrixBase< T > &a)
Check if a triangular/trapezoidal matrix has full rank (ie. all vectors are linearly independent; no ...
Definition: BackSub.h:25
Algebra.
Definition: Alge.h:13
matrix::Block< MatrixS, Rows, Cols > block(sdt row, sdt col, sdt rows=-1, sdt cols=-1)
Get block at offset (row,col) with size (Rows, Cols). If Rows or Cols is fixed then rows or cols may ...
Definition: Base.h:252
ptrdiff_t sdt
Size difference type, shorthand for ptrdiff_t.
Definition: Core.h:92
bool isFullRank() const
Check if the decomposed matrix has full rank (ie. all vectors are linearly independent; no vector is ...
Definition: Qrd.h:58
Res && transposeMul(const T &rhs, Res &&res) const
Stores result in and returns res.
Definition: Base.h:341
Matrix< matrix::dynamic, matrix::dynamic, Real > Matrix
Definition: Qrd.h:31
const Matrix & q() const
Get Q of the decomposition.
Definition: Qrd.h:72
const Matrix & h() const
Get the Householder column vectors that define the reflections. H is a (m x n) lower trapazoidal matr...
Definition: Qrd.h:76
QR Decomposition. Can be used to solve least squares problems.
Definition: Qrd.h:21
Qrd()
Definition: Qrd.h:39
const Matrix & r() const
Get R of the decomposition.
Definition: Qrd.h:74
#define assert(...)
Forwards to assert_#args. See assert_1(), assert_2().
Definition: Debug.h:24
void solve(const MatrixBase< B > &b, MatrixBase< X > &x)
Solve the linear system where A is the decomposed matrix. A and B row sizes must match...
Definition: Qrd.h:62
Numeric type information, use numeral() to get instance safely from a static context.
Definition: Numeral.h:17
MatrixS & resize(sdt rows, sdt cols)
Sets number of rows/columns and reallocates only if the size has changed (rows*cols). All previous data is lost on reallocation. Returns self.
Definition: Base.h:277
static void solve(const Matrix &r, const MatrixBase< B > &b, MatrixBase< X > &x)
Solve where R is an upper triangular/trapezoidal matrix. R and B row sizes must match. R must have full rank.
Definition: BackSub.h:35
double Real
Definition: Real.h:14
Qrd & calc(const MatrixBase< T > &a, Mode mode=Mode::reduced)
Calculate the QRD of matrix A.
Definition: Qrd.h:46
Matrix base class.
Definition: Base.h:17
Global Honeycomb namespace.
Qrd(const MatrixBase< T > &a, Mode mode=Mode::reduced)
Calculate the QRD of matrix A.
Definition: Qrd.h:42