Stan Math Library
2.14.0
reverse mode automatic differentiation
stan
math
prim
mat
fun
square.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_PRIM_MAT_FUN_SQUARE_HPP
2
#define STAN_MATH_PRIM_MAT_FUN_SQUARE_HPP
3
4
#include <
stan/math/prim/mat/vectorize/apply_scalar_unary.hpp
>
5
#include <
stan/math/prim/scal/fun/square.hpp
>
6
7
namespace
stan
{
8
namespace
math {
9
16
struct
square_fun
{
17
template
<
typename
T>
18
static
inline
T
fun
(
const
T& x) {
19
return
square
(x);
20
}
21
};
22
29
template
<
typename
T>
30
inline
typename
apply_scalar_unary<square_fun, T>::return_t
31
square
(
const
T& x) {
32
return
apply_scalar_unary<square_fun, T>::apply
(x);
33
}
34
35
}
36
}
37
38
#endif
stan
Definition:
log_sum_exp.hpp:8
stan::math::square_fun
Structure to wrap square() so that it can be vectorized.
Definition:
square.hpp:16
square.hpp
stan::math::square
fvar< T > square(const fvar< T > &x)
Definition:
square.hpp:14
stan::math::apply_scalar_unary::return_t
Eigen::Matrix< scalar_t, T::RowsAtCompileTime, T::ColsAtCompileTime > return_t
Return type for applying the function elementwise to a matrix expression template of type T...
Definition:
apply_scalar_unary.hpp:47
stan::math::square_fun::fun
static T fun(const T &x)
Definition:
square.hpp:18
stan::math::apply_scalar_unary::apply
static return_t apply(const T &x)
Return the result of applying the function defined by the template parameter F to the specified matri...
Definition:
apply_scalar_unary.hpp:57
apply_scalar_unary.hpp
[
Stan Home Page
]
© 2011–2016, Stan Development Team.