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

◆ linspaced_array()

std::vector< double > stan::math::linspaced_array ( int  K,
double  low,
double  high 
)
inline

Return an array of linearly spaced elements.

This produces an array from low to high (inclusive) with elements spaced as (high - low) / (K - 1). For K=1, the array will contain the high value; for K=0 it returns an empty array.

Parameters
Ksize of the array
lowsmallest value
highlargest value
Returns
An array of size K with elements linearly spaced between low and high.
Exceptions
std::domain_errorif K is negative, if low is nan or infinite, if high is nan or infinite, or if high is less than low.

Definition at line 26 of file linspaced_array.hpp.