check_multiplicable.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_PRIM_MAT_ERR_CHECK_MULTIPLICABLE_HPP
#define STAN_MATH_PRIM_MAT_ERR_CHECK_MULTIPLICABLE_HPP
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/scal/err/check_size_match.hpp>
#include <stan/math/prim/scal/err/check_positive_size.hpp>
namespace stan {
namespace math {
template <typename T1, typename T2>
inline void check_multiplicable(const char* function,
const char* name1,
const T1& y1,
const char* name2,
const T2& y2) {
check_positive_size(function, name1, "rows()", y1.rows());
check_positive_size(function, name2, "cols()", y2.cols());
check_size_match(function,
"Columns of ", name1, y1.cols(),
"Rows of ", name2, y2.rows());
check_positive_size(function, name1, "cols()", y1.cols());
}
}
}
#endif
check_size_match.hpp
stan
Definition: log_sum_exp.hpp:8
stan::math::check_positive_size
void check_positive_size(const char *function, const char *name, const char *expr, int size)
Check if size is positive.
Definition: check_positive_size.hpp:22
stan::math::check_size_match
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.
Definition: check_size_match.hpp:29
Eigen.hpp
stan::math::check_multiplicable
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.
Definition: check_multiplicable.hpp:31
check_positive_size.hpp

[ Stan Home Page ] © 2011–2016, Stan Development Team.