Loading [MathJax]/extensions/TeX/AMSsymbols.js
Automatic Differentiation
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches

◆ forward_as() [3/4]

template<typename T_desired , typename T_actual , typename = std::enable_if_t< std::is_floating_point_v<std::decay_t< T_desired>> && std::is_integral_v<std::decay_t<T_actual>>>>
T_desired stan::math::forward_as ( const T_actual &  a)
inline

Assume which type we get.

If actual type is not convertible to assumed type or in case of eigen types compile time rows and columns are not the same and desired sizes are not dynamic this has return type of T_desired, but it only throws. This version should only be used where it is optimized away so the throw should never happen.

This handles the edge case where both types are simple arithmetic types and we would like to just convert one to another.

Template Parameters
T_desiredtype of output we need to avoid compile time errors
T_actualactual type of the argument
Parameters
ainput value
Returns
a

Definition at line 87 of file forward_as.hpp.