Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ one_hot_int_array()

std::vector< int > stan::math::one_hot_int_array ( int  K,
int  k 
)
inline

Return an integer array with 1 in the k-th position and zero elsewhere.

Parameters
Ksize of the array
kposition of the 1 (indexing from 1)
Returns
An integer array of size K with all elements initialized to zero and a 1 in the k-th position.
Exceptions
std::domain_errorif K is not positive, or if k is less than 1 or greater than K.

Definition at line 20 of file one_hot_int_array.hpp.