Stan Math Library  2.15.0
reverse mode automatic differentiation
Public Types | Static Public Member Functions | List of all members
stan::math::apply_scalar_unary< F, int > Struct Template Reference

Template specialization for vectorized functions applying to integer arguments. More...

#include <apply_scalar_unary.hpp>

Public Types

typedef double return_t
 The return type, double. More...
 

Static Public Member Functions

static return_t apply (int x)
 Apply the function specified by F to the specified argument. More...
 

Detailed Description

template<typename F>
struct stan::math::apply_scalar_unary< F, int >

Template specialization for vectorized functions applying to integer arguments.

Although the argument is integer, the return type is specified as double. This allows promotion of integers to doubles in vectorized functions, or in containers.

Template Parameters
FType of function defining static apply function.

Definition at line 102 of file apply_scalar_unary.hpp.

Member Typedef Documentation

§ return_t

template<typename F >
typedef double stan::math::apply_scalar_unary< F, int >::return_t

The return type, double.

Definition at line 106 of file apply_scalar_unary.hpp.

Member Function Documentation

§ apply()

template<typename F >
static return_t stan::math::apply_scalar_unary< F, int >::apply ( int  x)
inlinestatic

Apply the function specified by F to the specified argument.

This is defined through a direct application of F::fun(), which must be defined for double arguments.

Parameters
xArgument scalar.
Returns
Result of applying F to the scalar.

Definition at line 117 of file apply_scalar_unary.hpp.


The documentation for this struct was generated from the following file:

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