1#ifndef STAN_MATH_PRIM_FUN_MDIVIDE_RIGHT_TRI_HPP
2#define STAN_MATH_PRIM_FUN_MDIVIDE_RIGHT_TRI_HPP
27template <Eigen::UpLoType TriView,
typename EigMat1,
typename EigMat2,
28 require_all_eigen_t<EigMat1, EigMat2>* =
nullptr>
32 if (TriView != Eigen::Lower && TriView != Eigen::Upper) {
34 "triangular view must be Eigen::Lower or Eigen::Upper",
38 using ret_type = Eigen::Matrix<T_return, Eigen::Dynamic, Eigen::Dynamic>;
40 return ret_type(b.rows(), 0);
44 .template triangularView<TriView>()
auto transpose(Arg &&a)
Transposes a kernel generator expression.
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
void check_square(const char *function, const char *name, const T_y &y)
Check if the specified matrix is square.
void check_multiplicable(const char *function, const char *name1, const T1 &y1, const char *name2, const T2 &y2)
Check if the matrices can be multiplied.
auto mdivide_right_tri(const EigMat1 &b, const EigMat2 &A)
Returns the solution of the system xA=b when A is triangular.
void throw_domain_error(const char *function, const char *name, const T &y, const char *msg1, const char *msg2)
Throw a domain error with a consistently formatted message.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...