All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
check_cholesky_factor_corr.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_PRIM_MAT_ERR_CHECK_CHOLESKY_FACTOR_CORR_HPP
#define STAN_MATH_PRIM_MAT_ERR_CHECK_CHOLESKY_FACTOR_CORR_HPP
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/scal/err/check_positive.hpp>
#include <stan/math/prim/mat/err/check_lower_triangular.hpp>
#include <stan/math/prim/mat/err/check_square.hpp>
#include <stan/math/prim/mat/err/constraint_tolerance.hpp>
#include <stan/math/prim/mat/err/check_unit_vector.hpp>
namespace stan {
namespace math {
using Eigen::Dynamic;
template <typename T_y>
bool
check_cholesky_factor_corr(const char* function,
const char* name,
const Eigen::Matrix<T_y, Dynamic, Dynamic>& y) {
check_square(function, name, y);
check_lower_triangular(function, name, y);
for (int i = 0; i < y.rows(); ++i)
check_positive(function, name, y(i, i));
for (int i = 0; i < y.rows(); ++i) {
Eigen::Matrix<T_y, Dynamic, 1>
y_i = y.row(i).transpose();
check_unit_vector(function, name, y_i);
}
return true;
}
}
}
#endif
check_positive.hpp
constraint_tolerance.hpp
check_lower_triangular.hpp
stan::math::check_unit_vector
bool check_unit_vector(const char *function, const char *name, const Eigen::Matrix< T_prob, Dynamic, 1 > &theta)
Return true if the specified vector is unit vector.
Definition: check_unit_vector.hpp:38
check_unit_vector.hpp
stan::math::check_cholesky_factor_corr
bool check_cholesky_factor_corr(const char *function, const char *name, const Eigen::Matrix< T_y, Dynamic, Dynamic > &y)
Return true if the specified matrix is a valid Cholesky factor of a correlation matrix.
Definition: check_cholesky_factor_corr.hpp:40
stan::math::check_positive
bool check_positive(const char *function, const char *name, const T_y &y)
Return true if y is positive.
Definition: check_positive.hpp:68
Eigen.hpp
stan::math::check_lower_triangular
bool check_lower_triangular(const char *function, const char *name, const Eigen::Matrix< T_y, Dynamic, Dynamic > &y)
Return true if the specified matrix is lower triangular.
Definition: check_lower_triangular.hpp:35
stan::math::check_square
bool check_square(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Return true if the specified matrix is square.
Definition: check_square.hpp:28
check_square.hpp

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