Add a `Field::compare` method
- Jul 12, 2023
-
-
Thibault Lestang authored50542899
-
Thibault Lestang authored7e6b9f80
-
91e75a33
-
782055e4
-
Thibault Lestang authored6e60a566
-
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.