Automatic Differentiation
 
Loading...
Searching...
No Matches
matrix_exp_multiply.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_MATRIX_EXP_MULTIPLY_HPP
2#define STAN_MATH_PRIM_FUN_MATRIX_EXP_MULTIPLY_HPP
3
7
8namespace stan {
9namespace math {
10
20template <typename EigMat1, typename EigMat2,
21 require_all_eigen_t<EigMat1, EigMat2>* = nullptr,
22 require_all_st_same<double, EigMat1, EigMat2>* = nullptr>
23inline Eigen::Matrix<double, Eigen::Dynamic, EigMat2::ColsAtCompileTime>
24matrix_exp_multiply(const EigMat1& A, const EigMat2& B) {
25 check_square("matrix_exp_multiply", "input matrix", A);
26 check_multiplicable("matrix_exp_multiply", "A", A, "B", B);
27 if (A.size() == 0) {
28 return {0, B.cols()};
29 }
30
31 return matrix_exp_action_handler().action(A, B);
32}
33
34} // namespace math
35} // namespace stan
36
37#endif
Eigen::MatrixXd action(const EigMat1 &mat, const EigMat2 &b, const double &t=1.0)
Perform the matrix exponential action exp(A*t)*B.
The implementation of the work by Awad H.
void check_square(const char *function, const char *name, const T_y &y)
Check if the specified matrix is square.
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.
Eigen::Matrix< double, Eigen::Dynamic, EigMat2::ColsAtCompileTime > matrix_exp_multiply(const EigMat1 &A, const EigMat2 &B)
Return product of exp(A) and B, where A is a NxN double matrix, B is a NxCb double matrix,...
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...