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

◆ linspaced_vector()

auto stan::math::linspaced_vector ( int  K,
double  low,
double  high 
)
inline

Return a vector of linearly spaced elements.

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

Parameters
Ksize of the vector
lowsmallest value
highlargest value
Returns
A vector 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 25 of file linspaced_vector.hpp.