Automatic Differentiation
 
Loading...
Searching...
No Matches
mdivide_left_tri_low.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_MDIVIDE_LEFT_TRI_LOW_HPP
2#define STAN_MATH_PRIM_FUN_MDIVIDE_LEFT_TRI_LOW_HPP
3
7
8namespace stan {
9namespace math {
10
29template <typename T1, typename T2, require_all_eigen_t<T1, T2>* = nullptr,
30 require_all_not_eigen_vt<is_fvar, T1, T2>* = nullptr>
31inline Eigen::Matrix<return_type_t<T1, T2>, T1::RowsAtCompileTime,
32 T2::ColsAtCompileTime>
33mdivide_left_tri_low(const T1& A, const T2& b) {
34 check_square("mdivide_left_tri_low", "A", A);
35 check_multiplicable("mdivide_left_tri_low", "A", A, "b", b);
36 if (A.rows() == 0) {
37 return {0, b.cols()};
38 }
39
40 return mdivide_left_tri<Eigen::Lower>(A, b);
41}
42
43template <typename T, require_eigen_t<T>* = nullptr,
44 require_not_eigen_vt<is_fvar, T>* = nullptr>
46 check_square("mdivide_left_tri_low", "A", A);
47 if (A.rows() == 0) {
48 return {};
49 }
50
51 return mdivide_left_tri<Eigen::Lower>(A);
52}
53
54} // namespace math
55} // namespace stan
56
57#endif
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.
Eigen::Matrix< value_type_t< T1 >, T1::RowsAtCompileTime, T2::ColsAtCompileTime > mdivide_left_tri_low(const T1 &A, const T2 &b)
typename plain_type< T >::type plain_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...