Automatic Differentiation
 
Loading...
Searching...
No Matches
is_lower_triangular.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_ERR_IS_LOWER_TRIANGULAR_HPP
2#define STAN_MATH_PRIM_ERR_IS_LOWER_TRIANGULAR_HPP
3
7
8namespace stan {
9namespace math {
10
20template <typename EigMat, require_eigen_matrix_dynamic_t<EigMat>* = nullptr>
21inline bool is_lower_triangular(const EigMat& y) {
22 return y.unaryExpr([](auto&& x) { return is_not_nan(x) ? x : 1.0; })
23 .transpose()
24 .isUpperTriangular();
25}
26
27} // namespace math
28} // namespace stan
29#endif
auto transpose(Arg &&a)
Transposes a kernel generator expression.
bool is_lower_triangular(const EigMat &y)
Return true is matrix is lower triangular.
bool is_not_nan(const T_y &y)
Return true if y is not NaN.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...