00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 char tenseur_compare_C[] = "$Header: /cvsroot/Lorene/C++/Source/Tenseur/tenseur_compare.C,v 1.3 2014/10/13 08:53:42 j_novak Exp $" ;
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #include "math.h"
00051
00052
00053 #include "tenseur.h"
00054
00055
00056 namespace Lorene {
00057 void Tenseur::compare(const Tenseur& tens, const char* name) {
00058 assert ( valence == tens.get_valence() ) ;
00059
00060 cout << "----------------------------------------------" << endl ;
00061 cout << "Comparison of " << name << " : " << endl << endl ;
00062
00063 if (valence == 0) {
00064 Cmp comp = tens() ;
00065 Cmp tmp = (*this)() ;
00066 tmp.compare(comp, name) ;
00067 }
00068
00069 if (valence == 1) {
00070 Cmp comp0 = tens(0) ;
00071 Cmp comp1 = tens(1) ;
00072 Cmp comp2 = tens(2) ;
00073
00074 Cmp tmp0 = (*this)(0) ;
00075 Cmp tmp1 = (*this)(1) ;
00076 Cmp tmp2 = (*this)(2) ;
00077
00078 tmp0.compare(comp0, name, 0) ;
00079 tmp1.compare(comp1, name, 1) ;
00080 tmp2.compare(comp2, name, 2) ;
00081 }
00082
00083 if (valence == 2) {
00084 Cmp comp00 = tens(0,0) ;
00085 Cmp comp01 = tens(0,1) ;
00086 Cmp comp02 = tens(0,2) ;
00087 Cmp comp10 = tens(1,0) ;
00088 Cmp comp11 = tens(1,1) ;
00089 Cmp comp12 = tens(1,2) ;
00090 Cmp comp20 = tens(2,0) ;
00091 Cmp comp21 = tens(2,1) ;
00092 Cmp comp22 = tens(2,2) ;
00093
00094 Cmp tmp00 = (*this)(0,0) ;
00095 Cmp tmp01 = (*this)(0,1) ;
00096 Cmp tmp02 = (*this)(0,2) ;
00097 Cmp tmp10 = (*this)(1,0) ;
00098 Cmp tmp11 = (*this)(1,1) ;
00099 Cmp tmp12 = (*this)(1,2) ;
00100 Cmp tmp20 = (*this)(2,0) ;
00101 Cmp tmp21 = (*this)(2,1) ;
00102 Cmp tmp22 = (*this)(2,2) ;
00103
00104 tmp00.compare(comp00, name, 0, 0) ;
00105 tmp01.compare(comp01, name, 0, 1) ;
00106 tmp02.compare(comp02, name, 0, 2) ;
00107 tmp10.compare(comp10, name, 1, 0) ;
00108 tmp11.compare(comp11, name, 1, 1) ;
00109 tmp12.compare(comp12, name, 1, 2) ;
00110 tmp20.compare(comp20, name, 2, 0) ;
00111 tmp21.compare(comp21, name, 2, 1) ;
00112 tmp22.compare(comp22, name, 2, 2) ;
00113 }
00114
00115 if (valence > 2 ) {
00116 abort() ;
00117 }
00118 }
00119
00120 void Tenseur::compare(FILE* fich, const char* name_i) {
00121
00122 Mg3d mg(fich) ;
00123 Map_et mpg(mg, fich) ;
00124
00125 Tenseur tens(mpg, mpg.get_bvect_cart(), fich) ;
00126
00127 compare(tens, name_i) ;
00128
00129
00130 }
00131 }