Automatic Differentiation
 
Loading...
Searching...
No Matches
check_square.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_ERR_CHECK_SQUARE_HPP
2#define STAN_MATH_PRIM_ERR_CHECK_SQUARE_HPP
3
7#include <sstream>
8
9namespace stan {
10namespace math {
11
20template <typename T_y,
21 require_any_t<is_matrix<T_y>,
22 is_prim_or_rev_kernel_expression<T_y>>* = nullptr>
23inline void check_square(const char* function, const char* name, const T_y& y) {
24 check_size_match(function, "Expecting a square matrix; rows of ", name,
25 y.rows(), "columns of ", name, y.cols());
26}
27
28} // namespace math
29} // namespace stan
30#endif
void check_square(const char *function, const char *name, const T_y &y)
Check if the specified matrix is square.
void check_size_match(const char *function, const char *name_i, T_size1 i, const char *name_j, T_size2 j)
Check if the provided sizes match.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...