Stan Math Library
4.9.0
Automatic Differentiation
|
|
inline |
Return the log of the sum of the exponentiated values of the specified matrix of values.
Returns the log sum of exponentials.
The matrix may be a full matrix, a vector, a row vector, or a container of these.
The function is defined as follows to prevent overflow in exponential calculations.
\(\log \sum_{n=1}^N \exp(x_n) = \max(x) + \log \sum_{n=1}^N \exp(x_n - \max(x))\).
T | Type of input vector or matrix. |
[in] | x | Matrix of specified values. |
The matrix may be a full matrix, a vector, a row vector, or a container of these.
The function is defined as follows to prevent overflow in exponential calculations.
\(\log \sum_{n=1}^N \exp(x_n) = \max(x) + \log \sum_{n=1}^N \exp(x_n - \max(x))\).
T | type of input vector or matrix |
[in] | x | matrix of specified values |
T | Type of input vector or matrix. |
x | matrix |
Definition at line 53 of file log_sum_exp.hpp.