All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
check_matching_dims.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_PRIM_MAT_ERR_CHECK_MATCHING_DIMS_HPP
#define STAN_MATH_PRIM_MAT_ERR_CHECK_MATCHING_DIMS_HPP
#include <stan/math/prim/scal/err/domain_error.hpp>
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/scal/err/check_size_match.hpp>
#include <sstream>
namespace stan {
namespace math {
template <typename T1, typename T2, int R1, int C1, int R2, int C2>
inline bool check_matching_dims(const char* function,
const char* name1,
const Eigen::Matrix<T1, R1, C1>& y1,
const char* name2,
const Eigen::Matrix<T2, R2, C2>& y2) {
check_size_match(function,
"Rows of ", name1, y1.rows(),
"rows of ", name2, y2.rows());
check_size_match(function,
"Columns of ", name1, y1.cols(),
"columns of ", name2, y2.cols());
return true;
}
}
}
#endif
check_size_match.hpp
stan::math::check_matching_dims
bool check_matching_dims(const char *function, const char *name1, const Eigen::Matrix< T1, R1, C1 > &y1, const char *name2, const Eigen::Matrix< T2, R2, C2 > &y2)
Return true if the two matrices are of the same size.
Definition: check_matching_dims.hpp:37
stan::math::check_size_match
bool check_size_match(const char *function, const char *name_i, T_size1 i, const char *name_j, T_size2 j)
Return true if the provided sizes match.
Definition: check_size_match.hpp:30
Eigen.hpp
domain_error.hpp

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