Utilities

GenerateFunction

template<fgc4::utils::NumericScalar IndexType, fgc4::utils::NumericScalar StoredType>
std::vector<std::pair<IndexType, StoredType>> fgc4::utils::generateFunction(std::function<StoredType(IndexType)> function, IndexType min, IndexType max, size_t number_points)

Generates a vector of index-value pairs with equally spaced binning from min to max

Parameters:
  • function – Function to generate y-axis values from x-axis values

  • min – Minimum x-axis value

  • max – Maximum x-axis value

  • number_points – Length of the vector to generate

Returns:

Vector with index-value pairs following the provided function in the defined range