columns_dot_self.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_FWD_MAT_FUN_COLUMNS_DOT_SELF_HPP
#define STAN_MATH_FWD_MAT_FUN_COLUMNS_DOT_SELF_HPP
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/mat/fun/typedefs.hpp>
#include <stan/math/fwd/core.hpp>
#include <stan/math/fwd/mat/fun/dot_self.hpp>
#include <vector>
namespace stan {
namespace math {
template<typename T, int R, int C>
inline Eigen::Matrix<fvar<T>, 1, C>
columns_dot_self(const Eigen::Matrix<fvar<T>, R, C>& x) {
Eigen::Matrix<fvar<T>, 1, C> ret(1, x.cols());
for (size_type i = 0; i < x.cols(); i++) {
Eigen::Matrix<fvar<T>, R, 1> ccol = x.col(i);
ret(0, i) = dot_self(ccol);
}
return ret;
}
}
}
#endif
core.hpp
stan
Definition: log_sum_exp.hpp:8
stan::math::dot_self
fvar< T > dot_self(const Eigen::Matrix< fvar< T >, R, C > &v)
Definition: dot_self.hpp:16
stan::math::size_type
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index size_type
Type for sizes and indexes in an Eigen matrix with double e.
Definition: typedefs.hpp:13
dot_self.hpp
Eigen.hpp
stan::math::columns_dot_self
Eigen::Matrix< fvar< T >, 1, C > columns_dot_self(const Eigen::Matrix< fvar< T >, R, C > &x)
Definition: columns_dot_self.hpp:15
stan::math::fvar
Definition: fvar.hpp:14
typedefs.hpp

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