Template Function libecpint::check_file

Function Documentation

template<typename T>
int libecpint::check_file(std::string filename, std::vector<T> &results, double thresh = 1e-5, double precision = 1e-10)

A helper function for tests that reads in a file of values and compares them to those provided by the test, returning 0 on success or 1 on failure.

Template Parameters

T – - the type of the value; must be pipeable from a stringstream.

Parameters
  • filename – - the file to read data from

  • results – - reference to the vector of calculated results

Returns

0 if the results agree with the file within 0.00005%, 1 otherwise