svdcompare.pl - Provide a "fuzzy" diff command for comparing svd output to our key
Simulates 'diff' system command on numeric matrices allowing some precision errors within a given tolerance. This is necessary since the results from SVDPACKC can vary somewhat depending on the underlying architecture.
As of 1.09 the tolerance has been hard coded at 10000, meaning that we are simply checking to see that output is generated. The differences among different architectures seem to cause rather large differences in results. This is not necessarily a problem, since if you run all your experiments on the same system, the SVD values will be consistent within that architecture. We would not recommend mixing SVDPACKC output from various systems for this reason.
svdcompare.pl MATRIX1 MATRIX2 TOLERANCE
Should be the matrix files to be compared, formatted like SenseClusters' standard matrix/vector format.
Should be a numeric value (integer or float) specifying the tolerance limit. Matrix cells at the same locations ([i][j]) in MATRIX1 and MATRIX2 that differ by more than the given TOLERANCE will be treated as different.
Output will be blank if no pair of matrix cells appearing at the same location in MATRIX1 and MATRIX2 has an absolute difference more than a given TOLERANCE.
Following conditions will lead to non-blank output -
1. If the number of rows in the two matrices are different.
2. If ROWi in MATRIX1 has different number of columns than ROWi in MATRIX2.
3. If abs(MATRIX1[i][j]-MATRIX2[i][j]) > TOLERANCE
where abs() shows the absolute function.
Output if displayed will show
where LI1 is an Ith line in MATRIX1 and LI2 is an Ith line in MATRIX2, for all lines I where the matrices differ as per the above conditions.
Amruta Purandare, University of Pittsburgh Ted Pedersen, University of Minnesota, Duluth tpederse at d.umn.edu
Copyright (c) 2003-2008 Amruta Purandare and Ted Pedersen
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to
The Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.