Skip to content

Add a `Field::compare` method

Thibault Lestang requested to merge compare_fields into master

This adds a compare method for a instance of Field to compare itself to another one. I originally wanted to overload operator==, but implemented a normal method in order to be able to pass a tolerance. The method should return true only if the the two fields have the same number of blocks and these blocks have the same structure, and each field value are equal up to the absolute tolerance passed to the function.

This does the job for now, but we might want to look into using the boost manipulator boost::test_tools::per_element in the test assertions. That would require the field to be implemented as a container with a forward iterator: beyond my C++ skills at the minute.

Merge request reports