1 #ifndef STAN_MATH_FWD_MAT_FUN_QR_R_HPP 2 #define STAN_MATH_FWD_MAT_FUN_QR_R_HPP 13 Eigen::Matrix<fvar<T>, Eigen::Dynamic, Eigen::Dynamic>
qr_R(
14 const Eigen::Matrix<
fvar<T>, Eigen::Dynamic, Eigen::Dynamic>& m) {
15 typedef Eigen::Matrix<fvar<T>, Eigen::Dynamic, Eigen::Dynamic> matrix_fwd_t;
18 Eigen::HouseholderQR<matrix_fwd_t> qr(m.rows(), m.cols());
20 matrix_fwd_t R = qr.matrixQR().topLeftCorner(m.rows(), m.cols());
21 for (
int i = 0; i < R.rows(); i++) {
22 for (
int j = 0; j < i; j++)
24 if (i < R.cols() && R(i, i) < 0.0)
void check_nonzero_size(const char *function, const char *name, const T_y &y)
Check if the specified matrix/vector is of non-zero size.
Eigen::Matrix< fvar< T >, Eigen::Dynamic, Eigen::Dynamic > qr_R(const Eigen::Matrix< fvar< T >, Eigen::Dynamic, Eigen::Dynamic > &m)
void check_greater_or_equal(const char *function, const char *name, const T_y &y, const T_low &low)
Check if y is greater or equal than low.
This template class represents scalars used in forward-mode automatic differentiation, which consist of values and directional derivatives of the specified template type.