1 #ifndef STAN_MATH_REV_MAT_FUN_TCROSSPROD_HPP
2 #define STAN_MATH_REV_MAT_FUN_TCROSSPROD_HPP
12 #include <boost/math/tools/promotion.hpp>
39 .
alloc((M.rows() * M.cols())
42 for (
int m = 0; m < M.rows(); ++m)
43 for (
int n = 0; n < M.cols(); ++n)
44 vs[pos++] = M(m, n).vi_;
45 for (
int m = 0; m < M.rows(); ++m)
46 MMt(m, m) =
var(
new dot_self_vari(vs + m * M.cols(), M.cols()));
47 for (
int m = 0; m < M.rows(); ++m) {
48 for (
int n = 0; n < m; ++n) {
49 MMt(m, n) =
var(
new dot_product_vari<var, var>(vs + m * M.cols(),
52 MMt(n, m) = MMt(m, n);
static stack_alloc memalloc_
The variable implementation base class.
Eigen::Matrix< fvar< T >, R, R > tcrossprod(const Eigen::Matrix< fvar< T >, R, C > &m)
Independent (input) and dependent (output) variables for gradients.
Eigen::Matrix< var, Eigen::Dynamic, Eigen::Dynamic > matrix_v
The type of a matrix holding var values.
void * alloc(size_t len)
Return a newly allocated block of memory of the appropriate size managed by the stack allocator...