All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
crossprod.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_FWD_MAT_FUN_CROSSPROD_HPP
#define STAN_MATH_FWD_MAT_FUN_CROSSPROD_HPP
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/mat/fun/typedefs.hpp>
#include <stan/math/fwd/mat/fun/typedefs.hpp>
#include <stan/math/fwd/mat/fun/multiply.hpp>
#include <stan/math/prim/mat/fun/transpose.hpp>
#include <vector>
namespace stan {
namespace math {
template<typename T, int R, int C>
inline
Eigen::Matrix<fvar<T>, C, C>
crossprod(const Eigen::Matrix<fvar<T>, R, C>& m) {
if (m.rows() == 0)
return Eigen::Matrix<fvar<T>, C, C>(0, 0);
return stan::math::multiply(stan::math::transpose(m), m);
}
}
}
#endif
typedefs.hpp
stan::math::multiply
Eigen::Matrix< fvar< T >, R1, C1 > multiply(const Eigen::Matrix< fvar< T >, R1, C1 > &m, const fvar< T > &c)
Definition: multiply.hpp:20
multiply.hpp
transpose.hpp
stan::math::crossprod
Eigen::Matrix< fvar< T >, C, C > crossprod(const Eigen::Matrix< fvar< T >, R, C > &m)
Definition: crossprod.hpp:17
Eigen.hpp
stan::math::transpose
Eigen::Matrix< T, C, R > transpose(const Eigen::Matrix< T, R, C > &m)
Definition: transpose.hpp:12
stan::math::fvar
Definition: fvar.hpp:13
typedefs.hpp

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