| Stan Math Library 2.12.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

trace_gen_inv_quad_form_ldlt.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_REV_MAT_FUN_TRACE_GEN_INV_QUAD_FORM_LDLT_HPP
2 #define STAN_MATH_REV_MAT_FUN_TRACE_GEN_INV_QUAD_FORM_LDLT_HPP
3
4 #include <stan/math/prim/mat/fun/Eigen.hpp>
5 #include <stan/math/rev/core.hpp>
6 #include <stan/math/prim/scal/meta/is_var.hpp>
7 #include <stan/math/rev/scal/meta/is_var.hpp>
8 #include <boost/utility/enable_if.hpp>
9 #include <stan/math/prim/mat/err/check_multiplicable.hpp>
10 #include <stan/math/prim/mat/err/check_square.hpp>
11 #include <stan/math/rev/mat/fun/trace_inv_quad_form_ldlt.hpp>
12
13 namespace stan {
14 namespace math {
15
21 template <typename T1, int R1, int C1, typename T2, int R2, int C2,
22 typename T3, int R3, int C3>
23 inline typename
24 boost::enable_if_c<stan::is_var<T1>::value ||
25 stan::is_var<T2>::value ||
26 stan::is_var<T3>::value, var>::type
27 trace_gen_inv_quad_form_ldlt(const Eigen::Matrix<T1, R1, C1> &D,
28 const LDLT_factor<T2, R2, C2> &A,
29 const Eigen::Matrix<T3, R3, C3> &B) {
30 check_square("trace_gen_inv_quad_form_ldlt", "D", D);
31 check_multiplicable("trace_gen_inv_quad_form_ldlt",
32 "A", A,
33 "B", B);
34 check_multiplicable("trace_gen_inv_quad_form_ldlt",
35 "B", B,
36 "D", D);
37
38 trace_inv_quad_form_ldlt_impl<T2, R2, C2, T3, R3, C3> *_impl
39 = new trace_inv_quad_form_ldlt_impl<T2, R2, C2, T3, R3, C3>(D, A, B);
40
41 return var(new trace_inv_quad_form_ldlt_vari<T2, R2, C2, T3, R3, C3>
42 (_impl));
43 }
44
45 }
46 }
47 #endif
core.hpp
check_multiplicable.hpp
stan
Definition: log_sum_exp.hpp:8
stan::is_var
Definition: is_var.hpp:7
stan::math::var
Independent (input) and dependent (output) variables for gradients.
Definition: var.hpp:30
is_var.hpp
stan::math::LDLT_factor
Definition: LDLT_factor.hpp:13
stan::math::check_multiplicable
bool check_multiplicable(const char *function, const char *name1, const T1 &y1, const char *name2, const T2 &y2)
Return true if the matrices can be multiplied.
Definition: check_multiplicable.hpp:32
Eigen.hpp
trace_inv_quad_form_ldlt.hpp
is_var.hpp
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
stan::math::trace_gen_inv_quad_form_ldlt
boost::enable_if_c<!stan::is_var< T1 >::value &&!stan::is_var< T2 >::value &&!stan::is_var< T3 >::value, typename boost::math::tools::promote_args< T1, T2, T3 >::type >::type trace_gen_inv_quad_form_ldlt(const Eigen::Matrix< T1, R1, C1 > &D, const LDLT_factor< T2, R2, C2 > &A, const Eigen::Matrix< T3, R3, C3 > &B)
Definition: trace_gen_inv_quad_form_ldlt.hpp:30
check_square.hpp

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