All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
scalar_type.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_PRIM_SCAL_META_SCALAR_TYPE_HPP
#define STAN_MATH_PRIM_SCAL_META_SCALAR_TYPE_HPP
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/scal/meta/is_vector.hpp>
#include <stan/math/prim/mat/meta/is_vector.hpp>
#include <stan/math/prim/arr/meta/is_vector.hpp>
#include <stan/math/prim/mat/meta/value_type.hpp>
#include <stan/math/prim/scal/meta/value_type.hpp>
namespace stan {
namespace {
template <bool is_vec, typename T>
struct scalar_type_helper {
typedef T type;
};
template <typename T>
struct scalar_type_helper<true, T> {
typedef typename
scalar_type_helper<is_vector<typename
stan::math::value_type<T>::type>::value,
typename stan::math::value_type<T>::type>::type
type;
};
}
template <typename T>
struct scalar_type {
typedef typename scalar_type_helper<is_vector<T>::value, T>::type type;
};
// ****************** additions for new VV *************************
template <typename T>
struct scalar_type<Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> > {
typedef typename scalar_type<T>::type type;
};
template <typename T>
struct scalar_type<T*> {
typedef typename scalar_type<T>::type type;
};
}
#endif
stan::scalar_type< T * >::type
scalar_type< T >::type type
Definition: scalar_type.hpp:49
stan::scalar_type
Metaprogram structure to determine the base scalar type of a template argument.
Definition: scalar_type.hpp:37
is_vector.hpp
is_vector.hpp
stan::scalar_type::type
scalar_type_helper< is_vector< T >::value, T >::type type
Definition: scalar_type.hpp:38
value_type.hpp
stan::scalar_type< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > >::type
scalar_type< T >::type type
Definition: scalar_type.hpp:44
Eigen.hpp
value_type.hpp
is_vector.hpp
stan::math::value_type
Primary template class for metaprogram to compute the type of values stored in a container.
Definition: value_type.hpp:21

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