NumericFileComparison Class Reference

#include <NumericFileComparison.hpp>

Collaboration diagram for NumericFileComparison:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 NumericFileComparison (std::string fileName1, std::string fileName2)
 ~NumericFileComparison ()
bool CompareFiles (double absTolerance=DBL_EPSILON, unsigned ignoreFirstFewLines=0)

Private Attributes

std::string mFilename1
std::string mFilename2
std::ifstream * mpFile1
std::ifstream * mpFile2


Detailed Description

Compare files of numbers to see if they match to within a given tolerance.

Definition at line 37 of file NumericFileComparison.hpp.


Constructor & Destructor Documentation

NumericFileComparison::NumericFileComparison ( std::string  fileName1,
std::string  fileName2 
) [inline]

Specify two files to compare, and open them for reading. Actual comparison is done by calling CompareFiles.

Parameters:
fileName1 first file
fileName2 second file

Definition at line 53 of file NumericFileComparison.hpp.

References EXCEPTION, mpFile1, and mpFile2.

NumericFileComparison::~NumericFileComparison (  )  [inline]

Close the files being compared.

Definition at line 78 of file NumericFileComparison.hpp.

References mpFile1, and mpFile2.


Member Function Documentation

bool NumericFileComparison::CompareFiles ( double  absTolerance = DBL_EPSILON,
unsigned  ignoreFirstFewLines = 0 
) [inline]

Compare the files.

Parameters:
absTolerance absolute tolerance on difference between numbers.
ignoreFirstFewLines How many lines to ignore from the comparison

Definition at line 98 of file NumericFileComparison.hpp.

References mFilename1, mFilename2, mpFile1, and mpFile2.


Member Data Documentation

std::string NumericFileComparison::mFilename1 [private]

First filename

Definition at line 40 of file NumericFileComparison.hpp.

Referenced by CompareFiles().

std::string NumericFileComparison::mFilename2 [private]

Second filename

Definition at line 41 of file NumericFileComparison.hpp.

Referenced by CompareFiles().

std::ifstream* NumericFileComparison::mpFile1 [private]

First file

Definition at line 43 of file NumericFileComparison.hpp.

Referenced by CompareFiles(), NumericFileComparison(), and ~NumericFileComparison().

std::ifstream* NumericFileComparison::mpFile2 [private]

Second file

Definition at line 44 of file NumericFileComparison.hpp.

Referenced by CompareFiles(), NumericFileComparison(), and ~NumericFileComparison().


The documentation for this class was generated from the following file:

Generated on Mon Nov 1 12:37:10 2010 for Chaste by  doxygen 1.5.5