mdivide_right_spd.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_PRIM_MAT_FUN_MDIVIDE_RIGHT_SPD_HPP
#define STAN_MATH_PRIM_MAT_FUN_MDIVIDE_RIGHT_SPD_HPP
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/mat/fun/mdivide_left_spd.hpp>
#include <stan/math/prim/mat/fun/transpose.hpp>
#include <stan/math/prim/mat/err/check_multiplicable.hpp>
#include <stan/math/prim/mat/err/check_pos_definite.hpp>
#include <stan/math/prim/mat/err/check_symmetric.hpp>
#include <stan/math/prim/mat/err/check_square.hpp>
#include <boost/math/tools/promotion.hpp>
namespace stan {
namespace math {
template <typename T1, typename T2, int R1, int C1, int R2, int C2>
inline
Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type,
R1, C2>
mdivide_right_spd(const Eigen::Matrix<T1, R1, C1> &b,
const Eigen::Matrix<T2, R2, C2> &A) {
check_square("mdivide_right_spd", "A", A);
check_multiplicable("mdivide_right_spd", "b", b, "A", A);
check_symmetric("mdivide_right_spd", "A", A);
check_pos_definite("mdivide_right_spd", "A", A);
// FIXME: After allowing for general MatrixBase in mdivide_left_spd,
// change to b.transpose()
return mdivide_left_spd(A, transpose(b)).transpose();
}
}
}
#endif
check_multiplicable.hpp
mdivide_left_spd.hpp
stan
Definition: log_sum_exp.hpp:8
check_symmetric.hpp
stan::math::mdivide_left_spd
Eigen::Matrix< typename boost::math::tools::promote_args< T1, T2 >::type, R1, C2 > mdivide_left_spd(const Eigen::Matrix< T1, R1, C1 > &A, const Eigen::Matrix< T2, R2, C2 > &b)
Returns the solution of the system Ax=b where A is symmetric positive definite.
Definition: mdivide_left_spd.hpp:28
transpose.hpp
stan::math::check_symmetric
void check_symmetric(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Check if the specified matrix is symmetric.
Definition: check_symmetric.hpp:35
stan::math::mdivide_right_spd
Eigen::Matrix< typename boost::math::tools::promote_args< T1, T2 >::type, R1, C2 > mdivide_right_spd(const Eigen::Matrix< T1, R1, C1 > &b, const Eigen::Matrix< T2, R2, C2 > &A)
Returns the solution of the system Ax=b where A is symmetric positive definite.
Definition: mdivide_right_spd.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
stan::math::check_square
void check_square(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Check if the specified matrix is square.
Definition: check_square.hpp:27
stan::math::transpose
Eigen::Matrix< T, C, R > transpose(const Eigen::Matrix< T, R, C > &m)
Definition: transpose.hpp:12
stan::math::check_pos_definite
void check_pos_definite(const char *function, const char *name, const Eigen::Matrix< T_y, -1, -1 > &y)
Check if the specified square, symmetric matrix is positive definite.
Definition: check_pos_definite.hpp:33
check_pos_definite.hpp
check_square.hpp

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