Compare

PURPOSE ^

C/C++ source

SYNOPSIS ^

C/C++ source

DESCRIPTION ^

C/C++ source

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 /*COMPARES TXO BINARY FILES GIVEN AS COMMAND LINE ARGUMENTS args[1] and args[2].
0002 TWO OPTIONS AVAILABLE: a=0 DISPLAYS THE RELATIVE ERROR AND a=1 DISPLAYS INDICES
0003 OF ELEMENTS WITH ERRORS ARE > 1e6
0004 pgcc -c Compare.c
0005 pgcc -o Compare Compare.o ReadBinary_DKE.o absolute.o 
0006 */
0007 
0008 #include <stdio.h>
0009 #include <stdlib.h>
0010 #include <math.h>
0011 #include "tensor.h"
0012 
0013 void ReadBinary_DKE(char* file, struct Tensor *A);
0014 DOUBLE absolute(DOUBLE a);
0015 
0016 void main(int argc, char **args){
0017 int i;
0018 struct Tensor A,B;
0019 char *file= args[1];
0020 char *file2= args[2];
0021 int a=0;
0022 printf("%c\n",file);
0023 ReadBinary_DKE(file,&A);
0024 ReadBinary_DKE(file2,&B);
0025 if(a==0){
0026    for(i=0;i"(A-B)/B[%i]=%g\n",i,(A.vals[i]-B.vals[i])/(B.vals[i]));
0028    }
0029 }
0030 if(a==1){
0031 if(A.size!=B.size){printf("dimensiosn inconsitency\n");}
0032 else {
0033 for(i=0;iif(absolute((A.vals[i]-B.vals[i])/B.vals[i])>0.001){printf("i=%i",i);}
0035 }
0036 }
0037 }
0038 }

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.