Skip to content

Numeric diff - compare unformatted text files with numerical content

License

Notifications You must be signed in to change notification settings

quinoacomputing/ndiff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License

ndiff

ndiff is an efficient and flexible tool designed to compare unformatted text files with numerical content. It is well suited for regression testing, for validating data versus templates, and for filtering data following templates.

Author

Laurent Deniau ([email protected]) CERN - BE/ABP

Motivation

The ndiff tool is a program developed for the test system of the MAD-X application. The purpose of this tool is to compare line by line unformatted text files with numerical content in a portable way. The portability of the comparison is resulting from the acceptance of (user-defined) small numerical differences and varying number representation that occur across runs, compilers and platforms. For example, ndiff will consider to be equal the numbers 0.001, 1e-3, 100.00e-5 and 0.0001e+001, while diff-like Unix tools will report differences.

To the knowledge of the author, the ndiff tool does not seem to have any equivalent freely available on the world wide web, despite the obvious interest and need for the scientific community. Other similar open source tools exist like numdiff or ndiff (same name but not same tool), but they do not provide the flexibility required by the test system of MAD-X. Many options and commands have been added to ndiff in order to solve problems related to testing MAD-X, hence examples will often refer to the MAD-X test system.

The ndiff tool is written entirely in the C programming language with no external dependencies to ensure maximum portability and performance. It is very efficient to deal with both large input of data and large number of rules (i.e., user-defined constraints). ndiff can process more than 100 MB of data per second (i.e., nearly at the rate of disk I/O) and compare few millions numbers per second on recent computers.

Documentation

https://github.com/jbakosi/ndiff/blob/master/doc/CERN-ACC-NOTE-2013-0005.pdf

Fork

This forks http://svn.cern.ch/guest/madx/trunk/madX/tools/numdiff.

About

Numeric diff - compare unformatted text files with numerical content

Resources

License

Stars

Watchers

Forks

Packages

No packages published