Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
multiply_lower_tri_self_transpose.hpp
Go to the documentation of this file.
1 #ifndef STAN__MATH__MATRIX__MULTIPLY_LOWER_TRI_SELF_HPP
2 #define STAN__MATH__MATRIX__MULTIPLY_LOWER_TRI_SELF_HPP
3 
5 
6 namespace stan {
7  namespace math {
8 
17  inline matrix_d
19  if (L.rows() == 0)
20  return matrix_d(0,0);
21  if (L.rows() == 1) {
22  matrix_d result(1,1);
23  result(0,0) = L(0,0) * L(0,0);
24  return result;
25  }
26  // FIXME: write custom following agrad/matrix because can't get L_tri into
27  // multiplication as no template support for tri * tri
28  matrix_d L_tri = L.transpose().triangularView<Eigen::Upper>();
29  return L.triangularView<Eigen::Lower>() * L_tri;
30  }
31 
32  }
33 }
34 #endif
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > matrix_d
Type for matrix of double values.
Definition: typedefs.hpp:23
matrix_d multiply_lower_tri_self_transpose(const matrix_d &L)
Returns the result of multiplying the lower triangular portion of the input matrix by its own transpo...

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