/[escript]/branches/symbolic_from_3470/escript/test/python/test_util_unary_no_tagged_data.py
ViewVC logotype

Diff of /branches/symbolic_from_3470/escript/test/python/test_util_unary_no_tagged_data.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3492 by caltinay, Tue Mar 15 04:23:54 2011 UTC revision 3493 by caltinay, Mon Apr 4 04:37:02 2011 UTC
# Line 181  class Test_util_unary_no_tagged_data(Tes Line 181  class Test_util_unary_no_tagged_data(Tes
181        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
182        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
183     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_log10_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=log10(arg)  
       s=numpy.array(3.30130672789)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(0.518685876964)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_log10_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=log10(arg)  
       s=numpy.array([80.781942827080286, 19.173714117161172])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([1.9073142938566714, 1.2827062476902695])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_log10_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=log10(arg)  
       s=numpy.array([[12.87178302719602, 68.894041539222059, 67.550533437690731, 65.121963561659555, 17.165986405555117], [70.260037949797564, 84.846330525471089, 33.94378182270269, 71.878916358185535, 48.565558946072912], [22.693372717603474, 21.936741520835913, 90.32217067645739, 70.411674261453342, 6.3690942522773053], [18.813716565135767, 44.357013040228409, 20.907360810094122, 4.6004533917390633, 16.782614506943588]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[1.1096387104814578, 1.8381816625674801, 1.829628782938076, 1.8137274869538904, 1.2346687642535261], [1.8467083800330524, 1.9286330644851621, 1.5307602272931806, 1.8566015210912505, 1.6863283914409721], [1.3558990460740996, 1.3411721180145617, 1.9557943662672153, 1.8476446711733261, 0.80407767578801104], [1.2744745969481517, 1.6469622934775219, 1.3202992141685685, 0.66280063512227227, 1.224859619036704]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_log10_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=log10(arg)  
       s=numpy.array([[[97.677455398657074, 5.2995923723645664], [59.480459383312862, 31.287029167765699]], [[71.178947786444226, 80.741319028685012], [4.6937684226740757, 82.77854206239293]], [[37.685161012781009, 98.687319373999358], [35.10949192866029, 91.569084058538095]], [[5.0027662267064468, 91.014241654301969], [58.955781232044089, 42.084452128968486]], [[42.095754738844363, 65.010819895554334], [1.5796236582104439, 21.735792752471603]], [[2.7216077761134634, 94.934790022180749], [48.226002781175161, 39.974953444592217]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[1.9897943372521787, 0.72424246634779432], [1.7743743140339689, 1.4953643270547985]], [[1.852351563691448, 1.9070958399739759], [0.67152165892347482, 1.9179177731177302]], [[1.5761703751687193, 1.9942613524700676], [1.5454245448120962, 1.9617488700750414]], [[0.69921020929486732, 1.9591093548259275], [1.7705263986434625, 1.6241216777418199]], [[1.6242383004328855, 1.8129856432563642], [0.19855362959306125, 1.3371754844967376]], [[0.4348255371262037, 1.9774253941539486], [1.683281266856163, 1.6017879666329446]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_log10_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=log10(arg)  
       s=numpy.array([[[[16.045040740457228, 44.206338348310695, 93.40651696252057, 41.363358895057978], [63.003183559801194, 42.521563748415652, 8.6993137819993134, 74.382838127848629], [45.459960205898135, 80.856347298703682, 44.432638407790726, 19.227764687502933]], [[83.760984274338924, 85.653170708807224, 70.695307663592047, 93.459124905553011], [12.593602001874332, 15.823926028904745, 56.197268657756482, 72.264399830277114], [79.814475892193883, 72.335551687072851, 38.67162462451919, 72.957787867770691]]], [[[63.261177157590048, 19.106157472979373, 12.579604590358606, 57.238626886098317], [37.258243564126879, 80.6564043172623, 17.791453176791894, 72.593744868798936], [51.784094386303515, 71.1225086541086, 52.470521860231401, 37.515182918884939]], [[60.054478935403843, 64.171538197777366, 59.343629062665904, 78.932915989720726], [71.684640978389197, 17.296300300660835, 66.710626043564787, 29.599576157916399], [82.750620535499948, 68.051253095052544, 47.140766487889351, 64.511627295078895]]], [[[63.303786699612154, 6.3288524584968009, 7.8921294047783288, 16.867328761433935], [26.792013647404634, 56.632884251794707, 15.19584760573529, 47.669107257961393], [14.796650879616557, 93.976599541985081, 83.095541055174948, 69.492537636920886]], [[13.729968603614751, 0.47465429532443348, 96.901076881373811, 53.206407481750915], [38.296922736957285, 64.554310808840825, 44.872698720823387, 44.966755775657276], [39.450963126141424, 45.816408715888691, 24.156240302619725, 88.251967910885227]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[1.2053408241634207, 1.6454845433840053, 1.9703771779659067, 1.6166157982280229], [1.7993624949698093, 1.6286092275074269, 0.93948499601574675, 1.8714727451408386], [1.6576290512225109, 1.9077141181026729, 1.6477021023906282, 1.2839287985229535]], [[1.923041772090109, 1.9327434443108824, 1.8493905888543518, 1.970621710237741], [1.1001499640874481, 1.1993142440892028, 1.7497152081724321, 1.8589244001304135], [1.9020816661621307, 1.8593517980783829, 1.5873924174995711, 1.8630716574011561]]], [[[1.8011372689627134, 1.2811733528802767, 1.0996669903203637, 1.7576892067973247], [1.5712223774419329, 1.9066388571461961, 1.2502114219955252, 1.8608992007827503], [1.7141963855944065, 1.85200706679542, 1.7199153836168972, 1.574207068351656]], [[1.7785454031526147, 1.807342449495341, 1.7733741013623185, 1.8972581470832404], [1.855426114484128, 1.237953216953114, 1.8241950162932645, 1.4712854923563716], [1.9177712591744391, 1.8328361267069659, 1.673396639680764, 1.8096379970383623]]], [[[1.8014296893784714, 0.80132497129351055, 0.89719419762936958, 1.22704630985494], [1.428005355754228, 1.7530686803399524, 1.1817249295049448, 1.6782370185817173], [1.1701634269423968, 1.9730197264193245, 1.9195777199683672, 1.8419381709626483]], [[1.1376695441346099, -0.32362258467939325, 1.9863286034804823, 1.7259639361747965], [1.5831638786148206, 1.8099252488949431, 1.6519821895312212, 1.6528915555787334], [1.5960576102136967, 1.6610210443470965, 1.3830293412534942, 1.9457243984033095]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
184     def test_wherePositive_float_rank0(self):     def test_wherePositive_float_rank0(self):
185        arg=-70.4202098913        arg=-70.4202098913
186        res=wherePositive(arg)        res=wherePositive(arg)
# Line 370  class Test_util_unary_no_tagged_data(Tes Line 320  class Test_util_unary_no_tagged_data(Tes
320        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
321        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
322     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_wherePositive_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=wherePositive(arg)  
       s=numpy.array(-9.43501528753)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(0.0)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_wherePositive_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=wherePositive(arg)  
       s=numpy.array([-86.076223420613644, 24.887439437676818])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([0.0, 1.0])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_wherePositive_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=wherePositive(arg)  
       s=numpy.array([[-72.861467415908407, 87.445413020151335, 44.122959128487878, 37.815712663148446, 16.51575833789849], [5.5678430369583225, -31.657700395046518, -23.000608981075231, 13.175691780223559, -47.172371090875245], [46.838381836265143, -0.64336779291720347, 79.712475185814469, -69.138421706470496, -28.642558818567949], [91.568480320945753, -14.976400873356837, -16.802832112916647, 7.6223808092700409, 43.400561726126483]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[0.0, 1.0, 1.0, 1.0, 1.0], [1.0, 0.0, 0.0, 1.0, 0.0], [1.0, 0.0, 1.0, 0.0, 0.0], [1.0, 0.0, 0.0, 1.0, 1.0]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_wherePositive_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=wherePositive(arg)  
       s=numpy.array([[[14.254888779256163, -93.079183322703372], [-63.28205537162679, -5.1053738037226708]], [[88.548065869410834, 92.437854070248505], [67.463905803574136, -69.119627703399033]], [[-5.1587834929179337, 14.438150309231744], [-60.082589289020348, -2.8764823549122411]], [[86.474191437976202, -23.913731018025047], [-14.33516255203034, -76.872920311355045]], [[31.232916890504555, -98.898455060843588], [-63.462721420014013, -59.602078269458957]], [[54.664891148938096, -5.6099126717595595], [34.202150896807495, 28.911805516544462]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[1.0, 0.0], [0.0, 0.0]], [[1.0, 1.0], [1.0, 0.0]], [[0.0, 1.0], [0.0, 0.0]], [[1.0, 0.0], [0.0, 0.0]], [[1.0, 0.0], [0.0, 0.0]], [[1.0, 0.0], [1.0, 1.0]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_wherePositive_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=wherePositive(arg)  
       s=numpy.array([[[[-37.88958007709131, -69.422440876170157, 98.309997394312262, -99.832160786266513], [-98.549853800366634, -59.212851099858788, 70.467934907158082, 87.428704353937917], [8.80467342401829, -67.471677482415785, 23.942091174941325, 15.803088287257538]], [[-63.172322626194635, 82.538771957419357, 45.164380438773549, -94.022903002494402], [4.0962211030344662, -48.787187296107028, 45.525825517642005, 45.711734183529074], [48.265143872942929, -87.162363496761159, 16.011575553754028, -96.721599021387377]]], [[[9.4948883762552327, -18.446841364017814, 20.351663614867761, 55.318055980592845], [90.016295105535704, 18.315786000578143, 54.95564104759859, 75.816166573502358], [-71.162333511732001, -95.953386780228797, 84.570733819306724, -10.941053704889384]], [[-8.4083264964211111, 56.989366045336567, 9.1939134657073538, 22.066859941476011], [1.0651237550664661, 84.74053823059441, -90.753568574100399, 73.121172281878046], [-99.18615441543605, -28.331557285152641, -44.476057352835177, 46.421436565938251]]], [[[73.673411450959293, 72.485098252566615, -72.54930137464963, 82.784929340261613], [-12.436989146984473, 33.551428499615753, 53.425622240674727, 55.24125898657536], [-46.807406690716967, -99.733941429080986, 41.082918915124822, 43.402758860058839]], [[-30.615849276223585, 90.588710503833624, 36.934609404692054, -87.474764164742183], [-96.421287284725565, -5.6209672311981791, 89.578789522633173, 56.454146153177106], [-23.865121727890298, -53.925804298204838, -1.8102203614056123, -37.919849585870246]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 1.0, 1.0], [1.0, 0.0, 1.0, 1.0]], [[0.0, 1.0, 1.0, 0.0], [1.0, 0.0, 1.0, 1.0], [1.0, 0.0, 1.0, 0.0]]], [[[1.0, 0.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 1.0, 0.0]], [[0.0, 1.0, 1.0, 1.0], [1.0, 1.0, 0.0, 1.0], [0.0, 0.0, 0.0, 1.0]]], [[[1.0, 1.0, 0.0, 1.0], [0.0, 1.0, 1.0, 1.0], [0.0, 0.0, 1.0, 1.0]], [[0.0, 1.0, 1.0, 0.0], [0.0, 0.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
323     def test_whereNegative_float_rank0(self):     def test_whereNegative_float_rank0(self):
324        arg=60.8682840238        arg=60.8682840238
325        res=whereNegative(arg)        res=whereNegative(arg)
# Line 558  class Test_util_unary_no_tagged_data(Tes Line 458  class Test_util_unary_no_tagged_data(Tes
458        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
459        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
460     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_whereNegative_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=whereNegative(arg)  
       s=numpy.array(40.4011650623)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(0.0)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereNegative_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=whereNegative(arg)  
       s=numpy.array([-71.655665065686279, 91.138272113877008])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([1.0, 0.0])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereNegative_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=whereNegative(arg)  
       s=numpy.array([[12.471311999599237, -79.466700443191797, -29.647474934713685, 78.725723129788037, -25.193667637213736], [-27.383589504006082, -92.789488552284837, -67.82758123957224, 48.122220899847264, 19.750545844613285], [74.799702244704122, -4.7296754832835575, -63.235693854345975, -75.80063354282521, 35.997583859070147], [-41.225516291769672, 38.466173287652197, -75.068915147413065, 11.383660545905457, 72.671825561656561]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[0.0, 1.0, 1.0, 0.0, 1.0], [1.0, 1.0, 1.0, 0.0, 0.0], [0.0, 1.0, 1.0, 1.0, 0.0], [1.0, 0.0, 1.0, 0.0, 0.0]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereNegative_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=whereNegative(arg)  
       s=numpy.array([[[86.049934039938336, -76.916545040373748], [47.912904518542064, -19.385016225256763]], [[-43.143194458809234, 22.762350582447041], [17.476826380519455, -26.433656105535647]], [[-36.204785428645977, -16.285117464727605], [-50.409162834264045, -25.095216353145005]], [[-39.400776326287087, -33.445516576117896], [37.980139505297558, -92.882287108795424]], [[-46.373275962943225, -12.838605874855318], [84.062884747590715, 98.762981126760053]], [[85.475866506225884, -56.869083412891563], [-2.8563954657025761, -33.463794722879598]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[0.0, 1.0], [0.0, 1.0]], [[1.0, 0.0], [0.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [0.0, 1.0]], [[1.0, 1.0], [0.0, 0.0]], [[0.0, 1.0], [1.0, 1.0]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereNegative_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=whereNegative(arg)  
       s=numpy.array([[[[-39.14990061925532, 51.949859965073983, 55.37633633636824, -82.35728979416686], [-62.823259140676726, -60.987847514454629, -87.165694611302087, -9.4983692954954506], [-59.034970257539342, -12.349309123798236, -74.849079914303317, -41.408354712867457]], [[29.9307981548464, -81.526499155207048, 46.012868740458487, 11.900092247618034], [53.654390339989675, -56.414112602954262, 32.405102833786714, 46.210686310237207], [-72.147580142442223, -22.977139544545636, 89.142946567216995, -88.831906311919909]]], [[[-1.3198711955164697, 21.369948454299475, 59.766310276379983, -53.755025619966347], [98.576470432795276, -72.025064379707928, 58.324331062695535, 49.676210952580192], [-29.552848681947296, 13.576893933997908, -54.333930944304967, -13.498886110363202]], [[9.3704956801669397, -2.2513137797195668, -52.882998377311516, -93.606100392506164], [-88.881588707277956, 83.417801198755512, 57.914520898503298, -97.689248571026454], [-74.800685017601623, -35.991007287628051, 81.330326943014711, 22.556206038634812]]], [[[9.2780054495407569, 93.824584816474839, 51.875991914097796, -42.220631714359456], [85.338622377384127, -27.149448703310824, -73.347709655591103, -23.42518563583134], [45.940803116571885, -32.381912906643123, -95.049577516480682, 63.411283490611311]], [[-30.01425279958174, 25.196938582282158, -10.252771505748854, 52.029675553268618], [-0.53388159534763702, 77.25070415513926, 49.336454387777877, -46.275901599419569], [4.3984065300076907, 91.391927269984365, 42.161201561377652, -85.358967464268986]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[1.0, 0.0, 0.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]], [[0.0, 1.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [1.0, 1.0, 0.0, 1.0]]], [[[1.0, 0.0, 0.0, 1.0], [0.0, 1.0, 0.0, 0.0], [1.0, 0.0, 1.0, 1.0]], [[0.0, 1.0, 1.0, 1.0], [1.0, 0.0, 0.0, 1.0], [1.0, 1.0, 0.0, 0.0]]], [[[0.0, 0.0, 0.0, 1.0], [0.0, 1.0, 1.0, 1.0], [0.0, 1.0, 1.0, 0.0]], [[1.0, 0.0, 1.0, 0.0], [1.0, 0.0, 0.0, 1.0], [0.0, 0.0, 0.0, 1.0]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
461     def test_whereNonNegative_float_rank0(self):     def test_whereNonNegative_float_rank0(self):
462        arg=58.4734070432        arg=58.4734070432
463        res=whereNonNegative(arg)        res=whereNonNegative(arg)
# Line 746  class Test_util_unary_no_tagged_data(Tes Line 596  class Test_util_unary_no_tagged_data(Tes
596        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
597        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
598     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_whereNonNegative_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=whereNonNegative(arg)  
       s=numpy.array(-58.8398548815)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(0.0)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereNonNegative_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=whereNonNegative(arg)  
       s=numpy.array([-82.978162754997925, 8.8047326469017122])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([0.0, 1.0])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereNonNegative_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=whereNonNegative(arg)  
       s=numpy.array([[-57.114751898774863, 15.310009304133203, 43.273189593545482, 77.426458486062614, 98.035318487754211], [-76.31417820596009, 96.405957727411931, -36.79040107424283, 69.588907574896353, -90.819051620846139], [-21.384010858090917, -49.316099962453343, -55.596563560663206, -56.091061695460368, -54.243683421440721], [-3.1770490856211921, -77.802197055188955, -91.262528798034097, 16.294977226431428, -61.953476904394321]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[0.0, 1.0, 1.0, 1.0, 1.0], [0.0, 1.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 1.0, 0.0]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereNonNegative_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=whereNonNegative(arg)  
       s=numpy.array([[[-52.302419178666696, -36.011072121710995], [70.344129482626641, -94.887462805836108]], [[39.457090101441935, 62.182034936241706], [33.071419719406265, 19.65467224682935]], [[96.444658364252234, 41.810028968759298], [17.391731498730124, -61.25543188161371]], [[-63.301909068860418, -81.883202505287912], [-9.9686422778212318, -46.09994160257731]], [[0.79602140898114726, 50.995175121403491], [39.42271713433064, -42.96711417231338]], [[80.077410450464015, -98.147299040950202], [64.444746581110735, 51.710239923438252]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[0.0, 0.0], [1.0, 0.0]], [[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[1.0, 1.0], [1.0, 0.0]], [[1.0, 0.0], [1.0, 1.0]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereNonNegative_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=whereNonNegative(arg)  
       s=numpy.array([[[[-2.5976588468490576, 40.976618480274965, 70.916330592715354, -49.191553192076313], [-45.926997545504577, 24.639940210475771, 97.36697304102708, 17.590694675821311], [7.7336847115890208, 85.237419267281496, -44.228298807540178, 78.087061579851849]], [[-12.198656257367603, 47.317574884270329, -62.408862701830678, -80.308596525604585], [80.773698810403005, -9.4412453002422581, 23.683937597676618, 85.85784825956523], [59.265035657131932, -69.325519327240812, 8.7058140434875781, -2.6024028142058313]]], [[[86.063542738983188, -51.362725843818154, 34.405542453001004, -41.972672290063898], [55.999438377020596, 34.884322235694952, 43.380175207740791, 72.776691509642774], [34.801699371894642, -29.764898058856332, -21.123661199537452, 70.371152717243234]], [[3.6278240748509347, 70.0196680461124, 13.553508050734834, 63.606237837653055], [-96.718689436297979, 4.8092184150583961, 77.949143466573901, 4.2865181135117325], [86.218370330935954, 2.1563115590517583, 79.16881170243272, 30.950434657002916]]], [[[-21.513843712936279, 58.255206877882586, 72.514067267547603, -55.492241103847896], [50.528843425732504, 32.768659523585143, -96.564483321783712, 8.5964884268373822], [-64.457464623327951, 28.321553816132479, -80.813838907921777, -47.985766337452375]], [[72.299179846553841, 23.493342362064666, -62.700406034359645, 98.803246182773449], [58.424956553971555, 44.217263909841364, -90.54565580877221, -17.345594535777977], [-75.243832297268185, -78.534529191352576, -4.4135475705371761, -10.331784394585156]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[0.0, 1.0, 1.0, 0.0], [0.0, 1.0, 1.0, 1.0], [1.0, 1.0, 0.0, 1.0]], [[0.0, 1.0, 0.0, 0.0], [1.0, 0.0, 1.0, 1.0], [1.0, 0.0, 1.0, 0.0]]], [[[1.0, 0.0, 1.0, 0.0], [1.0, 1.0, 1.0, 1.0], [1.0, 0.0, 0.0, 1.0]], [[1.0, 1.0, 1.0, 1.0], [0.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]]], [[[0.0, 1.0, 1.0, 0.0], [1.0, 1.0, 0.0, 1.0], [0.0, 1.0, 0.0, 0.0]], [[1.0, 1.0, 0.0, 1.0], [1.0, 1.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
599     def test_whereNonPositive_float_rank0(self):     def test_whereNonPositive_float_rank0(self):
600        arg=-45.8140100626        arg=-45.8140100626
601        res=whereNonPositive(arg)        res=whereNonPositive(arg)
# Line 934  class Test_util_unary_no_tagged_data(Tes Line 734  class Test_util_unary_no_tagged_data(Tes
734        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
735        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
736     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_whereNonPositive_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=whereNonPositive(arg)  
       s=numpy.array(77.8916591537)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(0.0)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereNonPositive_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=whereNonPositive(arg)  
       s=numpy.array([-33.289158126131952, -1.5128195409398302])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([1.0, 1.0])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereNonPositive_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=whereNonPositive(arg)  
       s=numpy.array([[-89.675580644561265, 22.559086207037524, -61.828686826382075, 27.1544684361686, 45.542621022409065], [85.192461460403905, -53.369255198350189, -14.522490839063138, -52.745550126279504, 86.892055736152827], [59.381482694454775, -2.2128498063082986, -18.474083777512277, -32.66119377883534, -4.6884479061867381], [7.5046013827574569, -64.478468078572845, -62.300090670346989, -43.459905594571559, -37.619402963077995]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[1.0, 0.0, 1.0, 0.0, 0.0], [0.0, 1.0, 1.0, 1.0, 0.0], [0.0, 1.0, 1.0, 1.0, 1.0], [0.0, 1.0, 1.0, 1.0, 1.0]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereNonPositive_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=whereNonPositive(arg)  
       s=numpy.array([[[-95.918264910372713, 6.3129536060116038], [-76.185186646280044, 44.955820732431221]], [[-32.087973595564208, -0.31281142062647405], [98.251703861862637, 23.468120114051857]], [[-17.876631318058784, -80.339284229220681], [66.433104146541297, -2.5691119117624766]], [[-92.336473044409061, -66.47349632093993], [6.9081826899842298, -92.412591379337769]], [[69.747227993397672, -68.361187717592585], [28.906283769426977, -3.0855057313569034]], [[0.16094458858653127, -37.744731595476111], [29.326676077792968, -67.220325889081693]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[1.0, 0.0], [1.0, 0.0]], [[1.0, 1.0], [0.0, 0.0]], [[1.0, 1.0], [0.0, 1.0]], [[1.0, 1.0], [0.0, 1.0]], [[0.0, 1.0], [0.0, 1.0]], [[0.0, 1.0], [0.0, 1.0]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereNonPositive_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=whereNonPositive(arg)  
       s=numpy.array([[[[55.498714331062388, 54.252976216091497, -98.652221242885446, -23.046325158660252], [66.57207224733591, -81.489676342610181, -32.086709889394712, -53.285321024541574], [5.2473282469308771, 13.640749356133469, -12.21713455758298, -1.1074900781016055]], [[83.821686808343998, 99.553411628762717, -33.166274509524158, -53.92140858957346], [5.6843137169410483, 91.822981464459502, -59.926027075594135, 98.170404451167997], [-19.520109690127313, -16.751066330247028, -19.60635328442504, -73.443643477418306]]], [[[-88.557271430733664, 69.650033834683228, 55.310025898430098, -1.3968640891514497], [85.622930077343767, -28.885517945359183, -38.007545637866905, 48.884082461569591], [32.287613684538513, -67.874193842556593, -46.816154148980679, 15.033159367432276]], [[15.626339801085123, -36.615019684003272, -3.5738338209469305, -82.126638691597861], [75.620428324563647, 14.684051809096403, 32.959487070219126, -47.924394139408747], [86.232984866683438, 94.002057931789693, -5.031840183352827, -99.515668678010044]]], [[[38.57106713689825, 71.66686186356219, -72.000417104598526, -63.413495181487974], [69.578042969052859, 24.326236647615815, -61.668240010633532, -56.60420332916172], [-96.104048028550366, -63.518533753250914, -81.310814350545613, 85.074793962081429]], [[-71.475740787666183, -47.442708107298046, 76.896488259930521, 7.503896955381876], [1.72079358206976, 80.217658032495223, -76.894583651034452, 84.60341852944893], [-14.477740266380309, 9.795225312137859, 39.751992668400902, -45.915851163810764]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[0.0, 0.0, 1.0, 1.0], [0.0, 1.0, 1.0, 1.0], [0.0, 0.0, 1.0, 1.0]], [[0.0, 0.0, 1.0, 1.0], [0.0, 0.0, 1.0, 0.0], [1.0, 1.0, 1.0, 1.0]]], [[[1.0, 0.0, 0.0, 1.0], [0.0, 1.0, 1.0, 0.0], [0.0, 1.0, 1.0, 0.0]], [[0.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 1.0], [0.0, 0.0, 1.0, 1.0]]], [[[0.0, 0.0, 1.0, 1.0], [0.0, 0.0, 1.0, 1.0], [1.0, 1.0, 1.0, 0.0]], [[1.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [1.0, 0.0, 0.0, 1.0]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
737     def test_whereZero_float_rank0(self):     def test_whereZero_float_rank0(self):
738        arg=36.9194219022        arg=36.9194219022
739        res=whereZero(arg)        res=whereZero(arg)
# Line 1122  class Test_util_unary_no_tagged_data(Tes Line 872  class Test_util_unary_no_tagged_data(Tes
872        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
873        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
874     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_whereZero_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=whereZero(arg)  
       s=numpy.array(81.6444913441)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(0.0)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereZero_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=whereZero(arg)  
       s=numpy.array([-0.42577857552119269, -97.824884344164786])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([0.0, 0.0])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereZero_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=whereZero(arg)  
       s=numpy.array([[39.799478427096147, 38.492638423570327, -72.762325210310081, -69.098205396529181, 38.188266474849456], [13.030277476589887, 74.277784962164588, -75.455425329956682, -0.98991194199366817, 40.241690530095951], [32.255154097894831, -99.716448230113969, -21.681673392271421, 93.069064225310001, 11.128753427692573], [7.0711563192171809, -17.15976661897767, -74.584589854898439, 51.041755486974239, -5.6722415070331778]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereZero_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=whereZero(arg)  
       s=numpy.array([[[-6.9578233775275038, 49.132223141003095], [-48.145023755700088, 21.587944379016761]], [[86.651677318588611, -0.57273995292416657], [-24.596335688728061, -84.06959838105297]], [[39.239654475555739, 46.913346038704105], [67.021307498603164, -3.8507829652879622]], [[-80.47774249090331, -64.49244373998269], [-13.414465155552463, -28.648148016214364]], [[-39.709711031302874, -5.31689974420064], [-57.377517901382276, 94.506624151769302]], [[11.115875644871551, 72.592213743917142], [-32.851536402053583, 78.518378718942529]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereZero_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=whereZero(arg)  
       s=numpy.array([[[[-39.290159719357185, 6.4490380987615623, -32.475323811147817, 60.226470912331308], [-67.755482790982938, -39.36427904339579, 21.997707246133388, -57.33676285078031], [25.320831197285258, -76.349205569527896, -36.414788962722014, 32.291459935518731]], [[-65.904294197582345, -89.034718909868275, 23.261623493802404, -23.180947290729321], [-46.259617026665943, 99.549706170539366, 10.306727586246595, 87.039923782401161], [66.016848823361642, 28.256642649753928, 70.164371345513473, 67.371978520546691]]], [[[95.146996060217106, -97.305855490492306, -29.256335422763627, -24.209100707496575], [45.641162744683385, 63.645930271424191, -90.807337430480288, 24.138834899377557], [73.589873856883969, -56.963982942159276, -56.566510827885196, 19.815127048510604]], [[-6.0501958637814397, -64.804389079293671, -97.436129865062156, -75.007677448589078], [97.657879332162167, 76.181023957804541, 10.091188897304022, -50.857694189930648], [-21.917722344901122, -73.808061753514863, -65.869251863183962, 4.5616827304170613]]], [[[70.035781937760731, -51.832467945539221, 79.042746419994728, 38.668501922355972], [34.119830624253126, 24.299671216764267, -42.277730257287182, 92.671939181987852], [-72.79102447157895, 30.740060638932874, -74.191520466794174, -52.954497069438666]], [[24.430118839801438, -6.8193204451386151, 61.796792049679993, 64.743591095050022], [43.828951570456724, -52.733202497353915, 18.689222089808339, 53.094849161936565], [77.126411810233293, 46.773335174712628, 24.535808124902417, -51.550372123195707]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]], [[[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]], [[[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
875     def test_whereNonZero_float_rank0(self):     def test_whereNonZero_float_rank0(self):
876        arg=-56.0152542247        arg=-56.0152542247
877        res=whereNonZero(arg)        res=whereNonZero(arg)
# Line 1310  class Test_util_unary_no_tagged_data(Tes Line 1010  class Test_util_unary_no_tagged_data(Tes
1010        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
1011        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
1012     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_whereNonZero_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=whereNonZero(arg)  
       s=numpy.array(-63.9986107791)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(1.0)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereNonZero_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=whereNonZero(arg)  
       s=numpy.array([5.5359318226973215, -86.821749912549208])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([1.0, 1.0])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereNonZero_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=whereNonZero(arg)  
       s=numpy.array([[71.725472035318546, -58.612052886303289, 62.157756415813651, -47.063778001895315, 77.803560471030494], [92.195417194871851, 89.724837980402924, -10.413176528694962, -61.838646095919756, -37.956581923595522], [-21.02513441733258, 72.503213262682806, 16.360830438439564, 15.487516956343583, -71.733457944717614], [-35.521341182196721, 90.927740424160248, 21.718277340665054, -90.551829331778478, -79.822246461445403]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereNonZero_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=whereNonZero(arg)  
       s=numpy.array([[[-92.039200834931847, -62.745860821492137], [55.562355191956101, 36.13623050761575]], [[51.428582569678667, 6.7813551764689777], [34.834098385485248, -46.565103858624781]], [[-22.197926800436505, -23.75105117868452], [62.316617058759022, 39.650089801879489]], [[-17.301716595043743, -49.890756774157772], [65.113911490167396, 70.406681905728902]], [[67.970437340226084, 6.763877574674737], [-72.440603095681496, 83.905240789027999]], [[-9.4725564250577747, 6.7172370152905216], [10.657653776805361, 31.813356576401873]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_whereNonZero_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=whereNonZero(arg)  
       s=numpy.array([[[[95.390257385358666, 45.581102621197772, -34.472614399751976, -44.187969729817155], [62.619954103462845, -62.125630494937909, 62.664289458215393, 38.69703477202745], [18.292449005125235, -68.461908914622853, 86.000739545438819, -48.949946326838379]], [[20.120065500586364, 83.296762964032268, 90.39226764899351, 37.379442794888803], [-48.543736312915108, -57.067875736841486, -1.3972280138476236, -7.7638288295607651], [-29.177967514332664, -81.460379350377593, 10.435285429910195, 57.630275899938113]]], [[[-45.71961261819397, 22.373502185500541, 37.662223848476089, -2.2940311095793504], [59.235081702607431, -21.847349361693887, 68.766451889270002, -25.664076299853662], [-65.794252273908256, -93.497162167099475, -45.937528408479956, -4.9683114364239316]], [[38.415579583735934, 51.680222508550969, 45.533224435884534, -95.377478810488256], [-67.689600658634703, 38.481196742257595, -85.39114161427824, 34.228355824940252], [58.581033737968397, -23.491787526221358, 14.698443690426117, -54.750734727094994]]], [[[-67.627258717531191, 88.697079672890254, 53.870078458562432, 51.736240026571721], [-70.95614948743227, 11.195775524020291, 31.058839065828323, -15.23262569608319], [-56.668773707515705, -39.564235352463164, 61.035865972707171, -59.669324480633094]], [[-85.916017079613511, 28.542821077324334, -41.081637035461597, 0.56732809105591286], [-69.673695812034737, -96.079626480303531, 72.015551834181167, 38.954889388681607], [-81.08586516893655, -41.644221407464485, -85.347230876678211, -19.457969474192112]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]], [[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]]], [[[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]], [[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]]], [[[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]], [[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
1013     def test_sin_float_rank0(self):     def test_sin_float_rank0(self):
1014        arg=26.6185049196        arg=26.6185049196
1015        res=sin(arg)        res=sin(arg)
# Line 1498  class Test_util_unary_no_tagged_data(Tes Line 1148  class Test_util_unary_no_tagged_data(Tes
1148        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
1149        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
1150     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_sin_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=sin(arg)  
       s=numpy.array(-59.3916014281)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(-0.294238825658)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sin_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=sin(arg)  
       s=numpy.array([-77.518180416339703, -99.902097052938913])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([-0.85296306795174082, 0.58822958187337715])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sin_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=sin(arg)  
       s=numpy.array([[-68.776025628098921, 18.583534072810437, 2.5030615885359282, -81.568488722453594, -86.093220779774867], [-67.221717338138347, 7.8150319629840936, -38.212473776124511, -35.413212843434039, -29.084029341527298], [44.463615730285483, -35.607990030177803, 7.7479366716322886, -27.403061449775464, -36.661576208361481], [38.270555455018439, 43.395245412009388, -83.395946138420143, 82.237580019924621, 14.004270430298305]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[0.33255619605642595, -0.2628953097831197, 0.59601657099216188, 0.11268044966812327, 0.95516575752479826], [0.94843820301578952, 0.99924155745678056, -0.49110859112560667, 0.75502592312392947, 0.72407716039519021], [0.46294834755613434, 0.86765740613097231, 0.99438250025762476, -0.76514881632423337, 0.86115409814746968], [0.54084686431197915, -0.55390877782719994, -0.98968706359916092, 0.5279381946907461, 0.99118224805070021]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sin_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=sin(arg)  
       s=numpy.array([[[-37.699048834122337, 67.487864519915888], [2.9828406413621451, -24.732359622933814]], [[-61.929665641026645, -68.476378179772155], [-32.237324902859314, -7.6070318207624581]], [[60.977769128483089, -72.382514925143823], [-46.560105241719477, 45.937821630681839]], [[83.263439432502082, -92.94384685128874], [51.849927093272044, -78.761237021574999]], [[91.585054594657009, -36.002253133666869], [53.726162646665756, 51.861195467288468]], [[-47.206562095893624, -54.234991663118073], [24.635547568924366, 10.897512608905188]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[6.3008955140298549e-05, -0.99841120781631043], [0.15808603528894985, 0.38976979614921003]], [[0.78468476326272762, 0.5961202571458688], [-0.73209911016042217, -0.96966254162590804]], [[-0.96014169481053901, 0.1255516807235128], [-0.53438887581027339, 0.92690049281462372]], [[0.99993689802325469, 0.96460273897511306], [0.99990686327594558, 0.21961584215844765]], [[-0.46077448262053106, 0.99206465505959207], [-0.31370028629469887, 0.99968959551254188]], [[0.082578150729693003, 0.73652370204730333], [-0.47696085874176203, -0.99519580523955087]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sin_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=sin(arg)  
       s=numpy.array([[[[-15.890402342693434, 0.34967079278480639, -69.644962745437795, 42.940560221661485], [-87.145936678451136, 49.455183015727584, -55.024672865086053, -33.720006009004152], [-60.374597103391658, -10.062767069904965, -26.275100187070336, 73.475919773065471]], [[-21.069235104213391, -32.962767163632307, -83.961409610894236, 56.598525324661068], [10.664148354586175, -84.175124335735191, 70.938373649792197, -50.885634199045818], [-3.7753473336700836, -64.579189053025345, 39.526279799984962, -78.118476532600027]]], [[[-87.539170348669316, 53.990171737005767, 75.031120602988295, 89.786150540127636], [15.24565797164064, 47.14487621807001, -38.076038239089939, -71.863955067032919], [54.427160884365065, -51.643922687914447, 31.69388597837235, 63.197010162156403]], [[40.095787791911192, 68.569022656716015, 83.368763637032373, -64.130086266478315], [-56.640669699135394, 28.887347050286337, 42.538464681579825, -0.81329085125044287], [78.334444852851078, 53.976051151834668, -92.677265657880042, -67.717790405619212]]], [[[94.55646393436794, -74.072328469071493, 15.628014750861269, -19.08383918357049], [0.34503678387962111, 24.723546408702205, -72.452170470947522, -66.788152868232629], [61.510016195707891, 66.878349407366471, 84.66308347515232, -15.120176750922298]], [[-31.566786151962461, 45.449410239249346, -90.349459031765548, -27.203984637101513], [-39.051741216817845, -72.264868220520867, -67.902622230428847, -59.158845980218722], [0.52167726472671916, -10.820231066135364, 71.585444977834385, -19.920876608835187]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[0.18142870681923798, 0.3425885406050273, -0.50546808260791642, -0.86328219433933273], [0.73022937255072884, -0.72449360648452032, 0.99890501309408652, -0.74298095956355081], [0.63215918874375432, 0.59558130798366149, -0.90961605511692745, -0.93885469749753936]], [[-0.79675938208265107, -0.99971307596321124, -0.75888030600764067, 0.049836906821785487], [-0.94557931825783614, -0.60349520540713741, 0.96828115466442444, -0.58115865307416081], [0.5921744828383132, -0.98445730548018506, 0.96731639813302839, -0.40898344979772361]]], [[[0.41270698122918936, -0.55061151710067213, -0.35891304360076959, 0.9687241365310475], [0.44601259199410115, -0.020984873750761551, -0.36806437453098872, -0.3826620757098414], [-0.85215290965973867, -0.98155654013732874, 0.27439398566293094, 0.35709603191044931]], [[0.67791057877776606, -0.5192863947552645, 0.99321476652686747, -0.96308406338850749], [-0.091872199916891564, -0.57533459294226186, -0.99195091057653295, -0.72655228515132986], [0.20393085417395668, -0.53876969374246431, 0.99999996013162051, 0.98497824474943119]]], [[[0.30380541290205748, 0.97016130669394118, 0.079863375608460366, -0.23214588781170803], [0.33823129342514735, -0.39787075152274376, 0.19429572151212773, 0.72752470593055507], [-0.9691693331376533, -0.78636565705333028, 0.15923742302181473, -0.5545203884228973]], [[-0.15028804065876869, 0.9946297066698937, -0.68654604166089739, -0.87736813185980267], [-0.97629583471350656, 0.0082370948053343829, 0.93646621708071842, -0.50675322220049412], [0.4983350007448592, 0.98466672326147653, 0.62191520543510515, -0.87783383304733476]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
1151     def test_cos_float_rank0(self):     def test_cos_float_rank0(self):
1152        arg=12.8022737001        arg=12.8022737001
1153        res=cos(arg)        res=cos(arg)
# Line 1686  class Test_util_unary_no_tagged_data(Tes Line 1286  class Test_util_unary_no_tagged_data(Tes
1286        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
1287        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
1288     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_cos_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=cos(arg)  
       s=numpy.array(90.5372724402)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(-0.842486242114)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_cos_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=cos(arg)  
       s=numpy.array([-9.0536838172296825, 33.816188000375888])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([-0.93193112842841397, -0.73757029996164303])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_cos_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=cos(arg)  
       s=numpy.array([[-31.546701209629163, 39.362102781082996, -15.354595714411218, 38.340687603236177, -98.010951194079894], [82.222812801466517, -86.454712307597589, 32.12633138537268, -45.272841747188863, -11.684078726050444], [31.575597388189834, -26.847774004442044, -98.273037827965055, 89.120378763437628, 97.882547727500537], [89.465688335120035, -64.006390385826847, -38.163447134657758, -4.2672402307320567, 57.401582191500665]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[0.99146117203213002, -0.09206406003479313, -0.93821266187128138, 0.80115372568056786, -0.81296002706195136], [0.85698608818153499, 0.060876669858104665, 0.75809791928896697, 0.27659756615947145, 0.63538302492165299], [0.98727966912002574, -0.14373684936927411, -0.63432167527334105, 0.40320078717966623, -0.88083395597723491], [0.069645865517830363, 0.38596994797460843, 0.89411943853466547, -0.43059213856110001, 0.65779079426598108]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_cos_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=cos(arg)  
       s=numpy.array([[[98.415735048260814, 18.353441772747985], [64.296879506748496, -64.860098440847054]], [[17.35608520540994, -89.14646486132132], [61.865142970991087, 38.297409700741156]], [[-78.471447880825764, 57.222085234102735], [0.32968192830907128, 74.226443876271787]], [[-0.38397537075613286, 58.602106009712742], [23.192943302380669, 0.68715909226719418]], [[-92.072938356064185, 35.440518792877072], [59.879924556501493, 52.598144407817671]], [[-35.629803721051061, 46.196948046672787], [67.640487098408386, -4.6625958646272068]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[-0.51793361179511976, 0.87943890784122258], [0.10557278940314231, -0.44166087291734224]], [[0.077248575506542849, 0.37919462717930402], [0.56801025787030479, 0.82629552068703671]], [[-0.99766378712807424, 0.78169489218908095], [0.94614536458526166, 0.38851230621344895]], [[0.92718275497354863, -0.46412092938877864], [-0.36068441584172917, 0.7730512437004543]], [[-0.56797626564805737, -0.63483637029213524], [-0.98206761019991662, -0.69027251657089972]], [[-0.47811898562840421, -0.60028273117574626], [0.096096526974265448, -0.049772542511485468]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_cos_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=cos(arg)  
       s=numpy.array([[[[16.258135163552993, 15.28795554174549, -94.213688905893875, 46.356827904566046], [-76.421091337085926, -96.73578139337539, 98.607773749470709, -26.465596266125104], [-23.819875840836374, 88.934604781545971, 47.008869322192538, -63.138511278265064]], [[-57.345246171878792, -31.016029369262526, -27.289495698953118, 14.57795465971104], [-76.388023081850889, -76.260107518040826, -67.526942195979728, -93.208216834068566], [-16.932368804835079, 85.983907640874776, 13.212716020558531, 90.008467269621178]]], [[[-37.190307254880864, -9.3719120597399268, 9.0900051869366507, 10.218099661484786], [70.827938522323109, 89.518790441090715, -69.705846401392819, -57.441491836060351], [72.199272398296955, -10.959052745367103, -31.599699972928178, 90.503466756844603]], [[-55.525330095655903, -46.745015170019521, 93.127651949568985, -0.93686214949428859], [-76.851198061517863, -31.938017144280366, 95.858909029516894, 8.5021405669813959], [-82.790706004100628, -37.008741984125315, 6.8136753973643778, 82.835139444407872]]], [[[-34.36396299168949, 11.463492576302187, 74.516393904678267, -43.676292532631564], [-3.3910779812215424, -0.91961355298171554, -30.52225518412142, -70.996806226457068], [97.235082778671426, 3.7339268998754847, -43.657157539930182, 81.750323543564207]], [[-1.9063147209028841, -31.429979720261485, -0.24837601655227104, 74.003581288980598], [17.951032060450828, -70.837336538491314, -61.497795043717709, -59.520420163891963], [12.802025428846008, -48.059275938708332, 79.585948529704211, -62.222461455625798]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[-0.85243466182777494, -0.91308578984482514, 0.99941896830041999, -0.71995288345683728], [0.52092025431031475, -0.79390552629740696, -0.34514646804269983, 0.23570242031707533], [0.25508048313762305, 0.56529088547594442, -0.99339243390384169, 0.95334769333842229]], [[0.69915712667656416, 0.92110103433121626, -0.55299794450361739, -0.42665202251903944], [0.54885755994993757, 0.65100866333200857, -0.017298993282424503, 0.50659727470834859], [-0.33950518798245011, -0.39850874755575721, 0.79829018784848715, -0.45562717432367311]]], [[[0.87332745676984158, -0.99860292367912729, -0.94448499020961796, -0.70148185601427704], [-0.14162603709925609, 0.01659942382057265, 0.830490855709755, 0.62721501346028741], [-0.9983554444956908, -0.036513423859513297, 0.98316113318766807, -0.82379662437272649]], [[0.52051898688181408, -0.92908146878426567, 0.43556753759236322, 0.59231911391125125], [0.11754953962006644, 0.86677850218970165, -0.040322160549731555, -0.60371973731102746], [0.44529107334829016, 0.77101053327567159, 0.86255920997795166, 0.40507958525462973]]], [[[-0.98132640747364697, 0.45102931767716775, 0.63573979463885, 0.9535447914637144], [-0.96903962536018473, 0.60612756927263178, 0.62655488737973841, -0.30598370409654269], [-0.98812097111852326, -0.82963973285369441, 0.94760613837562691, 0.99762633202811923]], [[-0.32925870241654032, 0.99990125562973986, 0.96931292380191525, 0.17524432654557021], [0.62276558994329589, -0.15092293214482808, 0.23453315330390737, -0.98561178048442499], [0.97236166388514689, -0.59350769835904615, -0.50092234597249297, 0.81999638943488118]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
1289     def test_tan_float_rank0(self):     def test_tan_float_rank0(self):
1290        arg=-73.1683491266        arg=-73.1683491266
1291        res=tan(arg)        res=tan(arg)
# Line 1874  class Test_util_unary_no_tagged_data(Tes Line 1424  class Test_util_unary_no_tagged_data(Tes
1424        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
1425        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
1426     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_tan_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=tan(arg)  
       s=numpy.array(76.901206036)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(14.7236110177)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_tan_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=tan(arg)  
       s=numpy.array([-28.981292502841427, 10.324911643207258])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([-0.85425411866227274, 1.2605042458245661])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_tan_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=tan(arg)  
       s=numpy.array([[-19.404743015015896, -35.786461530181683, 41.630712883296695, -53.393414394530801, 27.522080297961352], [34.7032762471772, -55.423195564438977, 30.146623488167421, -29.189310507432879, 81.963359921572049], [46.334435778929532, -13.863731807394132, 33.25384940968226, -14.643767992937313, -48.858570898414769], [-45.705933135396194, -84.273877157806879, 83.979116998420125, -61.73781306832462, -87.886573362693127]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[-0.62026495872200171, -2.8103763926562433, 1.0092632175922063, 0.013661566324787953, -0.93581473007329996], [0.14679811425460448, 2.095113684817405, -3.2157114383758643, -1.2996662909219234, 0.28966775965223535], [-1.0081448018891541, -3.5655718931758891, -3.6540754018028658, 1.8021110895372887, 6.0471220297596346], [6.4917784009171147, 0.61190124557224967, -1.1243899668081254, 1.936127346488371, 0.078179635666635147]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_tan_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=tan(arg)  
       s=numpy.array([[[91.817190934617742, 15.614105025460773], [-8.6579188485640373, 38.359114999901777]], [[87.601347949030128, -95.082696235114383], [-48.203238716263371, -49.318093466315304]], [[98.208161457868613, 44.299392496071619], [9.9710738702016783, -55.649346110277989]], [[-64.609266278553804, -48.707446735886919], [-50.420195216630567, 63.203970865164706]], [[-47.833133268715898, -60.496230273391994], [-34.79958875712245, -76.120082515066727]], [[-14.471487953619743, -54.3824585375976], [47.143948606537776, -27.406206114855451]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[0.86127588436873992, -0.09413482779794792], [0.96359268360127226, 0.77610997115816349]], [[-0.38011369074815543, -1.1042862776434417], [-1.8682900628414005, 1.3906938762579171]], [[1.0691155965292949, 0.328168855953204], [0.60802028707254852, 1.2584041589774406]], [[4.7708065132497692, 78.36193523115594], [-0.15595909699802948, 0.39030155784637111]], [[-0.85821406444112835, -1.0420136012415273], [-0.24691132364022755, -0.88036200363138839]], [[2.8788574889730514, -1.4761808601505129], [0.020061493380890229, 1.1808321154069699]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_tan_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=tan(arg)  
       s=numpy.array([[[[7.8016711509297636, 75.814640162646327, 71.493020768524019, -54.34457743372807], [21.640724872264357, 53.823179640032151, 50.289580867636829, -43.242502602391376], [56.997102751455117, -15.263416573159731, 58.488207735679566, 52.397618683398804]], [[57.837644384694272, -6.4577719796608193, -41.528574439206054, 53.764517895838992], [-95.029235569231957, -47.910043474037487, -53.096809277571765, 20.176361979323289], [86.783462538455524, 25.724756653427463, -42.201874062735811, 68.373362219080292]]], [[[9.3302871204751909, -26.307564690622726, 30.588540007841601, 91.906520407678869], [-4.3192400504299115, 16.857887111020474, -32.158331304287955, 70.872778835241462], [92.128936767419788, 42.757632170118228, -66.755756597450443, -75.062818841410419]], [[65.537466444545714, -60.822082021700766, -98.934305558787813, -74.932770393860906], [17.599348851982469, -33.909422677866104, 6.0567598474035265, 74.163371763944042], [49.008182707739479, 74.46239496364754, 79.675432271948921, -30.597423762244077]]], [[[-87.175355731177547, -83.139755241777436, 7.0569006911391057, 95.189351708783079], [-16.030569585010099, -17.121051006243704, 56.212615235746796, 90.0094723556372], [22.834812928524386, -12.00697491326676, -85.165990488480332, -61.342992060435279]], [[74.559833326481964, -89.793374516715275, 27.893327547626185, 3.0879188347954027], [0.83158419180155363, 82.780896420808631, 62.879941928760076, -60.412649988633113], [-84.85538664828762, -32.2434200227584, 35.367873835963195, 81.504808941994554]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[19.099187132871801, 0.4422812203464852, -0.95734677588774086, -1.3620786082678416], [-0.36550872862602007, 0.44190830341654258, 0.024103076201043745, 0.91271285967659588], [0.4811263253758829, 0.47634687871210146, -2.5878677786891062, -1.5902860921141508]], [[3.4539268069571256, -0.17638239958323781, -0.82176137495092627, 0.3734861336000459], [-0.99214651561856182, -1.0015121563183582, 0.32062064059497536, 4.0168693999364047], [-2.4350875264582088, 0.67247854310960065, -4.7003021546456383, -0.91616787638009411]]], [[[-0.094773069376604804, -2.3920339919024842, -1.0877111277661886, 1.0303257592531898], [-2.4111451385320661, 2.2340406197176175, -0.91750894774755054, -5.2867313961653304], [1.6382146274220839, -2.7727673850601917, -0.99384440190222534, 0.34857508605978282]], [[-0.46587793240826658, -2.1297956329577099, -38.656609532941168, 0.50225914622326306], [-3.011653576615283, 0.75720520073839193, -0.23037599177432508, -2.8638498397556482], [-3.0846374826442631, -1.3573109115697382, 2.1509723823946283, 1.0685019777360434]]], [[[1.007710461085487, -8.8553200704243249, 0.97690322483875058, 1.3737637153641578], [-0.33428445228119535, -6.2881518594611618, -0.34930163091020777, -1.9488940400689172], [1.1238912865063808, 0.62610802567615476, -0.35710328187812179, 12.177425495751551]], [[-1.1120257661478874, 3.7898324122948481, -0.40058006683257519, -0.053725420848234201], [1.0969172001177299, 1.9622709171371857, 0.048125960391491744, -0.88130453007415765], [-0.032396327785152702, -1.0879446583589947, 1.0512014034111461, -0.17845915648381705]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
1427     def test_asin_float_rank0(self):     def test_asin_float_rank0(self):
1428        arg=0.921542730641        arg=0.921542730641
1429        res=asin(arg)        res=asin(arg)
# Line 2062  class Test_util_unary_no_tagged_data(Tes Line 1562  class Test_util_unary_no_tagged_data(Tes
1562        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
1563        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
1564     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_asin_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=asin(arg)  
       s=numpy.array(0.709086940242)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(0.788202466921)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_asin_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=asin(arg)  
       s=numpy.array([0.39306604978321502, -0.33496719880440817])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([0.40396366370674291, -0.34157041757629797])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_asin_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=asin(arg)  
       s=numpy.array([[0.95742212430908458, -0.38637818768634136, -0.77553638139378411, 0.82196172884725405, -0.19549755280152292], [0.21449415119821147, -0.41069701814542448, 0.0054292228188206337, 0.62604501761763709, 0.81728606128555636], [-0.63396598715267871, -0.42411429942805268, -0.98781811185792878, 0.47732128773258342, -0.49786758945025977], [-0.75619735814093803, 0.27656444042190498, -0.15119271665900968, 0.08089445460057787, -0.61698612379478557]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[1.2779362923928173, -0.39670158457940491, -0.88756429408275406, 0.96484689964033976, -0.19676476691694003], [0.21617389751458591, -0.42321839618677359, 0.0054292494915530185, 0.67647094545700004, 0.95668536338182597], [-0.68667074823961638, -0.43798364448526955, -1.4145484348414663, 0.49760378500881658, -0.52113822523297126], [-0.85748205125274013, 0.28021725945594256, -0.15177474896959037, 0.080982943135893076, -0.66490722490712573]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_asin_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=asin(arg)  
       s=numpy.array([[[-0.41406737888846745, 0.29854848407882262], [0.94437528704875406, -0.38737628286519499]], [[-0.11688674953071876, 0.92567142822417492], [-0.669005191146963, -0.62722771078196016]], [[0.442299563031475, -0.0086510406251611993], [-0.25970665406312321, 0.052035429527437893]], [[0.87803328946186943, -0.18390390163822978], [0.53564205702079337, 0.6636046325536642]], [[0.21952772705648949, -0.71153488592508041], [-0.12602821539091591, 0.013021167432865077]], [[-0.5104818028230903, -0.51067286712061621], [0.094489538976344267, -0.77487855265081984]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[-0.42691798278875814, 0.30317141518418095], [1.235689816725577, -0.39778396333541505]], [[-0.11715456046404034, 1.1828064814989165], [-0.73286953584310599, -0.67798855819190351]], [[0.45816105171176424, -0.008651148536835452], [-0.26271842150096258, 0.052058940786247683]], [[1.071737278210569, -0.18495662819762185], [0.56526789400762645, 0.72562701488119208]], [[0.22133036260920735, -0.79168022256246928], [-0.12636424272093699, 0.013021535419171053]], [[-0.53574500559622018, -0.53596721683624227], [0.094630711640635232, -0.88652294232300843]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_asin_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=asin(arg)  
       s=numpy.array([[[[0.8939615106790697, 0.7902160288817166, 0.89065986743957559, 0.60007618223545522], [-0.81101254041397575, -0.6137377570227569, -0.052523173548933766, 0.55417720154160244], [-0.5929683620091043, 0.48281225006642492, 0.18542383129531559, -0.30359227617070539]], [[0.49659335066805754, -0.17531696170844147, 0.6878178852081327, -0.33888268647376574], [0.30236863041004125, 0.64029945067905292, -0.057677047939666437, 0.73584079306886885], [0.069144657277393717, 0.65393212451298144, -0.21285495393434473, -0.15653853308377552]]], [[[-0.62048942331744406, -0.54398350330669687, 0.059588783219042263, 0.9176227342537957], [-0.46919397679966046, -0.074183319572817874, -0.64625750429815154, 0.31525539964650262], [0.59532968249037532, -0.96305612708729815, 0.17788509575754174, -0.37390717059779099]], [[0.1950429909045972, 0.24860187055715355, 0.69998183176291628, 0.74780575680963035], [0.53926837787061843, -0.37794787868723567, -0.39223330759477837, 0.50866422739441441], [-0.7226051619662226, -0.43213480116455127, 0.30513308130230121, -0.17051160234662421]]], [[[-0.055600675978335734, 0.60205841858076781, 0.24200770257391602, 0.016294552112390503], [0.97168956624592084, -0.60390761768382584, -0.36625445464242745, 0.51211196511527168], [0.39430270172866377, 0.071942942033692781, 0.38849981530344491, 0.17017453188962661]], [[0.41329087227981542, -0.6446193820579651, 0.2331904589535938, 0.63571098755259348], [0.081886342533527445, 0.12809541884461417, 0.39179515258197894, 0.42322825410526566], [0.066840704463497769, -0.28898175779264879, -0.159002922272659, -0.65902439254253031]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[1.1061085067921341, 0.91116142855536453, 1.0987944228776061, 0.6435963399886151], [-0.94588079788092116, -0.66078620342979533, -0.052547352714825003, 0.58737417376465983], [-0.63474023141510105, 0.50386322339355394, 0.18650315560561173, -0.30846062403685665]], [[0.51966956243801143, -0.17622770696662088, 0.75847860342686124, -0.34572905861596159], [0.30717662611802016, 0.69488804840202401, -0.057709074386432226, 0.82690750079981068], [0.069199872732051124, 0.71277025709673414, -0.21449594761168528, -0.15718499882367654]]], [[[-0.66936664266593959, -0.57517721940899236, 0.059624104558304095, 1.1620573126403937], [-0.48837783125097373, -0.074251529130771363, -0.70266998313125895, 0.32072576509930295], [0.63767590380579697, -1.2981294389943736, 0.17883685098683139, -0.38321819847795613]], [[0.19630128269813654, 0.25123654184406197, 0.77537205630739592, 0.84475090497274785], [0.56956809582887336, -0.38757876280444198, -0.40305820215038651, 0.53363259485313208], [-0.80756364284298932, -0.4468586810949044, 0.3100781719697514, -0.17134885159815402]]], [[[-0.055629363552406427, 0.64607662234147822, 0.24443453009143673, 0.016295273266241615], [1.3322799475237728, -0.64839463036814571, -0.37498057579100019, 0.53764185795878738], [0.40530895378828624, 0.072005147248227028, 0.39900296114416212, 0.1710067817259158]], [[0.42606507500716639, -0.70052531585409294, 0.23535730919053602, 0.68892922634499498], [0.081978132853572916, 0.12844833858054885, 0.40258192554863642, 0.43700547080687641], [0.066890575268981525, -0.29316304468302384, -0.15968064474311028, -0.71952088186281848]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
1565     def test_acos_float_rank0(self):     def test_acos_float_rank0(self):
1566        arg=0.985740349094        arg=0.985740349094
1567        res=acos(arg)        res=acos(arg)
# Line 2250  class Test_util_unary_no_tagged_data(Tes Line 1700  class Test_util_unary_no_tagged_data(Tes
1700        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
1701        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
1702     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_acos_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=acos(arg)  
       s=numpy.array(-0.448504170599)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(2.03588736399)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_acos_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=acos(arg)  
       s=numpy.array([0.10761548080402439, -0.09013197683741081])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([1.4629720384927407, 1.6610507872161167])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_acos_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=acos(arg)  
       s=numpy.array([[0.24553555987759834, 0.05073125195074657, -0.3475575180079179, -0.26338664964359593, 0.58239054316714944], [0.54848986293192459, -0.67138532331014544, -0.9263016975972771, -0.86224713885838578, 0.94352198155136957], [0.35698681572104363, 0.31652495823586246, 0.012423004188061526, -0.7991539540157484, 0.74063362280966327], [-0.35395174931061513, -0.81481711731918505, -0.70449375202234821, -0.37782853414094786, -0.4654098770625188]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[1.3227242004907347, 1.5200432887715554, 1.9257612954531445, 1.8373274640461266, 0.94912999699680667], [0.99023920543007182, 2.3068727938390223, 2.7552721500294419, 2.6104860924965987, 0.33769157906650948], [1.2057561591707979, 1.2487324879302713, 1.5583730030421294, 2.4966827907485496, 0.73678343927827372], [1.9325893483758392, 2.5232099834583006, 2.3525059033738249, 1.9582461870906951, 2.0548939697307222]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_acos_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=acos(arg)  
       s=numpy.array([[[-0.2510461443376264, 0.54184675135283245], [-0.16131935190860813, 0.6716240350424838]], [[0.24251778985848249, -0.036894206083290637], [0.95027761556050705, -0.56886119626604126]], [[0.53689898442985995, -0.63802508188184359], [-0.47346940465416576, 0.17899495622371719]], [[-0.27732773885834794, -0.23366649456706601], [0.081587430559938001, 0.51560118100528074]], [[-0.47130671327922224, 0.45018873939761495], [0.15104915118447493, -0.31245718121717747]], [[0.51636416063586221, -0.79897444583502586], [0.28820031786245703, 0.59906646355338888]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[1.8245571861233467, 0.99816350471514881], [1.7328236958880237, 0.83439771179577593]], [[1.3258360477063191, 1.6076989079668045], [0.31667014209642735, 2.1759168421565027]], [[1.0040392634526714, 2.2627270817057834], [2.0640218324043902, 1.3908315123549062]], [[1.8518079561261904, 1.8066431962076759], [1.4891181094505535, 1.0290871905451719]], [[2.0615681050770043, 1.1038196289402122], [1.4191668112650326, 1.8885749547518011]], [[1.0281964824492924, 2.4963842303068096], [1.2784494479170232, 0.92846162863176096]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_acos_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=acos(arg)  
       s=numpy.array([[[[0.85673336347254181, 0.56000340591667874, 0.88410214446252722, 0.49210454831328554], [-0.76838470912753687, 0.41676041613507153, -0.848233666525393, -0.49740568213093433], [-0.89353555507372917, 0.93007183519229208, -0.61429417809964648, -0.20732909490012164]], [[0.055877519450951318, 0.39978577312241192, -0.73210537601237957, 0.17275674665119434], [0.24346769212211528, -0.4091178773571823, -0.72900463900016454, -0.036866450504443926], [-0.87198067420994074, -0.46367433378291556, 0.11649068759805736, 0.91696237720604112]]], [[[0.46751160024601179, 0.31977309058354009, 0.30605713818168123, -0.054295254135486526], [-0.18652749346895736, -0.92490860701200772, 0.16389155247551779, -0.93150919590987857], [-0.31346435454820309, 0.2058713777648935, 0.25189187329898988, -0.3645819802201109]], [[0.04469309592806936, -0.94767125459556567, 0.22436350374443825, 0.9281243201569509], [0.14133394729789983, -0.35494008788516429, -0.1564093012489115, -0.60390635550933158], [-0.36059430583018015, -0.301536447349814, -0.32107326748843146, 0.25736345894470403]]], [[[0.83885092236145598, -0.58878869872203921, -0.080072167759693613, -0.10435103201107254], [-0.24963626735103606, -0.025638506072502287, 0.73099395746164708, -0.40667625731691204], [-0.44874744794694554, -0.11437349048729084, 0.26614389543631134, 0.43462942107388747]], [[-0.65688934523701403, 0.63382457179064722, 0.8058014003488676, 0.63579707441027988], [0.91355922166794956, 0.90288888398149414, 0.1056938214164298, 0.39248381642477725], [0.82486896991976266, -0.68071552274763059, 0.16282878910133602, 0.64817065237029481]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[0.54189401261055425, 0.97640641580795273, 0.48622721652486128, 1.0562906898325788], [2.4471097015971282, 1.1409177650565701, 2.5834375772546272, 2.0914020237840441], [2.6759552440387382, 0.37618799571210804, 2.2322874911001951, 1.7796402632397741]], [[1.5148896887091317, 1.1595132094947773, 2.3922038920829447, 1.3971685122693243], [1.324856795350484, 1.9922834499286666, 2.3876630246309007, 1.6076711334926845], [2.6300301710833485, 2.0529341235764926, 1.4540405525596027, 0.41039731440246602]]], [[[1.0843226244754312, 1.24530633289288, 1.2597476714854894, 1.625118293220341], [1.7584227406066171, 2.7515914624839333, 1.4061620616128814, 2.769336726674295], [1.8896353984148535, 1.3634422507194941, 1.3161616589424892, 1.9439801721547425]], [[1.5260883386027515, 2.816656949157061, 1.3445064876980817, 0.38145404189120263], [1.4289875679965409, 1.9336463085533926, 1.7278504820646436, 2.2191893736150896], [1.9397013148916735, 1.8771000240836089, 1.8976588658632774, 1.3105035691299793]]], [[[0.57562742382234688, 2.2003557451958669, 1.6509543068499304, 1.6753376749887474], [1.8231009386805774, 1.5964376425379032, 0.75101891464828163, 1.9896092478037366], [2.0361595716582204, 1.6854206555874278, 1.3014059029241187, 1.121169566652275]], [[2.2874820267443754, 0.88430842302031054, 0.63376880998079743, 0.88175557333191668], [0.4188451790515117, 0.44435322965640228, 1.4649047219735551, 1.1674657768865635], [0.60082594482208518, 2.3195352777706648, 1.4072392960741715, 0.8656166639550098]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
1703     def test_atan_float_rank0(self):     def test_atan_float_rank0(self):
1704        arg=44.9393163302        arg=44.9393163302
1705        res=atan(arg)        res=atan(arg)
# Line 2438  class Test_util_unary_no_tagged_data(Tes Line 1838  class Test_util_unary_no_tagged_data(Tes
1838        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
1839        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
1840     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_atan_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=atan(arg)  
       s=numpy.array(-6.89397046137)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(-1.4267467321)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_atan_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=atan(arg)  
       s=numpy.array([-97.649124464119424, 79.356732822052976])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([-1.5605559375435585, 1.5581956684972298])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_atan_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=atan(arg)  
       s=numpy.array([[-73.766643115003291, 11.452876643164984, 95.174870645910886, 34.220985614322416, -88.159392421471779], [84.68427240945141, 26.350392881866782, 68.011682141082275, -78.094922944868443, 37.756608336055933], [-47.623645284004624, 38.900381918905083, 21.113635770372824, -75.501086458261796, -1.8495810038157998], [-67.008068783443463, -20.42245943586525, 43.633678041290381, -0.52929939317871799, 75.776666403245144]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[-1.55724089432423, 1.4837028978006839, 1.5602897382720149, 1.5415828050552596, -1.5594537223681344], [1.5589883074935884, 1.5328644314752027, 1.556094029851621, -1.5579920968621279, 1.5443170873603305], [-1.549801439459243, 1.5450952986805977, 1.5234689374200048, -1.5575522586923478, -1.075149894771056], [-1.5558738586449132, -1.5218697057048141, 1.5478822608573877, -0.48681145645890417, 1.5576004183076493]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_atan_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=atan(arg)  
       s=numpy.array([[[-22.81677385804602, -85.269467961898044], [69.319770330733803, -80.556767705276542]], [[-3.0368221761434455, 59.727259783359216], [82.457295484464339, 37.897691678928766]], [[-72.053770050708962, 22.856414465966225], [-24.650459564555277, -56.890165802868765]], [[-27.797851549128325, 53.86129286815509], [97.240823187943874, 30.366498923838407]], [[94.045818561415103, 62.257287089882112], [74.365122972876947, 71.038542877460912]], [[40.842863461050428, -94.331098431577814], [-40.118335685044485, 50.624010212835572]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[-1.526996950833944, -1.5590693372555069], [1.5563714284572887, -1.558383358060436]], [[-1.2526877421567553, 1.5540551171833814], [1.5586694316170295, 1.5444156169329673]], [[-1.5569186934353076, 1.5270728166262735], [-1.5302513636212665, -1.5532204063739365]], [[-1.5348378299097523, 1.5522322510153124], [1.5605129425367421, 1.5378771959675359]], [[1.5601636125483593, 1.5547353312059855], [1.557349973300699, 1.5567203911881551]], [[1.5463171359717789, -1.5601957660143135], [-1.5458752288983242, 1.5510454228329484]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_atan_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=atan(arg)  
       s=numpy.array([[[[5.8093227421107514, -80.81956190306741, -52.679070696679005, 24.490249426630115], [-73.873242079157905, -62.966168664638374, -22.819449723412006, 42.260239673910888], [-88.399505002565661, -54.328580254660316, -38.479013003659816, 1.7342617708681303]], [[91.276812837720144, 70.215338282937125, 96.855833036023768, 34.789970769268791], [-75.940724789579235, 96.428398477795781, 94.07867727412841, 45.369219588354667], [57.150057495280095, -48.137146293699558, 25.013272559688701, -21.357700938252819]]], [[[-46.242546734110789, -23.975222793478721, 45.307498191036188, -92.882071481416943], [52.599766866080131, 77.659342145285223, -34.580128051376334, 88.544192521016583], [75.485833343715797, -92.394979588288635, 15.456217174606365, -6.8399722014421656]], [[-12.643654749843108, 81.952584207276061, -86.507752638223096, -74.560010674603603], [-27.447182183000947, 59.245338951544483, -42.066723202834844, -6.0158483167039662], [30.970168910320382, -11.526148476456683, -42.098142359847479, -13.091831653516664]]], [[[97.264945936769379, 34.611625852007535, -27.393852557141287, -71.082944447248451], [-33.290776278808693, -4.5450544718790269, -59.899340368405873, 93.921434732310672], [-56.95580827292801, -81.628052374606682, 93.405528394593915, -0.062770439822884327]], [[33.035206410992686, 16.836560533699839, -10.268887700107172, 15.03516618049035], [-47.639678362483131, 11.478963494713753, 92.996743581526289, 31.80069005058931], [-83.325855117122629, 44.897788753063679, 94.976754283575559, 43.962649008834603]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[1.4003298281392591, -1.5584237161450916, -1.5518157355225508, 1.529986420311209], [-1.5572604523996185, -1.5549161174786359, -1.5270020802926734, 1.5471378377269045], [-1.5594845287554298, -1.5523918869041275, -1.5448139825395371, 1.0477497632910671]], [[1.5598410801908293, 1.5565553871072986, 1.560472070234278, 1.5420603229954633], [-1.5576289227624356, 1.5604263095616353, 1.5601673259401163, 1.5487585197636751], [1.55330031708021, -1.5500253367901893, 1.5308388306112815, -1.5240089777709662]]], [[[-1.5491745902645009, -1.5291107619630337, 1.5487285078884088, -1.5600304023413447], [1.5517871256755285, 1.5579202875749172, -1.5418860410536424, 1.5595030114663864], [1.5575495828305372, -1.559973650490295, 1.5061874922067406, -1.4256253797218696]], [[-1.4918695703110649, 1.5585947545924028, -1.5592371840454824, -1.5573851156549603], [-1.5343788222208075, 1.5539189645004208, -1.5470290441968728, -1.4060748842456476], [1.5385184050730751, -1.4842537824850821, -1.5470467757895516, -1.4945608547093536]]], [[[1.5605154927465004, 1.5419123357963993, -1.5343079884384574, -1.5567291824835703], [-1.5407670061549639, -1.3542275506371821, -1.554103202875182, 1.5601495322924479], [-1.553240658736063, -1.5585462491690907, 1.5600907313806081, -0.062688192981768726]], [[1.5405348319449752, 1.5114714678750041, -1.4737208849271914, 1.5043834032496848], [-1.5498085031891116, 1.4838998285162699, 1.560043676526051, 1.5393608271303461], [-1.55879582594043, 1.5485271968981389, 1.5602678237156173, 1.5480536666716644]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
1841     def test_sinh_float_rank0(self):     def test_sinh_float_rank0(self):
1842        arg=4.62054860905        arg=4.62054860905
1843        res=sinh(arg)        res=sinh(arg)
# Line 2626  class Test_util_unary_no_tagged_data(Tes Line 1976  class Test_util_unary_no_tagged_data(Tes
1976        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
1977        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
1978     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_sinh_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=sinh(arg)  
       s=numpy.array(-1.20953474482)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(-1.5267943699)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sinh_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=sinh(arg)  
       s=numpy.array([3.6884232722575732, -4.9495843670283772])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([19.978372740001152, -70.554606395208282])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sinh_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=sinh(arg)  
       s=numpy.array([[4.191831493505779, -1.49357194157158, -0.15022503549501209, 0.04360379956719207, -2.6574715014512962], [2.865101969962554, -4.9960329693677554, -2.2284276218586028, -3.754875260478705, 0.13130373432471831], [4.3192311445284766, 2.8156266995869199, -1.6289603323782531, 3.8568000787429533, 0.52350428265260707], [-0.5482811553522291, 4.7652578607417144, -4.8098454935805659, -3.5831699782791526, 1.6158771465685202]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[33.064351751682885, -2.1142019155001668, -0.15079070886060031, 0.043617618135176853, -7.0950306523517455], [8.7469327256318543, -73.909400547659871, -4.5887785126021425, -21.352743063567669, 0.13168135377145046], [37.558765604181303, 8.3218867386426538, -2.4512188805065982, 23.646286605117901, 0.54774573185599928], [-0.57616701693605721, 58.676427793533207, -61.35225352033158, -17.979826076242382, 2.416791881102847]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sinh_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=sinh(arg)  
       s=numpy.array([[[1.2803992817107277, -4.9781943952545724], [4.0430125780936237, -1.692964899474779]], [[-4.4774993564471615, 4.0407416189667416], [-3.2462860929291648, -0.68355835153015398]], [[1.6147737401776538, -4.7056999554611023], [1.6983678098444521, 4.4454363927583334]], [[-2.1283797112252021, 3.7767137370310735], [3.3517086245389134, -1.431020296167802]], [[-0.40272407266749255, 4.3268269099285561], [-4.2041317560973823, 3.8526522172816797]], [[-3.8326755560210968, -0.66961882075214341], [2.1469985730941419, 3.749545697148962]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[1.6600748886821148, -72.602531464947148], [28.49012509449927, -2.6257997560673703]], [[-44.001471533180172, 28.425458751770336], [-12.827908078247775, -0.7380482599146152]], [[2.413907383314196, -55.283306159258757], [2.6410191071820406, 42.612667287858002]], [[-4.1411066682510107, 21.824694610627258], [14.258225641858244, -1.9719499988355018]], [[-0.41369877315421338, 37.845240515157677], [-33.473749474399781, 23.548320550058754]], [[-23.082147273272071, -0.72079444011090799], [4.2211479502514857, 21.239120253070126]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sinh_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=sinh(arg)  
       s=numpy.array([[[[-0.67923389312987936, 2.6221251117580548, 4.215238996559723, -2.2058499756831598], [-1.5833386724758283, 2.0414090250817978, 3.6791780711248219, 2.3369919072383123], [3.0603754296824111, -0.47497713985279244, 1.4550268267914346, 1.622588658270705]], [[-1.1282417577199375, -0.27050606856896664, -2.6289426837025456, 0.2336154051563879], [-2.5277568263064811, -1.3057848074752041, 2.288851854813494, 2.0420322364311358], [4.4171039885931567, 4.6938583683990789, 1.8966685451765217, -2.5544494982982178]]], [[[-3.4382424138823131, 2.5346312823383412, -4.3193543444132256, 3.5683066837102277], [4.7931765620645219, 0.077838313885459698, -1.4646257872928423, -0.32332876804983712], [2.7332247116384867, 3.510693236906393, -1.4239524265664363, -0.48946281978122474]], [[2.4400546932701008, 0.33867258510646536, -3.2859240033094195, 3.3587013078892056], [-2.118120644566762, 1.2641744269814028, -1.4221823205996853, 3.720158843994108], [-4.3272498662727337, -1.0540150191094275, -3.2067474579661503, -4.6941858210250453]]], [[[3.111402797651925, -2.5722680653310026, 3.5445809480189716, -1.2653312871854281], [1.2696507089740283, 3.5334077089029812, 3.7554028500817687, -4.3075529590123462], [-3.1172666773677871, -4.3600215601320924, 0.33014712080002706, -4.732792835887639]], [[0.74818418199347114, -1.3429492507515994, -4.5282277785227301, -4.9094060909773223], [-4.0473716474049173, -3.9754814519025752, -0.31159288140037678, -0.54866450785699961], [-2.2800126890854964, 0.74608705829244393, -3.25714532805336, 2.8830376422934272]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[-0.73268042310566084, 6.8461481289116133, 33.847788842755534, -4.4839037418226342], [-2.332951722826095, 3.7858037359120837, 19.794288614934899, 5.1267189620493276], [10.644347783883958, -0.49303908272661184, 2.0256021517429672, 2.4344004582515986]], [[-1.3833083206999861, -0.27381714031805904, -6.8934769894825036, 0.23574618319572163], [-6.2227700460059214, -1.7098122776665645, 4.8811117640231814, 3.7882447483812283], [41.421958278621425, 54.632417729894307, 3.2567950082922765, -6.3932404607941047]]], [[[-15.55003572699952, 6.26624442741032, -37.563394764628619, 17.714149822522259], [60.337917464723795, 0.077916938870034202, -2.0473798208080725, -0.32899183373047258], [7.6587008257190563, 16.720793600375728, -1.9563719582406482, -0.50924201703526706]], [[5.6932560867954898, 0.34518405739601971, -13.348134452138559, 14.358523226475342], [-4.0976187999765274, 1.6288482299740179, -1.9524858637816733, 20.623359555830689], [-37.861256372312347, -1.2603060734107434, -12.329067021943612, -54.650313184469312]]], [[[11.203990113472214, -6.509565030682996, 17.298145916008178, -1.6310604512076103], [1.6393396374139608, 17.105622648496649, 21.364023868479165, -37.122543121985537], [-11.270143135487098, -39.123021781639721, 0.33617740564235454, -56.801809333517099]], [[0.81996717709255507, -1.7846244450520392, -46.291759074897506, -67.775751992683865], [-28.614663073650313, -26.628495093031358, -0.31665951352652283, -0.5766094900000861], [-4.8372607793094264, 0.81725699408555297, -12.968391079319806, 8.90625216843255]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
1979     def test_cosh_float_rank0(self):     def test_cosh_float_rank0(self):
1980        arg=1.33144608066        arg=1.33144608066
1981        res=cosh(arg)        res=cosh(arg)
# Line 2814  class Test_util_unary_no_tagged_data(Tes Line 2114  class Test_util_unary_no_tagged_data(Tes
2114        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
2115        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
2116     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_cosh_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=cosh(arg)  
       s=numpy.array(2.75739869293)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(7.91112636998)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_cosh_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=cosh(arg)  
       s=numpy.array([-0.76527574477527338, -0.51638073091820225])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([1.30739633279828, 1.1363135593194955])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_cosh_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=cosh(arg)  
       s=numpy.array([[-1.239324074660991, 1.3306875190577632, -4.2029567092868767, 2.4202328047114534, -3.2224805912619994], [3.1998123666870111, -0.33075113334767092, 3.3515780504321455, 0.81914829973967684, -4.7255959008562698], [-2.0835587347318718, 0.77688167015356502, -0.37472989563448689, 4.749826601737503, -1.1487137136853045], [-2.2942130979894335, -1.9377660872258149, -3.6514143725216908, 3.4654468238550002, -0.13209927398779353]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[1.8714292017298924, 2.0239696557060602, 33.449373108870269, 5.6686893135937337, 12.565068926686324], [12.284348681029053, 1.055198626050649, 14.291388467918688, 1.3546869027739732, 56.403280011575283], [4.0787459257765759, 1.3172590071205805, 1.0710367059274308, 57.786448673067127, 1.7355887489474422], [5.0087351196611749, 3.5436242045445723, 19.277538227281813, 16.011004922864494, 1.0087378043980351]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_cosh_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=cosh(arg)  
       s=numpy.array([[[4.4728756031992116, -0.18351884976683763], [0.80277629719465793, 1.5732490289902525]], [[-4.5413168575949969, 3.3056337061808385], [-1.2899652306449614, 4.7779656233703527]], [[0.60096233653067177, 3.7617362717770177], [4.5577353966894982, 2.7479486379526508]], [[4.6837216050261983, -2.2142471494424179], [-2.9275655316895954, 2.8295586278544658]], [[4.2440469583867735, -4.134197252644447], [3.2463450162106273, -1.6235713052536904]], [[-1.1943343500959545, -4.9607123212229567], [3.9966907641316975, 4.0945329900112437]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[43.809851128863571, 1.0168868991320443], [1.3399057499805267, 2.5148304324836985]], [[46.91245909628541, 13.651245296574848], [1.9539703012734158, 59.435353168204003]], [[1.1860784422610493, 21.523152120852295], [47.688875927505777, 7.8373176040462571]], [[54.090571006695413, 4.6318751283714397], [9.3678106572601383, 8.4985110632562755]], [[34.851830536787809, 31.227731680865954], [12.867582442399071, 2.634180955005196]], [[1.8021325027151631, 71.351206301484211], [27.218073425294723, 30.013985129532905]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_cosh_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=cosh(arg)  
       s=numpy.array([[[[-0.59840354705973908, -3.6992737553500854, 2.0834116293969309, 1.7909418762726217], [-0.66671136717535973, 1.4444744532196072, 1.4207502245793426, -1.5419777112070241], [-3.6909057153013949, 4.2668765073857351, -1.020266869998212, 4.9451920812753229]], [[0.29074854036592868, 2.2340907764847007, 1.1353131679021526, -1.7958728608365226], [2.5981195171421669, 3.5717999308591928, -1.4007566706915209, 4.4549518265303352], [-2.4586990353855596, 2.7663064553246306, 0.88956564456719178, -4.8475882741634369]]], [[[-0.77227588863188945, -4.3819772428039396, 4.0967561789254745, 3.4348364842200247], [4.5916785637626774, -4.2198666101339875, -4.7135189223558136, -2.4011949046504499], [3.52211900355735, -0.58644530617866319, -1.2825417762401958, 4.1087984872690662]], [[1.1539658571793074, 4.7486125818552356, -0.33376458129434017, -4.5794210105590736], [0.33256024834680176, 1.808596933961752, -0.21385744695035491, 2.2851190819437894], [-0.40501119101898198, 0.43167901243727158, -4.9565198402519428, 1.0639056773797009]]], [[[1.4899989187968421, -1.9181156050994774, -0.98737678137009066, -1.569718399320168], [3.8565676921224874, 4.361025546050417, -2.2487388749068749, -0.90641836059689762], [-4.1312482173225344, 3.8949515109582293, -3.0105386976322901, -3.0401966471058706]], [[-4.2527614798355229, 1.3353834568962437, 4.7617030798462583, 3.493994349137731], [1.6964204494110131, -2.9291024677117603, -2.2586801702421067, 4.2686682019049567], [1.6903814480871491, 3.8490413568239497, -1.4101408897133494, 0.21174798870552625]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[1.1844503410027736, 20.221340936999212, 4.07816427723579, 3.080949717487492], [1.2306076386210938, 2.2377467207446844, 2.1908790596764036, 2.4438910741828925], [20.053041006216866, 35.65630618448445, 1.5672168331246497, 70.252476405262854]], [[1.0425659520604158, 4.7225385635507724, 1.7167347465892231, 3.0953568443795247], [6.7564284383310662, 17.804341675661011, 2.1523400104136723, 43.031813100649167], [5.8875700332250185, 7.9813463409235688, 1.4224531656138542, 63.720266762602925]]], [[[1.3133238696415652, 40.004274682699467, 30.080749070439825, 15.529284767375861], [49.335017004573501, 34.019555261289966, 55.726302678185142, 5.5634827583247217], [16.942815235416386, 1.1769442138762927, 1.9415623481636017, 30.444980393902917]], [[1.7430631202826754, 57.716347847492223, 1.0562183922088546, 48.734105789811686], [1.0558096896828404, 3.132881999083887, 1.0229547905710028, 4.9643091494380434], [1.08314431281174, 1.0946292821800856, 71.052723298510443, 1.6213857856956331]]], [[[2.3312318104088843, 3.4775003403773779, 1.5283683624580382, 2.5066993026053668], [23.661927686940572, 39.175098587542948, 4.7906551931438877, 1.4397045035404346], [31.135822884936346, 24.58700712572476, 10.173798388163846, 10.47859003936458]], [[35.156749738612142, 2.032255322732079, 58.476736986120912, 16.473773703914741], [2.8188633841993997, 9.3821371848714747, 4.8374688820145515, 35.720223528968532], [2.8029987513999464, 23.484667692210888, 2.1703207055036438, 1.0225024962990188]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
2117     def test_tanh_float_rank0(self):     def test_tanh_float_rank0(self):
2118        arg=0.0964706283536        arg=0.0964706283536
2119        res=tanh(arg)        res=tanh(arg)
# Line 3002  class Test_util_unary_no_tagged_data(Tes Line 2252  class Test_util_unary_no_tagged_data(Tes
2252        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
2253        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
2254     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_tanh_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=tanh(arg)  
       s=numpy.array(-0.135803602852)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(-0.134974857991)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_tanh_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=tanh(arg)  
       s=numpy.array([1.483611274480209, 0.11911510602021114])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([0.90214238146306058, 0.11855493372667188])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_tanh_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=tanh(arg)  
       s=numpy.array([[2.3486926823134127, 1.778103209870757, 4.3503500383129214, -2.5242992631192838, -2.0590678953632944], [-3.6822557531173872, 2.4762695279886504, 0.10241201115363907, 4.1712963644831635, -3.1327985662033466], [1.614386592546273, -3.9293991926737384, 4.0353462320282869, -3.2770165027287845, 3.3542256816171676], [-3.2301564149658279, -2.1490195740861804, -4.9977090665843953, 0.43498101907080944, -1.0763342632316353]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[0.98192663452689943, 0.94449078759968608, 0.99966711695684729, -0.98724521977731861, -0.96797160483186917], [-0.99873413229597896, 0.98596824745661193, 0.10205546698227386, 0.99952380526208262, -0.9962060543249357], [0.9238056416040531, -0.99922762275502464, 0.99937506180519065, -0.99715533273061818, 0.9975618701567982], [-0.99687627392026157, -0.97317431817314604, -0.99990878731311628, 0.40947559772721104, -0.79183575485602997]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_tanh_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=tanh(arg)  
       s=numpy.array([[[-1.1631919012172185, 0.77729988094826918], [-1.1769960789715519, -4.0125145063791354]], [[1.9971192702379685, -4.2159666789136265], [-2.2730964835073477, -2.6540431195239123]], [[-3.2748361245431656, 0.074997339594329304], [-4.9043788364090632, 0.49310326401604065]], [[-3.1487254396859612, -2.5331364030756975], [1.8351749997027254, -1.3354743713150787]], [[3.2087680204606297, -3.2574693453403594], [-0.7194174955207373, -1.9509638307170265]], [[-1.1581297737977216, -3.849352698280486], [-1.5264307432477011, -2.1120508220647816]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[-0.82207737876422127, 0.65115417556365107], [-0.82650204573751207, -0.99934587294339616]], [[0.96382348792158812, -0.99956449485753263], [-0.97900765501585618, -0.99014600413111442]], [[-0.9971429185025662, 0.074857045190143856], [-0.99989006985714224, 0.45667597957254347]], [[-0.99632478262341095, -0.98746727062213957], [0.9503298673089402, -0.87058095021061543]], [[0.99673997430953187, -0.99704208769250335], [-0.6165483565901515, -0.9603942923626223]], [[-0.82042945012131407, -0.99909358339349741], [-0.90981180882335078, -0.97114542831569306]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_tanh_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=tanh(arg)  
       s=numpy.array([[[[-1.4842328809034102, -3.6799174656163283, 2.4412800330734044, 1.5723372097858315], [1.3278608970639123, -3.7643524629304426, -1.1016675297923193, -0.2143817447551104], [1.7652287213422664, 4.2646905132806321, 1.1701204356236001, 1.8109867032347804]], [[-2.9467398870419759, 1.0211366133091371, -0.095353543260462637, -2.4197918589076686], [1.9512471816539598, 4.4009485423908821, -3.1615562936056896, -1.262426944345878], [-4.9688509679341788, -0.072462739128493325, -4.3995558605099552, 1.9059791350226272]]], [[[-2.5661129112917411, -4.2660905396330238, 0.24976654084147398, -0.91220353965129064], [-3.9894274446854263, 0.77169481377887283, -2.4114580195797597, -1.8597911176011861], [-4.0632971649434735, -0.14360086243829695, -2.6443592823726414, -2.0116800288626724]], [[2.9456209646091622, -1.4636697062149984, -4.9370041609289466, 2.8344037554591388], [2.7480496353902168, -1.6973807487691528, 0.6084204299888798, -4.5855518395368309], [2.5150418999580424, -0.13122684465905365, 4.9830156080240844, -1.7061612383746105]]], [[[1.098304960564179, -0.21418633398197606, 0.59292314918472755, -0.56907749759763515], [-1.9489663730125195, -0.82758946915585252, 2.9158202331670342, -0.30671548252462877], [-3.0765847415008074, 2.0029977761882591, -2.3196297119450748, 1.4243102738572482]], [[-4.0138444684706753, 3.3009730371452033, 2.7249202571449054, -0.68632207710672688], [-1.8916830255575059, 3.0628400642775411, -1.5357303697406568, 3.3810761335703745], [-1.0935218527811683, -3.1737111192233156, 1.0347945664073315, -1.1557174165360271]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[-0.90225802187444459, -0.99872820227991721, 0.98495879599153102, 0.9173967309887644], [0.86872555129078477, -0.99892570971427752, -0.80109720161837061, -0.2111567250446095], [0.94308412490365257, 0.9996049236038197, 0.82431077520574836, 0.94793201962968043]], [[-0.99450043435744395, 0.77032907983640142, -0.095065596171816702, -0.98430347236427895], [0.96041628653782118, 0.99969915047654623, -0.99641772837782017, -0.85173181322365432], [-0.99990336823807147, -0.072336174660339758, -0.99969831145964838, 0.95674641540615557]]], [[[-0.98826247953748536, -0.99960602807363019, 0.24469919478326166, -0.72218820353697333], [-0.99931497161436345, 0.64791387434303183, -0.98404176021214596, -0.95265953848302432], [-0.99940902844899671, -0.14262186250734643, -0.98995426296120992, -0.96484355882885187]], [[0.99448814735730195, -0.89836298453294416, -0.99989701349892779, 0.99311979179557841], [0.9918280395429715, -0.93508083489528493, 0.54301424336821469, -0.99979201830662734], [0.98700841709768616, -0.13047873407475907, 0.99990606720732844, -0.93617486305026543]]], [[[0.79988933467761814, -0.21097001938184892, 0.5319947101254926, -0.5146814657483133], [-0.9602389062693889, -0.67917954168793238, 0.99415063548335858, -0.29744610753884848], [-0.9957555658860392, 0.96423876449355961, -0.98085532538357678, 0.89049466664819843]], [[-0.99934760999298256, 0.99728823535664157, 0.99144279035460059, -0.59561404111816252], [-0.95551975120391064, 0.99563752868142497, -0.91140011517999409, 0.99768919921641919], [-0.79815996571273751, -0.99650361178498392, 0.77582415344672084, -0.81963929903642818]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
2255     def test_asinh_float_rank0(self):     def test_asinh_float_rank0(self):
2256        arg=53.5640700041        arg=53.5640700041
2257        res=asinh(arg)        res=asinh(arg)
# Line 3190  class Test_util_unary_no_tagged_data(Tes Line 2390  class Test_util_unary_no_tagged_data(Tes
2390        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
2391        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
2392     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_asinh_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=asinh(arg)  
       s=numpy.array(94.4334208024)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(5.24107025803)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_asinh_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=asinh(arg)  
       s=numpy.array([-51.068302740035222, 58.189256232766098])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([-4.6264070328362195, 4.7569217429290029])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_asinh_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=asinh(arg)  
       s=numpy.array([[-27.681413508087303, 29.492531355918857, 81.952442687608709, -3.0965098723788884, -36.941741346068959], [98.554347139843031, 15.223190948456434, 47.141084386998216, -36.343650880419752, -23.530049550023108], [-37.144758142956078, -10.221400521009258, 68.512821970200918, -5.6549072500401394, -24.728186495422449], [-25.784137050013143, -11.616030589260504, -15.246705529993605, -42.529962812966751, -49.351044050347845]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[-4.014234476234547, 4.07757153292824, 5.0993235136897184, -1.8485316539262731, -4.3026724352366825], [5.2837810620086429, 3.4170441939344305, 4.5464045593494156, -4.2863559197720882, -3.8518767216179719], [-4.3081509872249608, -3.0200151203722498, 4.9202213455074615, -2.4333986511299632, -3.901499518705152], [-3.9432824690990125, -3.1473809267221293, -3.4185843431707919, -4.4434942001606306, -4.5922087337000281]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_asinh_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=asinh(arg)  
       s=numpy.array([[[-74.528286642585286, 55.372167423756821], [97.013969925220294, 2.981108689367673]], [[10.107889214465175, 44.187231051124229], [39.388142114630682, 27.668207305425227]], [[68.122291889645879, -52.018031773418727], [86.648343080007635, 11.649989453862332]], [[28.947147325357804, -48.13626088739538], [-64.5705014154738, -18.997565298495374]], [[-31.634995538159117, 1.2510641345778879], [-15.639128382045115, -33.124490428047764]], [[-26.648216353992865, 4.4923876320653022], [37.056941898949219, -78.151500197560168]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[-5.0043709261531575, 4.7073057824471451], [5.2680287301361757, 1.8124555132582645]], [[3.0089013932772222, 4.4817110533025755], [4.3667730931709547, 4.013757595282736]], [[4.9145055481244064, -4.6448299826380159], [5.1550383709931511, 3.1502893837348407]], [[4.0589170599724103, -4.5672908143095636], [-4.8609648086213824, -3.6381499889825446]], [[-4.1476608554777608, 1.0482575997555537], [-3.4439437711115017, -4.1936478497110681]], [[-3.976221264101619, 2.2076950217402915], [4.3057848850134963, -5.0518373633428277]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_asinh_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=asinh(arg)  
       s=numpy.array([[[[-88.321181915626084, -59.957296513051816, 69.75024543985802, 93.5426926300633], [-62.135397847853888, 32.031299470596224, 10.641621785213133, -48.499748094318718], [40.122038998928616, 50.407634263965718, 60.830746497921012, 82.166156997106071]], [[4.5602572206574479, -35.421179983802318, -43.082745209220022, 3.904288893656954], [-22.001222493294421, -45.938821385269655, -4.1462841803453898, -25.393202387063923], [62.39325930586935, -58.186229158704705, 50.843340303425236, 17.979422811841772]]], [[[44.771446638887539, -62.379578863020171, -19.885651061931966, -31.531489384041734], [-68.481325690604649, -88.374574024527647, 28.050771554241777, 33.542547295150257], [-7.1061093828190991, 27.776398458170377, 42.880445733659798, -82.65923743127405]], [[-47.190020603494375, -73.0714821843641, 94.689008498691521, 1.2164638574249267], [74.647817175130768, -21.896382764611388, -84.647428772193891, -86.958990969737584], [70.901520721139889, 42.520867674255356, -9.0740901074595683, 77.25862698943385]]], [[[-79.229700243348319, 13.621498509880595, -4.3648535191377391, 47.859437585225407], [-25.528755339218833, 52.619404885506839, -21.921523386946845, 96.334366518964487], [47.15521043698746, 14.233326000114971, -45.883441635332289, -78.325985079225703]], [[-27.248705146663042, -43.06336607376187, 2.0977932181709207, 36.961645199882241], [34.511016549625936, -92.550159115056857, 30.888442648224185, 92.639379603267145], [-6.2915283484377653, -38.954754821004968, 73.847680605679443, 17.000520457010168]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[-5.1741591923441508, -4.7868493007506885, 4.9381195025854998, 5.2315936877468401], [-4.8225277677581797, 4.1601042885023594, 3.0601204218088678, -4.5748120499425751], [4.3852282296188507, 4.6133881923284896, 4.8013100944767917, 5.1019277104532534]], [[2.2223366215214204, -4.2606563240558621, -4.4564044164882075, 2.071233946152446], [-3.7847612721213557, -4.5205761632654271, -2.1295943333188934, -3.9280161791942967], [4.8266686391368863, -4.7568697280716172, 4.6219930230728341, 3.5831475839231217]]], [[[4.4948424621233452, -4.8264493817093133, -3.683777209923889, -4.1443852449110636], [-4.9197615751488577, -5.1747634931135069, 4.0274808914909253, 4.2061840100054155], [-2.6590165142845001, 4.0176577391444273, 4.4516990276712836, -5.1079103517900499]], [[-4.5474418677888604, -4.9846321686901671, 5.243772989397999, 1.0264705185759695], [5.0059733251149092, -3.7799896549038072, -5.131676802963919, -5.1586168789046951], [4.954488790172344, 4.4432803839037085, -2.9015927807924387, 5.0403476475061106]]], [[[-5.0655382355297194, 3.3061411633820859, -2.1796028306297535, 4.5615246391042721], [-3.933336039096281, 4.6563224259836256, -3.7811359660858574, 5.2609992427234102], [4.5467041018472178, 3.3499650531508793, -4.5193702111829497, -5.0540673417082713]], [[-3.9984897170545577, -4.455954624502688, 1.4865336604613335, 4.303210883357095], [4.2346356136763283, -5.2209271242790836, 4.1237911954117159, 5.2218906267867222], [-2.538607984893114, -4.3557127273075134, 4.9951976213516334, 3.5272550180217306]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
2393     def test_acosh_float_rank0(self):     def test_acosh_float_rank0(self):
2394        arg=95.1417913418        arg=95.1417913418
2395        res=acosh(arg)        res=acosh(arg)
# Line 3378  class Test_util_unary_no_tagged_data(Tes Line 2528  class Test_util_unary_no_tagged_data(Tes
2528        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
2529        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
2530     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_acosh_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=acosh(arg)  
       s=numpy.array(8.83832675399)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(2.86902891648)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_acosh_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=acosh(arg)  
       s=numpy.array([51.431289167885012, 36.090535466510325])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([4.6332993814724031, 4.2789858461621524])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_acosh_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=acosh(arg)  
       s=numpy.array([[7.2705423319650215, 63.449164580449647, 4.6660148624618483, 47.087736848486927, 80.123169314058757], [85.083881050720962, 33.24544894762245, 76.723455206191744, 67.818623223400508, 61.575376594597493], [89.601153011192892, 42.327677723178105, 76.696114140984321, 18.30052736287843, 28.590244498376272], [10.774038333113104, 17.287631077359809, 81.149132326134207, 80.123196394473339, 34.180707205089746]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[2.6722147562252427, 4.8433241027548632, 2.2217667539244514, 4.5450470124254263, 5.0766733028956459], [5.1367502506657008, 4.1968387966078913, 5.0333121738512325, 4.909929656846173, 4.8133432975616044], [5.1884842278475114, 4.43844880555997, 5.0329557214234866, 3.5993297496616621, 4.0459067513013141], [3.0681258827569766, 3.5423009022035101, 5.089397816053955, 5.0766736409067317, 4.2245944975950751]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_acosh_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=acosh(arg)  
       s=numpy.array([[[68.436566080298221, 23.741002709099241], [40.740025481659302, 34.756917428131608]], [[57.125027279040395, 92.200582882241889], [90.322205250155676, 73.209039638183867]], [[3.9765006780697885, 86.314873743489443], [72.017072408870789, 10.563133204568237]], [[77.851290793891948, 83.887191961947636], [92.242353629093174, 96.077094172622409]], [[19.233665618455788, 2.7398766640609997], [29.036830395618921, 92.71779007881733]], [[29.13196817333764, 51.964170756920311], [17.817378097148552, 58.250979947993216]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[4.9190010717293031, 3.859906961273639], [4.4002075576618829, 4.2413187849478122]], [[4.7383128882005954, 5.2170842232517654], [5.1964998702743745, 4.986419437373689]], [[2.0573504768019486, 5.1511155555095396], [4.97000218232583, 3.0482690027462218]], [[5.0479064081551144, 5.1225845959117287], [5.2175371894025826, 5.2582710297225006]], [[3.6491328592793129, 1.6659588775436645], [4.0614155749028118, 5.2226784623827696]], [[4.0646886061359995, 4.6436090417284488], [3.5725330239466793, 4.7578344105899433]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_acosh_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=acosh(arg)  
       s=numpy.array([[[[75.19324619590509, 73.761578209037424, 43.28458283755996, 41.031195422906926], [57.008487376721291, 58.393162335519278, 96.42053859370813, 13.377741945365656], [61.246321551993674, 46.299497327136741, 46.297645480115484, 13.766935388715718]], [[80.642133250697412, 56.311487350812399, 69.174969127592988, 26.351211371856802], [49.933986291253866, 7.9594109016702479, 23.848763992802173, 51.031536246310239], [57.768209454326467, 31.897141352024917, 64.053396864329798, 97.034642002747816]]], [[[81.655254719882294, 99.169397740562488, 9.6378817280416644, 12.132882296083427], [77.495632877874655, 73.804548645960395, 60.039861217845647, 62.335589481854903], [70.040530183069322, 12.832888465190591, 78.634787752839003, 72.749055984558836]], [[66.385279492332586, 22.234427448584732, 60.622129630286047, 32.617015264157487], [29.984200234972775, 99.595738670752453, 54.231979888378575, 72.706076185088861], [56.209117468335158, 7.1282993866086208, 47.322386671701878, 7.4389861171981213]]], [[[70.660427580421697, 69.28480796375672, 81.7326078652261, 14.679344851871766], [97.767316633745352, 14.854144645972125, 42.556577019575926, 51.89053132945515], [46.163870254833071, 96.42440958148083, 82.85953600445157, 53.966866478151637]], [[22.679183870851013, 49.001962516703919, 34.390798696839354, 57.643543314765338], [52.960885590369621, 98.177072111675187, 33.171702602217621, 87.481661102775774], [26.692214686023377, 68.204957372038947, 33.387254559409627, 88.293025895179554]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[5.0131643770308161, 4.9939392035804469, 4.4608102347301584, 4.4073312938957665], [4.73627040593533, 4.7602726532656288, 5.2618395237244719, 3.285339592204771], [4.8079843183182973, 4.5281616404487552, 4.5281216331856156, 3.3140952311003953]], [[5.0831299934310055, 4.7239668838797355, 4.9297340111653529, 3.9643012021453927], [4.6037487598217925, 2.7635324132163119, 3.8644397322882442, 4.6254949680052109], [4.7495108732038398, 4.1554177652074964, 4.8528033030610871, 5.2681886769606994]]], [[[5.0956158575797206, 5.2899512352366163, 2.956146205282256, 3.1873638590232569], [5.043327134768651, 4.994521645990881, 4.7880865163469322, 4.8256153587314712], [4.9421702923936692, 3.243636931228854, 5.0579209412673745, 4.9801158696989551]], [[4.8885657853800497, 3.7942829758046388, 4.7977391490274037, 4.1777461993257692], [4.0935395780004518, 5.2942413554891452, 4.6863329370151341, 4.9795248439502169], [4.7221470201171716, 2.6522631245629915, 4.5500189999157881, 2.6953331715047297]]], [[[4.9509827988079369, 4.9313207581919274, 5.0965627938545763, 3.3784263664313543], [5.2757113600998888, 3.390291138463116, 4.4438435260615954, 4.6421906543656162], [4.5252273127906335, 5.2618796719990817, 5.1102576025726147, 4.6814316048233167]], [[3.8141082647649451, 4.5849033980242888, 4.2307247864588051, 4.747350176253387], [4.6626116708481051, 5.2798939490921617, 4.1946170863268293, 5.1645436962064979], [3.9771680439868415, 4.9156106858798232, 4.2010970583854101, 5.1737762324411882]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
2531     def test_atanh_float_rank0(self):     def test_atanh_float_rank0(self):
2532        arg=-0.592275223482        arg=-0.592275223482
2533        res=atanh(arg)        res=atanh(arg)
# Line 3566  class Test_util_unary_no_tagged_data(Tes Line 2666  class Test_util_unary_no_tagged_data(Tes
2666        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
2667        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
2668     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_atanh_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=atanh(arg)  
       s=numpy.array(-0.30780410844)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(-0.318117880383)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_atanh_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=atanh(arg)  
       s=numpy.array([-0.92825430705464818, 0.47662053578092944])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([-1.6456212721348789, 0.51860229001344726])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_atanh_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=atanh(arg)  
       s=numpy.array([[-0.64268655894628013, -0.17900729974323459, -0.93622635436697865, -0.75530537733244674, -0.040197643917069259], [-0.074968746935780151, -0.18050133204947205, 0.81879041277566755, 0.79858101753749811, 0.10564836782548204], [0.89454969795185191, -0.72771184947186063, -0.69634541707367359, 0.44111740691969881, 0.28654446205618012], [-0.94432568567546205, 0.4223019634722287, -0.54920762647610788, -0.3498179507985969, 0.92405598378649501]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[-0.76273747174996731, -0.18095693692912998, -1.7065780762109035, -0.98519356496898691, -0.04021931606101925], [-0.075109671741579773, -0.18250085608071256, 1.1531363244600044, 1.0946830405079351, 0.10604408883399515], [1.4442483457872199, -0.92384614959363032, -0.86017032316019748, 0.47361732392762174, 0.29479753602698688], [-1.776575803691927, 0.45049031752977348, -0.61724600305140942, -0.3652363058543272, 1.6160971441660379]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_atanh_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=atanh(arg)  
       s=numpy.array([[[-0.32768047804635259, 0.27083412983799371], [0.96456505778855495, -0.95793931690053258]], [[0.13578211937478502, -0.076595585223402152], [0.7699288343063635, 0.17372316866289506]], [[-0.61007782841365699, -0.44596979459803332], [-0.80038273194979481, 0.27951995990625877]], [[0.96468166359271446, -0.42146255045023295], [-0.81192504775719732, -0.50430515241754215]], [[0.81763435326259204, -0.10289209829784873], [0.77612171794735985, 0.58441787613196405]], [[-0.75878946143976111, -0.093819739801749735], [-0.60760136773290552, 0.35694551786007178]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[-0.34022749529469543, 0.27776376089565591], [2.0076638768689574, -1.9202672095030437]], [[0.13662593544919646, -0.076745907195040208], [1.0201529705148928, 0.17550315324651808]], [[-0.70904531913290891, -0.47965815295848296], [-1.099676338365027, 0.28716127152334037]], [[2.0093416169393494, -0.44946915275178251], [-1.1326522779275399, -0.55506293353858005]], [[1.1496387045221095, -0.10325752111600578], [1.0355424678044653, 0.66914605140069239]], [[-0.99335544463990721, -0.094096474399905483], [-0.70511013561960945, 0.37338102912677751]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_atanh_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=atanh(arg)  
       s=numpy.array([[[[-0.70718789366281076, -0.35559397916891566, 0.84557426096799815, 0.78764119656808451], [0.46342572829553053, -0.64512731939286261, -0.65997521957700944, -0.31469893876607213], [-0.011508570014323705, 0.27076979273582502, 0.077093401081593349, 0.46725442620480617]], [[-0.61265334002394067, -0.18962173732557397, -0.78033518622571107, -0.10857350051456549], [-0.97837378174494838, 0.23802019788470807, 0.85178283026993817, -0.77486822495464969], [0.74685991639680949, -0.6547767998261782, -0.21806038081812618, -0.28522664811816145]]], [[[-0.13846097617816644, -0.047217580636335188, -0.6563159422457141, 0.58739232432942101], [-0.4504864128687277, 0.51464281446069515, 0.74073047396916603, 0.20201792806433949], [0.71680584900614464, -0.55132706998485137, -0.58266603844086662, 0.4223617538144977]], [[-0.97584704502568653, 0.87645712487863459, 0.25825268799801071, -0.44076135763317048], [-0.68653055947167552, 0.97346296010657607, 0.42197080657965813, -0.90102328277783295], [0.59498153858668923, 0.93696400536841562, 0.34601990480916212, 0.80819489847753556]]], [[[0.48940103721418371, 0.46376478141820643, 0.76518218727209364, -0.17407998523677592], [-0.80667487854830033, -0.039928881941976413, 0.51576820314147831, -0.58644407677864463], [-0.44727098667598653, 0.39830378014822787, -0.43739642571928172, -0.36114686415375996]], [[0.7188545756089495, -0.091479191117531, -0.25857052054915108, 0.34990073993747761], [-0.006006089441908502, 0.85278505750273315, -0.93415168535991966, 0.32428119377191567], [0.46399646364687874, -0.09637771392179062, -0.12889588522970596, -0.41331033666236527]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[-0.88153583058451135, -0.37183300184974577, 1.2404162166652297, 1.0651874747284145], [0.50166518275529381, -0.7669069895211057, -0.79276972736107554, -0.32575236366854848], [-0.011509078147267354, 0.27769433234046237, 0.077246680166337262, 0.50655211668895583]], [[-0.71315804222547008, -0.19194476908251976, -1.046227060823292, -0.10900317256540111], [-2.2580620385713366, 0.24267435955879613, 1.2626127923885968, -1.0323977810273626], [0.96581604802825538, -0.78361512484617857, -0.22161874827080594, -0.29336242978391264]]], [[[-0.13935612796060629, -0.047252718182587819, -0.78631415226846013, 0.6736753488159537], [-0.48531036821038409, 0.56902491960203117, 0.95209597754208786, 0.20483544961374053], [0.90104403522903109, -0.62028591821750034, -0.66648965089792989, 0.45056308741422113]], [[-2.2021728685750688, 1.3602762535336363, 0.26423532332423205, -0.47317534097404162], [-0.84136344872439905, 2.1545018186970277, 0.45008735263821137, -1.4776314735797131], [0.68534239539697872, 1.7125855869844508, 0.36091519135452482, 1.1218022863706705]]], [[[0.53527242811588738, 0.50209705386821479, 1.0085996189038051, -0.17587109709374649], [-1.1174350061783813, -0.039950122010336812, 0.57055697150438711, -0.6722288060349606], [-0.48128356633141184, 0.42163124783596156, -0.4690067346095782, -0.37820415611403307]], [[0.9052706717835981, -0.091735659546635734, -0.26457589830366285, 0.36533064186876912], [-0.0060061616629141258, 1.266275754926822, -1.6900351349499771, 0.33642403678181054], [0.50239226012690941, -0.09667779484166715, -0.12961691843037992, -0.43959699536462843]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
2669     def test_exp_float_rank0(self):     def test_exp_float_rank0(self):
2670        arg=3.09787887997        arg=3.09787887997
2671        res=exp(arg)        res=exp(arg)
# Line 3754  class Test_util_unary_no_tagged_data(Tes Line 2804  class Test_util_unary_no_tagged_data(Tes
2804        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
2805        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
2806     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_exp_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=exp(arg)  
       s=numpy.array(-3.87298038283)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(0.0207962960462)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_exp_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=exp(arg)  
       s=numpy.array([-0.20000584036703906, -0.12203739591126173])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([0.81872597140384107, 0.88511526819169717])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_exp_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=exp(arg)  
       s=numpy.array([[4.1975952529520502, -1.0965834508982395, -3.7155900987746762, 4.1631577844571872, 1.5870710945210389], [-1.8507864417212216, -4.6404821916261465, 4.1894713334966145, 4.516632420125946, 1.754560302996822], [1.9671662410693722, 2.1042910667788615, -4.3134556405188684, 3.5170724664260291, -0.75675837298414539], [-4.5897995639987332, 3.2214929670590386, 0.089963975609865798, 4.3692691371729122, 2.6927416796763968]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[66.526159945886405, 0.33401029908458973, 0.024341073238715056, 64.274166442549003, 4.8894073240770659], [0.15711355705802071, 0.0096530418891831535, 65.98789614704134, 91.526854417761839, 5.7809053363016343], [7.1503852835789967, 8.2012867835245391, 0.013387208191684692, 33.685668047995925, 0.46918488694480354], [0.010154893575660639, 25.065514247426851, 1.0941348674539169, 78.985882753286887, 14.772120875133314]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_exp_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=exp(arg)  
       s=numpy.array([[[-3.4657633590048107, 0.2379541999808108], [-4.0242830735782364, 3.5170117793628766]], [[-4.1487432521070158, -3.0382236326873056], [0.83262795246426791, 2.5244424034818831]], [[-2.8040529863441046, -0.65307173731568913], [3.3677599847192834, -3.4852169563509481]], [[2.2967835731244488, -0.73010466706951327], [2.8227774757934752, -0.63076834305534213]], [[4.4282789391803306, 3.1420580903915116], [4.2107354077591079, 1.6378184244914982]], [[-0.56438766617154634, -2.0331776310216219], [0.84601926657954429, 3.836865408895628]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[0.031249142005369813, 1.2686510872501624], [0.017876235505922579, 33.683623825761309]], [[0.015784240836552832, 0.047919937344048556], [2.2993533988239152, 12.483932325335132]], [[0.060564099052012842, 0.52044464964795356], [29.013463611609279, 0.030647108623018924]], [[9.9421527644971093, 0.48185855272804906], [16.823512740157312, 0.5321827449630705]], [[83.787090070345215, 23.151465669637247], [67.406092550621253, 5.1439353791948879]], [[0.56870827947798797, 0.13091884769011208], [2.3303518542386596, 46.379864434623208]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_exp_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=exp(arg)  
       s=numpy.array([[[[4.2271435079193953, 3.4497699907211725, 2.5791007813725111, -1.0362642925400181], [4.6733555143849017, 3.2469834948141933, 0.032978187490201094, 4.6202158907662589], [-0.60598734329677306, 0.26415402305625513, -1.1277934278000448, -1.7295436740050985]], [[-3.9662259914545217, 0.48125641018092224, 1.2783349083305708, 0.29858505415778591], [-2.4070622109386122, 0.70113364049864035, -1.3681941665296957, 2.2879734245047345], [-3.5976659148905576, -0.85593463990762864, -2.6453156173818115, 4.0655826720366353]]], [[[2.3618046888957291, 3.1833383400359097, 2.0765732597167794, 4.6516655163641314], [-0.097825252629930581, 2.3702859345789964, -2.1503460673344001, -4.4022976204824715], [1.0741492594926116, 3.5036664091220686, -4.8392201875759877, 4.5127814825179549]], [[-3.0029866418447684, 0.83512109365664067, -2.1280019819850149, -4.627407859386401], [-0.21575397707848509, -1.3803962875184714, 1.7990190844255967, 4.4604412602239929], [-0.061405244424172167, -0.03925103510887773, -2.3020861045397845, 4.5888707472570403]]], [[[-0.29064184190931819, -2.6186745370794307, -4.6142605123087161, -1.6516775830862009], [1.1202225853625025, 4.6763978209365646, 4.3707611625683445, -3.0272970303064772], [-4.6146463197808671, 0.31362508943462952, 2.0458621277254903, -2.5410283742873983]], [[-3.3114703041035853, 4.6936507994278305, -4.5996296617857881, -3.3951269287168651], [0.48131227959236877, 2.6414512242447419, -2.2479267382448285, -2.3268786318129973], [-0.080240124183298178, -2.1484809900382986, 4.2024072946354032, 0.53888041553931121]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[68.521222028334464, 31.493147759418935, 13.185276381161019, 0.35477755464517413], [107.05636959482442, 25.712660442261033, 1.0335279951559131, 101.51594611934168], [0.54553552979689868, 1.3023287695113772, 0.32374683962242717, 0.17736532791571477]], [[0.018944796210811913, 1.6181061305997959, 3.5906559738543753, 1.3479501810886376], [0.090079540922155005, 2.0160368735608816, 0.25456624898069552, 9.8549456389849333], [0.027387572828115055, 0.42488589013542699, 0.070982946751998469, 58.298867748049943]]], [[[10.61008208214048, 24.127163936105305, 7.9770866210204758, 104.75931871908649], [0.90680735210924168, 10.700451475813672, 0.11644385338593467, 0.012249163617038195], [2.9275012968912075, 33.237089604261698, 0.0079132224753743711, 91.175068000456619]], [[0.04963859405631027, 2.3050931635471992, 0.11907497026819054, 0.0097800776099772578], [0.80593355561289637, 0.25147887537108027, 6.0437161805154176, 86.525681015221195], [0.94044205364595246, 0.96150930625395137, 0.10004991129697097, 98.383267833514793]]], [[[0.74778345475642494, 0.072899424302815222, 0.0099095086578462888, 0.1917279990328809], [3.0655364709054345, 107.38256382927392, 79.103819656784296, 0.048446410488893428], [0.0099056862327682373, 1.3683766215144506, 7.735824933009237, 0.078785337301424355]], [[0.036462523324511269, 109.25130723346611, 0.010055559012924511, 0.033536297182817434], [1.6181965357623886, 14.033554671962868, 0.10561797142457006, 0.097599917406044026], [0.92289471043901095, 0.11666123282487034, 66.847058068932171, 1.7140867226472849]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
2807     def test_sqrt_float_rank0(self):     def test_sqrt_float_rank0(self):
2808        arg=86.3180961935        arg=86.3180961935
2809        res=sqrt(arg)        res=sqrt(arg)
# Line 3942  class Test_util_unary_no_tagged_data(Tes Line 2942  class Test_util_unary_no_tagged_data(Tes
2942        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
2943        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
2944     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_sqrt_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=sqrt(arg)  
       s=numpy.array(48.7437410767)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(6.98167179669)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sqrt_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=sqrt(arg)  
       s=numpy.array([78.527746899198689, 1.5833493830932721])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([8.8615882831013248, 1.2583121167235385])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sqrt_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=sqrt(arg)  
       s=numpy.array([[63.826214581695666, 89.005406022154929, 57.941982837564069, 7.1416561939659902, 73.04849946298404], [67.963149598219232, 81.790300655838777, 13.607040013415105, 69.043948382523823, 72.924063330430883], [43.643876028229251, 14.402314737631686, 94.936755296184373, 69.304535545655384, 22.862740388125918], [99.023310003848266, 49.19559465656409, 40.109996598264381, 95.997185202408446, 66.800108678487518]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[7.9891310279463852, 9.4342676463069957, 7.6119631395300429, 2.6723877327150696, 8.5468414904562273], [8.2439765646330674, 9.0437990167760134, 3.6887721552591324, 8.3092688235803163, 8.5395587315991257], [6.6063511886842079, 3.7950381734090222, 9.7435494198051043, 8.3249345670494836, 4.7814998053043896], [9.9510456738901691, 7.013957132501174, 6.3332453448658041, 9.7978153280416773, 8.1731333452041213]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sqrt_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=sqrt(arg)  
       s=numpy.array([[[39.263635702945955, 59.47592454992914], [90.641371759407974, 42.103064195241508]], [[58.192139363133677, 5.9808756795899862], [25.519696951178151, 64.684524114901606]], [[6.6806806948883066, 98.385628017952016], [83.739011217208727, 56.179145320854957]], [[76.132356496384048, 48.262205559300085], [24.506898511600426, 10.346201767670992]], [[85.762098203747939, 46.356305020656919], [11.895564043607006, 67.240598895422721]], [[73.444527442862039, 98.685462940270767], [22.158031346883767, 71.67095176224808]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[6.2660701961393599, 7.7120635727364917], [9.5205762304289117, 6.4886874015660139]], [[7.6283772431057493, 2.4455828915802438], [5.0517023814926141, 8.0426689671340821]], [[2.584701277689224, 9.918952969842735], [9.1509022078267623, 7.4952748662644089]], [[8.7253857505776811, 6.9471005145528224], [4.9504442741637265, 3.2165512226095503]], [[9.2607828072872937, 6.8085464690091468], [3.4489946424439406, 8.2000365179322667]], [[8.5699782638500341, 9.9340557145745247], [4.7072318135910587, 8.465869817227766]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sqrt_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=sqrt(arg)  
       s=numpy.array([[[[78.27145557192128, 65.309884500656892, 80.336114087207477, 20.750978023347141], [78.251745622950722, 64.620902750911569, 28.301359128559341, 45.022605280895156], [16.419149673968789, 59.572100898025965, 99.729136280133375, 37.269575502849051]], [[89.930819509841214, 72.487122414004446, 59.553657087493079, 77.474443517497093], [62.895076415157071, 8.2491917602388938, 50.321944096034009, 51.000949428427383], [84.503408418337358, 95.314634105756738, 71.595904041384102, 56.110459923602171]]], [[[68.050727894701964, 57.315411409982325, 99.440833325043286, 69.983478669760487], [11.915108949219961, 21.849786561553461, 64.312415962105916, 46.884119589771217], [70.638606047306979, 21.976921356965651, 90.46159455843997, 49.89431958540051]], [[52.590303224500033, 61.099058322683675, 27.258436051628152, 77.750244582829112], [3.7036608425609439, 48.574395542108959, 18.502788420694372, 77.751515286943047], [39.911904762077732, 5.7488610313286337, 35.022548969518382, 61.157687858198997]]], [[[39.949145076270405, 7.9553766672300092, 75.945990808129352, 18.401508481229111], [19.672536821697364, 73.114157580366623, 67.328907569179734, 92.568387571255585], [69.616606410669348, 4.3347513419509305, 88.144285456823823, 46.555146360231248]], [[60.14073550096856, 75.128929131544226, 0.5604071970526906, 37.905983080457212], [84.16360243788526, 38.095856938037372, 6.7844526389423008, 39.474340285414179], [85.461297444008196, 0.57284388277309051, 38.748700459114623, 21.958649237257355]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[8.847115663984578, 8.0814531181376594, 8.9630415645141071, 4.5553241403161575], [8.8460016743696546, 8.0387127545964461, 5.3199021728373292, 6.709888619112478], [4.052054993946749, 7.7182965023394878, 9.9864476306709467, 6.1048812849103831]], [[9.4831861475899135, 8.5139369514933829, 7.7171015988836817, 8.8019568004789193], [7.9306416143435126, 2.8721406233398277, 7.0937961696142642, 7.141494901519386], [9.1925735470725147, 9.7629213919685292, 8.4614362871432238, 7.4906915517595687]]], [[[8.2492865082200879, 7.5706942488772011, 9.9720024731767527, 8.3656128687479008], [3.451826900239924, 4.6743755263728506, 8.0195022265790232, 6.847197937095963], [8.4046776289936886, 4.6879549226678421, 9.5111300358285487, 7.0635911252988386]], [[7.2519172102624028, 7.8165886627533165, 5.2209612191270063, 8.8176099132831407], [1.9244897616149959, 6.9695333805147213, 4.3014867686294664, 8.8176819678951368], [6.3175869413944543, 2.3976782585093925, 5.9179852120057195, 7.8203380910417808]]], [[[6.3205336069251628, 2.8205277284986954, 8.7146996969562505, 4.2896979475516819], [4.4353733576439049, 8.550681702669479, 8.2054194023937459, 9.621246674483281], [8.3436566570460791, 2.082006566260282, 9.3885188105911475, 6.8231331776707425]], [[7.7550458090825334, 8.6676945684273061, 0.74860349788969771, 6.1567835011844627], [9.1740722930378773, 6.1721841302765243, 2.6046981857678446, 6.2828608360693599], [9.2445279730231871, 0.75686450753955326, 6.2248454164834186, 4.6860056804550885]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
2945     def test_log_float_rank0(self):     def test_log_float_rank0(self):
2946        arg=24.892231195        arg=24.892231195
2947        res=log(arg)        res=log(arg)
# Line 4130  class Test_util_unary_no_tagged_data(Tes Line 3080  class Test_util_unary_no_tagged_data(Tes
3080        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
3081        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
3082     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_log_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=log(arg)  
       s=numpy.array(5.57339704819)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(1.71800475101)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_log_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=log(arg)  
       s=numpy.array([55.094424018226789, 30.825228501351244])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([4.00904851354671, 3.428333461881043])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_log_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=log(arg)  
       s=numpy.array([[57.398675684054268, 24.177980714078178, 5.4982893015961789, 67.407254153525855, 16.513962228569529], [6.4283890017148346, 55.188483664700371, 53.839642735531008, 31.932937933280087, 98.143544055883794], [76.796578052858521, 30.963376564832927, 47.929778604873881, 16.243335008629984, 51.027017070057802], [41.148615941205918, 17.245802370558533, 38.273069225086424, 80.783284831544904, 87.957165571328332]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[4.0500212313529929, 3.1854423311154147, 1.7044370077832511, 4.2107526405173328, 2.8042062187557026], [1.8607239628013315, 4.0107543022542629, 3.986010049644527, 3.4636380141844505, 4.5864311422563508], [4.3411600825575469, 3.4328051049462864, 3.869736994026173, 2.7876826713247911, 3.9323552389299201], [3.7171902920788344, 2.8475687730279966, 3.644746495466308, 4.3917700732295923, 4.4768499411033291]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_log_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=log(arg)  
       s=numpy.array([[[94.452840354691617, 96.218166528546206], [91.515146506966133, 36.065746573999746]], [[48.384451697331777, 47.196025856076794], [76.195534857354431, 26.880822524994116]], [[77.993735639432941, 81.488298940738161], [93.112316079526096, 59.784773985826376]], [[92.580267708634111, 3.3221123600974254], [63.63112910262528, 44.528425674694731]], [[55.482637994704767, 66.820528405226639], [19.832881117677875, 34.905698489400208]], [[18.466965008665067, 65.365556751618598], [41.429440049898027, 84.725582139004359]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[4.5481006660701659, 4.5666181810964748], [4.5165044941772292, 3.5853435665316105]], [[3.8791785161891639, 3.8543096910821872], [4.3333028633031763, 3.2914131150749557]], [[4.356628511149423, 4.4004594386601878], [4.5338064642503548, 4.0907510129148932]], [[4.5280760272454561, 1.2006008336466387], [4.1531028019029996, 3.7961277644462208]], [[4.0160701428869752, 4.2020103447875954], [2.9873412228341816, 3.5526500963781449]], [[2.9159834606585111, 4.1799954645575781], [3.7239917404270844, 4.4394175883931384]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_log_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=log(arg)  
       s=numpy.array([[[[61.514182588506863, 37.122947845140011, 43.275149606041118, 71.978687163164253], [8.2154877813031089, 76.76038294997187, 71.367397648964484, 27.288429924708364], [18.629044569798687, 56.084487815366764, 47.718839262284291, 92.429962093811312]], [[17.139001010309205, 33.575679826070697, 90.399532169988987, 50.673665165411421], [22.184583307507644, 38.29827813363098, 3.4007475489419843, 13.582996551938322], [50.367299544367143, 80.250554865590786, 71.605833914530251, 40.784415793510476]]], [[[86.853824301490704, 65.139343421003957, 64.662503886602494, 85.754298313764878], [49.186863340993725, 93.33264987199334, 83.496803837319547, 99.676821416138608], [43.529341749401254, 24.46647374573778, 84.152818930157068, 71.842995220312986]], [[25.545138509682143, 32.599851573018896, 90.448746782862813, 5.3128272393528917], [46.489832904555243, 84.444823595095954, 79.800485557770287, 30.907715450176408], [49.143261886806066, 93.657988308417671, 72.528513520985967, 55.898230965975024]]], [[[39.426329897388435, 58.449250317603045, 78.873658767360638, 89.165870765005778], [67.067379542604471, 55.400168431435056, 79.096389731895471, 80.362950601889366], [30.712879469725468, 71.362678544317461, 20.172694916413885, 64.003553818641606]], [[66.255025470215941, 38.772571944782115, 1.7903729575997616, 60.901171706455699], [75.302049725625295, 1.225810125723559, 48.187767122924875, 66.146894589076354], [24.365531712258015, 54.209637458642341, 64.153872381637811, 43.603371535063943]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[4.1192677594210316, 3.614235318696454, 3.7675785581571897, 4.2763700635732489], [2.1060211266349658, 4.3406886600532122, 4.2678411495041866, 3.3064628000753613], [2.9247218988002106, 4.0268592647628374, 3.8653262730085758, 4.5264511911696168]], [[2.8413566273584001, 3.5138019901885489, 4.5042390922739983, 3.9254063509040353], [3.0993976020314276, 3.645404937829539, 1.223995274790713, 2.6088187569890606], [3.9193421459393267, 4.3851536761991916, 4.2711765499005621, 3.7083000425972497]]], [[[4.4642265251257403, 4.1765287202916692, 4.1691814954356046, 4.4514862108978228], [3.8956265825816554, 4.5361699916742566, 4.4248083537268412, 4.601933166650884], [3.7734352336810049, 3.1973037618696836, 4.4326344189486706, 4.2744831160579055]], [[3.240447024951743, 3.4843077353874166, 4.5047833563872501, 1.6701241303492951], [3.8392336414726578, 4.4360983458760037, 4.3795295891210895, 3.4310058436803241], [3.894739744352897, 4.5396497248616647, 4.2839797744870447, 4.0235327332555553]]], [[[3.6744338646172356, 4.0681588617896818, 4.3678473161825435, 4.4904983516281796], [4.2056977788638727, 4.0145826340272279, 4.3706672319101862, 4.3865532565684564], [3.424682093317585, 4.267775023221982, 3.004329953175632, 4.1589386102343013]], [[4.1935113181436021, 3.6577130880118647, 0.58242395435050909, 4.1092524143740468], [4.3215073552272054, 0.20360195253754573, 3.8751051947151849, 4.1918779444715062], [3.1931694988465211, 3.9928587055288425, 4.1612844537236153, 3.7751344761511425]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
3083     def test_sign_float_rank0(self):     def test_sign_float_rank0(self):
3084        arg=-18.2126891998        arg=-18.2126891998
3085        res=sign(arg)        res=sign(arg)
# Line 4318  class Test_util_unary_no_tagged_data(Tes Line 3218  class Test_util_unary_no_tagged_data(Tes
3218        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
3219        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
3220     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_sign_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=sign(arg)  
       s=numpy.array(-78.8176244466)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(-1.0)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sign_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=sign(arg)  
       s=numpy.array([-23.307997668561711, 97.946837106520491])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([-1.0, 1.0])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sign_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=sign(arg)  
       s=numpy.array([[25.774353896674199, -79.415688781383949, 84.418562741938956, -58.800866603384527, -29.323251492508277], [-58.244870428338658, -73.844504461102204, -55.3450603618844, -96.432276847004601, -42.775389208986894], [35.076422760728008, -39.458272506941604, -69.715479166597149, 72.033205199576088, -82.541163626635679], [36.964211228640892, 69.518973130611187, -50.522454219500432, 18.406038536887607, 16.577069571573631]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[1.0, -1.0, 1.0, -1.0, -1.0], [-1.0, -1.0, -1.0, -1.0, -1.0], [1.0, -1.0, -1.0, 1.0, -1.0], [1.0, 1.0, -1.0, 1.0, 1.0]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sign_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=sign(arg)  
       s=numpy.array([[[93.255825412079361, 22.167930858626079], [-34.601927154301123, 50.937728328579141]], [[-59.742343017919985, -74.065921895703937], [-43.631348799796754, -14.783266501596628]], [[-33.610087887962024, -91.376905647709265], [16.712545605225444, -79.314854931819937]], [[-0.042701446436211654, 39.90756794925079], [-19.65219042592949, 8.1892655358897883]], [[-94.968373852076482, 36.433034325316783], [80.156280661610879, -74.735376115646332]], [[10.260535576786495, 76.139920180591048], [-80.076015534321101, -25.881260928763751]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[1.0, 1.0], [-1.0, 1.0]], [[-1.0, -1.0], [-1.0, -1.0]], [[-1.0, -1.0], [1.0, -1.0]], [[-1.0, 1.0], [-1.0, 1.0]], [[-1.0, 1.0], [1.0, -1.0]], [[1.0, 1.0], [-1.0, -1.0]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_sign_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=sign(arg)  
       s=numpy.array([[[[-38.410783523450512, 13.502863758953438, 82.819776608648226, -27.017637502174765], [-22.819096994984875, 89.426813666359095, -14.823864972193562, 16.927611802512388], [-57.732645241050903, -11.238472836162174, 17.589363855120041, 83.321053822919794]], [[-75.398352772960749, 30.463663168358437, 68.923377436325694, 46.796720246084305], [-90.218460239065166, -68.579663069271732, 52.89819708706699, -28.127312006252353], [67.646531614530545, -83.290551345329831, -57.31243386733744, -98.165652262385407]]], [[[45.435084136425274, 71.777764823420085, 11.650187744962494, -76.543455626023942], [-58.18196592809084, 25.559343807322549, 56.948200272731668, -48.030011705022815], [-75.630808341731353, 86.037870824097297, 64.500246898801862, 9.872200245782679]], [[28.454446645156509, -95.254519371410524, 73.46666010587802, 53.66111244729484], [5.1879306129103639, 58.985999756656582, 28.397355016673771, 56.824788949400471], [3.5594103629116489, -73.691849127244268, 71.44612369408469, -85.116729424222925]]], [[[65.867224448583499, -42.512626598669144, -56.037156003905864, 69.20552461915409], [10.864869732508907, -44.757562741188316, 12.08047323624038, -53.525279877968558], [43.481798668122252, 19.245899622762664, 80.946472106107933, 83.304049702662041]], [[56.863284500417961, 93.010305751322988, -14.135944168025688, 87.045636611620182], [39.186080345888513, -98.795546773957383, 25.078521357081286, -16.939285288903079], [70.658280856862632, -35.298735850905416, 51.190527253606831, -10.71360400697732]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[-1.0, 1.0, 1.0, -1.0], [-1.0, 1.0, -1.0, 1.0], [-1.0, -1.0, 1.0, 1.0]], [[-1.0, 1.0, 1.0, 1.0], [-1.0, -1.0, 1.0, -1.0], [1.0, -1.0, -1.0, -1.0]]], [[[1.0, 1.0, 1.0, -1.0], [-1.0, 1.0, 1.0, -1.0], [-1.0, 1.0, 1.0, 1.0]], [[1.0, -1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, -1.0, 1.0, -1.0]]], [[[1.0, -1.0, -1.0, 1.0], [1.0, -1.0, 1.0, -1.0], [1.0, 1.0, 1.0, 1.0]], [[1.0, 1.0, -1.0, 1.0], [1.0, -1.0, 1.0, -1.0], [1.0, -1.0, 1.0, -1.0]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
3221     def test_abs_float_rank0(self):     def test_abs_float_rank0(self):
3222        arg=51.6201697729        arg=51.6201697729
3223        res=abs(arg)        res=abs(arg)
# Line 4506  class Test_util_unary_no_tagged_data(Tes Line 3356  class Test_util_unary_no_tagged_data(Tes
3356        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
3357        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
3358     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_abs_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=abs(arg)  
       s=numpy.array(48.744439036)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(48.744439036)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_abs_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=abs(arg)  
       s=numpy.array([-68.416784667064618, 42.58225089052047])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([68.416784667064618, 42.58225089052047])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_abs_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=abs(arg)  
       s=numpy.array([[-51.328123859307873, -7.5644913589745499, 28.266996370698337, 14.970592961061328, -82.72053514769415], [-64.730385643881618, -7.3890371916870237, -38.80735657181846, -71.866920480392679, 21.317782182450401], [21.676110778625173, -75.275696157653371, -57.856521276982775, 62.015520409976176, -37.345155475712573], [12.092696598195673, 49.593475514125572, -9.4317938245791453, -67.776025606336731, -72.785470065603732]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[51.328123859307873, 7.5644913589745499, 28.266996370698337, 14.970592961061328, 82.72053514769415], [64.730385643881618, 7.3890371916870237, 38.80735657181846, 71.866920480392679, 21.317782182450401], [21.676110778625173, 75.275696157653371, 57.856521276982775, 62.015520409976176, 37.345155475712573], [12.092696598195673, 49.593475514125572, 9.4317938245791453, 67.776025606336731, 72.785470065603732]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_abs_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=abs(arg)  
       s=numpy.array([[[81.227190073243094, -50.740351320699673], [-16.664918814374147, -11.754272131564008]], [[53.597636927218787, 90.583204010562781], [67.441938793671142, -83.465833880542135]], [[-36.88648725529535, 77.402576858154646], [-56.310752537621347, 87.700903518361116]], [[-74.972798459158739, -43.347969963816112], [35.124943525977187, -69.104755665758645]], [[-40.87926245630107, -67.965849727271376], [17.69263644142444, 2.3313586145996368]], [[62.18109238178269, -89.076719051100596], [-35.070596542670913, 47.882108362196789]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[81.227190073243094, 50.740351320699673], [16.664918814374147, 11.754272131564008]], [[53.597636927218787, 90.583204010562781], [67.441938793671142, 83.465833880542135]], [[36.88648725529535, 77.402576858154646], [56.310752537621347, 87.700903518361116]], [[74.972798459158739, 43.347969963816112], [35.124943525977187, 69.104755665758645]], [[40.87926245630107, 67.965849727271376], [17.69263644142444, 2.3313586145996368]], [[62.18109238178269, 89.076719051100596], [35.070596542670913, 47.882108362196789]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_abs_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=abs(arg)  
       s=numpy.array([[[[-90.282777427646124, 12.759284726928513, -67.899393275968123, -99.330117860201668], [-5.4624705782373866, 34.002452250111901, -98.002764647124025, -35.721706426594906], [23.742183179530059, -31.771627669836363, -30.719847587685621, 77.257497345802818]], [[-37.141920533899423, 29.657227717347837, 52.541395609106189, 41.633482013456842], [-19.880886638399105, 45.228339950490351, -73.336084041494075, -72.856240668337975], [-58.105865358499464, -6.2425997623374343, -26.628547892749225, -61.966743196757989]]], [[[10.866529404913024, -56.275671857370881, -99.452127424204932, -31.278557836113123], [-91.190104343176799, 51.123858033933857, 10.149220785231378, -28.453686616222853], [-86.639974838605198, 87.158174448795847, 19.474640024200468, 54.413044396740077]], [[-33.132932509652164, 82.386818309005889, 92.553292893409122, 90.86327106227273], [-46.424626799273774, 7.2718756521770587, -54.524821678613186, -59.938214850866188], [-19.572935990392693, -57.711607692256628, 24.531039532196857, -83.859587195827672]]], [[[-80.734119696307829, -79.893615580112623, 34.028570327836007, -35.048246317620539], [34.470507611381606, 3.5571466263689473, 86.296975487769657, -43.069729884798868], [-68.150779651069001, 98.50395262165361, -61.743879802255378, 74.846459434565531]], [[74.828523248575266, -35.903346178571212, 73.022540009357385, -60.597282319030896], [73.244535607728267, 60.299766972183164, -14.843461499758732, 2.496242397183039], [24.210571075200875, -58.955186321148354, 76.312911969892127, -82.729842167907179]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[90.282777427646124, 12.759284726928513, 67.899393275968123, 99.330117860201668], [5.4624705782373866, 34.002452250111901, 98.002764647124025, 35.721706426594906], [23.742183179530059, 31.771627669836363, 30.719847587685621, 77.257497345802818]], [[37.141920533899423, 29.657227717347837, 52.541395609106189, 41.633482013456842], [19.880886638399105, 45.228339950490351, 73.336084041494075, 72.856240668337975], [58.105865358499464, 6.2425997623374343, 26.628547892749225, 61.966743196757989]]], [[[10.866529404913024, 56.275671857370881, 99.452127424204932, 31.278557836113123], [91.190104343176799, 51.123858033933857, 10.149220785231378, 28.453686616222853], [86.639974838605198, 87.158174448795847, 19.474640024200468, 54.413044396740077]], [[33.132932509652164, 82.386818309005889, 92.553292893409122, 90.86327106227273], [46.424626799273774, 7.2718756521770587, 54.524821678613186, 59.938214850866188], [19.572935990392693, 57.711607692256628, 24.531039532196857, 83.859587195827672]]], [[[80.734119696307829, 79.893615580112623, 34.028570327836007, 35.048246317620539], [34.470507611381606, 3.5571466263689473, 86.296975487769657, 43.069729884798868], [68.150779651069001, 98.50395262165361, 61.743879802255378, 74.846459434565531]], [[74.828523248575266, 35.903346178571212, 73.022540009357385, 60.597282319030896], [73.244535607728267, 60.299766972183164, 14.843461499758732, 2.496242397183039], [24.210571075200875, 58.955186321148354, 76.312911969892127, 82.729842167907179]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
3359     def test_length_float_rank0(self):     def test_length_float_rank0(self):
3360        arg=-0.510102533262        arg=-0.510102533262
3361        res=length(arg)        res=length(arg)
# Line 4698  class Test_util_unary_no_tagged_data(Tes Line 3498  class Test_util_unary_no_tagged_data(Tes
3498        self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
3499        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
3500     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_length_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=length(arg)  
       s=numpy.array(-0.789837980175)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(0.789837980175)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_length_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=length(arg)  
       s=numpy.array([-0.99278720130643516, -0.31635710603880374])  
       sub=res.substitute({arg:s})  
       ref=numpy.array(1.04197324611)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_length_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=length(arg)  
       s=numpy.array([[0.30330617983224806, -0.034382286635428416, -0.92998236960750025, 0.079593387079789357, -0.97576786708696051], [-0.89072269320659547, -0.9147287611809567, 0.38738742635579615, 0.88197146469080034, -0.94934598316837993], [0.76568352803574014, 0.26753035284135196, -0.7524109749998813, -0.96166811239041805, 0.64767731927766614], [-0.08106224171398746, 0.093979242309569999, 0.19365537992471782, 0.66290642442548209, -0.92178464093053747]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array(3.04731243366)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_length_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=length(arg)  
       s=numpy.array([[[0.63270219604931355, 0.83365387198755303], [-0.95894378166298599, 0.94770845609153742]], [[-0.054230309656005948, -0.8583201840223178], [-0.3059469387044198, 0.36436426565521463]], [[0.99936630831878248, 0.69174106343830211], [-0.72346753078696668, -0.29393262943619347]], [[-0.1387177934118875, 0.55335331157202239], [0.17485986485294425, -0.57499413827306101]], [[-0.44635103256370678, -0.0026747734223169228], [0.56999760210195682, 0.28822031836313133]], [[-0.81421483984719423, 0.95146091736639549], [0.325091620781637, 0.1228991584641872]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array(2.99147603017)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_length_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=length(arg)  
       s=numpy.array([[[[0.9553802355613672, 0.69686341659594508, -0.99378722161951782, -0.44375533633037345], [-0.36283156916537651, 0.37154115095294116, 0.89052073402679688, 0.12073579974637294], [-0.23182292009836991, 0.7645988093807583, -0.86092690771967351, -0.60887800830982775]], [[-0.50717685742262053, 0.8809655659976976, 0.58257188844988517, -0.34834108141150799], [-0.3972320705533392, -0.37707450391367781, -0.22019931073074073, 0.085282917686800186], [-0.15485636575308659, -0.059745197090554258, 0.02097074907671348, -0.35319233014647611]]], [[[-0.64291668350006481, -0.83956466436935995, -0.30093964216156355, -0.63680973919809913], [-0.052793612873440088, -0.79714677972722914, 0.27578346113424224, 0.47672412989472424], [0.84075523456069079, -0.62732429158670322, -0.7652927626811814, -0.16234468063865615]], [[0.43567413924823817, -0.70925710144457899, 0.2867437550859715, -0.79422455679900761], [-0.58090904206661964, 0.083979694126635085, -0.65113712391706446, -3.2159537197706811e-05], [-0.68323405228947531, -0.23084624272450149, 0.45792738466607785, -0.23912441655403405]]], [[[-0.60355376046417564, 0.65748745637074957, 0.69475559926651065, 0.30319251488008914], [-0.65446312175735444, 0.75820787788719946, 0.49424915985913276, 0.17550053384909714], [0.164181752436803, -0.47561310823848291, 0.63364128166201228, 0.9154606103705536]], [[0.42202491541151677, 0.4741770029505632, -0.69902234880240055, -0.2340602324823593], [0.68674818683781025, 0.1123258347497631, 0.88525272328302518, 0.76213393540774854], [0.65039498447894473, -0.11889178909612519, 0.73787585442859926, 0.92702273092673648]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array(4.83951826943)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
3501     def test_maxval_float_rank0(self):     def test_maxval_float_rank0(self):
3502        arg=0.315854880825        arg=0.315854880825
3503        res=maxval(arg)        res=maxval(arg)
# Line 4880  class Test_util_unary_no_tagged_data(Tes Line 3630  class Test_util_unary_no_tagged_data(Tes
3630        self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
3631        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
3632     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_maxval_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=maxval(arg)  
       s=numpy.array(0.264444652408)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(0.264444652408)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_maxval_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=maxval(arg)  
       s=numpy.array([-0.46872519059702666, -0.34377250714318253])  
       sub=res.substitute({arg:s})  
       ref=numpy.array(-0.343772507143)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_maxval_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=maxval(arg)  
       s=numpy.array([[-0.42029422551021001, -0.095956646421628822, -0.23423251785733701, 0.88423312487002725, 0.77651814842759825], [0.73935818772227058, -0.94751870058042553, 0.10965991471094028, -0.12636301311301956, 0.60685113859871342], [-0.29042943080940087, -0.81737079875056784, -0.50719799269780519, 0.28310567344481585, 0.66033989717282182], [-0.33454927451872996, -0.1691136351724456, -0.092111533164443093, 0.63693179085948803, 0.44905026678407034]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array(0.88423312487)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_maxval_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=maxval(arg)  
       s=numpy.array([[[-0.89956233971536759, -0.64289918318281236], [0.42717037956336701, 0.58569935497923131]], [[-0.42482815015935294, 0.93299874734754251], [-0.6771236309413744, 0.15645724392299476]], [[0.10155060962378104, 0.1895040443072149], [0.90033792417564662, 0.59995493957111212]], [[-0.48380956284384213, 0.57783539568923015], [0.85668118181206943, -0.8932073050036522]], [[0.87116840393699846, -0.06686322397739386], [-0.079028861013898277, 0.22373883886451518]], [[0.66755615903273458, -0.65115596323523972], [-0.50189681844036782, -0.34651832245873648]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array(0.932998747348)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_maxval_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=maxval(arg)  
       s=numpy.array([[[[-0.66080213310384095, -0.87581702832071029, -0.87713274647618422, -0.71745231801403397], [0.68932205001982982, 0.10085377806879015, -0.32040385535991289, 0.97442268602962323], [0.83736658828768662, -0.89145017019983275, 0.56277884900208464, -0.61169104989326439]], [[0.23689887137935361, 0.45839023497056752, -0.49466349291469691, 0.091384724753820645], [-0.057627653751132435, 0.18673913043356882, -0.38510295375445991, -0.27670522310937296], [-0.32858239487979213, -0.90843899571001741, 0.27321577975950251, -0.16028990431721657]]], [[[0.0071255058479562372, -0.38754201785110265, -0.33975468643735507, 0.32739858297771263], [0.43128787309656214, -0.77344723052438114, 0.35810217859851434, -0.78400515968431495], [-0.025005640492891557, -0.39500130787197052, -0.4215384875978978, 0.2467722435651587]], [[0.42168044940914173, -0.092912330631678808, 0.1744623538435095, 0.6033281471340779], [-0.14393721951466554, 0.575480538521703, -0.039909610497554926, 0.83349968408039721], [0.22842286802122658, -0.6397916476601937, 0.22638602142646835, 0.93110495205313382]]], [[[0.62108277177599214, 0.065344009295399186, -0.71935240158330616, 0.26805934522612329], [0.035203513908888207, 0.080950581554599443, -0.012195970510152643, -0.17495677454869396], [-0.42040689436134127, 0.94134911448517333, 0.27407384363575593, -0.054501699968307893]], [[0.21464458957048138, -0.90513760776997088, -0.63465820211040502, -0.18792780457049862], [0.73983565735614021, -0.97612004404314345, -0.4914734886279577, 0.34426415864802529], [0.51279968744793747, 0.71002505381716818, -0.8836589712227978, -0.8486724911905914]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array(0.97442268603)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
3633     def test_minval_float_rank0(self):     def test_minval_float_rank0(self):
3634        arg=-0.0813988872107        arg=-0.0813988872107
3635        res=minval(arg)        res=minval(arg)
# Line 5062  class Test_util_unary_no_tagged_data(Tes Line 3762  class Test_util_unary_no_tagged_data(Tes
3762        self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
3763        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
3764     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_minval_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=minval(arg)  
       s=numpy.array(0.507552163379)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(0.507552163379)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_minval_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=minval(arg)  
       s=numpy.array([-0.91662367981879389, 0.4198006315668994])  
       sub=res.substitute({arg:s})  
       ref=numpy.array(-0.916623679819)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_minval_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=minval(arg)  
       s=numpy.array([[-0.29337465001819196, -0.77796361836910588, -0.89749043450493105, -0.30862487900038871, -0.70192214194857039], [0.32648534255716855, -0.49853672033206786, 0.5321845912370422, -0.41073302045635973, 0.69340061132124431], [0.18677397167288512, -0.097444503848439723, -0.73427289237530968, -0.083215357445101779, 0.45520990018299456], [-0.31795318366211545, 0.20616805454437204, -0.17213590096670628, -0.76229813913637035, -0.35120268435512259]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array(-0.897490434505)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_minval_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=minval(arg)  
       s=numpy.array([[[0.19787414830345895, -0.83614351915117124], [0.70465412179102649, -0.71002022632149742]], [[0.81645203466857263, 0.91407138577859182], [0.38547438044064064, -0.55666606361332716]], [[0.51370337369414099, 0.16963095730213662], [-0.58399537330570461, -0.55230646275547146]], [[0.29049739131217689, -0.0720172223089941], [-0.96983918996585916, 0.51489468570566843]], [[0.13904641777983495, -0.87888001594027254], [0.32331935423855418, -0.82815742739942078]], [[-0.36262489347610316, 0.30954921036914085], [-0.42974067125100524, 0.9266653571196346]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array(-0.969839189966)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_minval_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=minval(arg)  
       s=numpy.array([[[[-0.67204900739511442, 0.079085406493733856, 0.97677785188509803, 0.94557784438874659], [0.12239779387385918, 0.86627851699886183, -0.36946732134418769, -0.70617340880458124], [0.24141727311903627, -0.94850436864188348, 0.16737990162277239, -0.072616615620619607]], [[-0.19148084528543063, 0.58974721439935518, 0.55319361396862932, 0.2422553723611387], [0.69587824938085685, 0.09702291548199371, -0.57238614850606528, -0.88536417372801646], [0.30840250472613961, 0.020292775561606913, 0.62190212773666875, 0.5059728452345762]]], [[[-0.038225938910192436, -0.20695630371165841, -0.79863023778085962, -0.46144649239755009], [0.55000801875597216, 0.69942471565638287, 0.068075289082253132, 0.22836677446143527], [-0.72463016623204002, -0.32617501811299943, -0.36339847276810211, 0.54011926154638457]], [[0.29907990355289482, 0.020926800856375882, -0.46153676616958106, 0.92008751838836167], [-0.67169679401477755, 0.72033164480782097, -0.75285035539577416, -0.99134720332088344], [0.62283206161782712, -0.69037349091033362, -0.79078624397300334, -0.90587366471377373]]], [[[0.85391675278457169, -0.83245327001211056, -0.32234378036426437, -0.57881382583353158], [0.90771758957613469, 0.71452345688521013, 0.61018013142535299, 0.39091962322647666], [0.10625949427712555, -0.66133568616262206, 0.51510640316003498, -0.077037055946355792]], [[0.22077697247490713, 0.28005938219753945, 0.72657043828819989, 0.28347053543030953], [0.10271021703995697, 0.57252635714826261, -0.22174337092349861, -0.20807672273459987], [-0.15165813092622726, 0.67397147411685321, -0.38153334733453392, -0.18873735174358863]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array(-0.991347203321)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
   
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
3765     def test_clip_float_rank0(self):     def test_clip_float_rank0(self):
3766        arg=-0.660844742681        arg=-0.660844742681
3767        res=clip(arg,-0.3,0.5)        res=clip(arg,-0.3,0.5)
# Line 5162  class Test_util_unary_no_tagged_data(Tes Line 3811  class Test_util_unary_no_tagged_data(Tes
3811        self.failUnlessEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.")
3812        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
3813     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_clip_Symbol_rank0(self):  
       arg=Symbol(shape=())  
       res=clip(arg,-0.3,0.5)  
       s=numpy.array(-0.792931814027)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(-0.3)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_clip_Symbol_rank1(self):  
       arg=Symbol(shape=(2,))  
       res=clip(arg,-0.3,0.5)  
       s=numpy.array([-0.12048403445176348, -0.40029599458937115])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([-0.12048403445176348, -0.29999999999999999])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_clip_Symbol_rank2(self):  
       arg=Symbol(shape=(4, 5))  
       res=clip(arg,-0.3,0.5)  
       s=numpy.array([[0.59397707593157989, -0.015816232421714593, -0.71355286935163331, -0.85103204785524444, -0.91412162455901824], [-0.010694641368312885, 0.84414762841027247, -0.55243149822804294, -0.84297884285781066, 0.27021554859147567], [0.4863295784707149, 0.050773923264246568, 0.41020785802506343, -0.015448450147302895, -0.9895001255305016], [-0.80145072141626073, 0.041501336925147125, -0.9850016338870633, 0.61693811132536069, -0.48955961785655933]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[0.5, -0.015816232421714593, -0.29999999999999999, -0.29999999999999999, -0.29999999999999999], [-0.010694641368312885, 0.5, -0.29999999999999999, -0.29999999999999999, 0.27021554859147567], [0.4863295784707149, 0.050773923264246568, 0.41020785802506343, -0.015448450147302895, -0.29999999999999999], [-0.29999999999999999, 0.041501336925147125, -0.29999999999999999, 0.5, -0.29999999999999999]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_clip_Symbol_rank3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=clip(arg,-0.3,0.5)  
       s=numpy.array([[[-0.67698725582695451, 0.55024011140579132], [-0.047623883112311249, 0.071564619314291367]], [[-0.7948301013947463, 0.26374348727881602], [-0.94301016179903296, -0.88704745056286716]], [[0.20486197801890671, 0.80225286382835392], [-0.69420948063995547, -0.12606948305733034]], [[0.61750342986108109, 0.93969472414748978], [-0.45326273384231608, 0.31853757719424647]], [[0.65617139058608709, -0.29299677423087145], [-0.66376148085374687, 0.018048557420640821]], [[0.4506769651529039, -0.40677305322783619], [0.12438133220532399, 0.33554725745486236]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[-0.29999999999999999, 0.5], [-0.047623883112311249, 0.071564619314291367]], [[-0.29999999999999999, 0.26374348727881602], [-0.29999999999999999, -0.29999999999999999]], [[0.20486197801890671, 0.5], [-0.29999999999999999, -0.12606948305733034]], [[0.5, 0.5], [-0.29999999999999999, 0.31853757719424647]], [[0.5, -0.29299677423087145], [-0.29999999999999999, 0.018048557420640821]], [[0.4506769651529039, -0.29999999999999999], [0.12438133220532399, 0.33554725745486236]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_clip_Symbol_rank4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=clip(arg,-0.3,0.5)  
       s=numpy.array([[[[0.87297933466547506, -0.6759395484248385, -0.064930862035132542, -0.68208927283081366], [-0.8905913641586114, -0.51780151868370705, 0.47935494949299517, -0.43996092297267175], [-0.13947535976114955, -0.59013798318233879, 0.92191259205453591, 0.28856814133987152]], [[0.87283476362790768, 0.83458944186472883, 0.57945024810703272, -0.51607631639092055], [-0.045611193265933991, -0.13516754948427256, -0.12079102468797509, 0.95040836153785979], [0.42784337867530087, -0.74320064427902177, -0.29677529518365819, -0.72388240820397476]]], [[[-0.25053913879373635, 0.99039684792089555, 0.84365440049321294, -0.44615210082238077], [0.2098688758528251, -0.094827930093002388, -0.48904012546642628, 0.07353404666222918], [-0.405215805546145, -0.24507666906852199, 0.073037984734869887, 0.45910186159723798]], [[-0.83617803684565284, 0.72409861676776344, 0.66274368653669491, -0.8363139277203151], [-0.59303850192082574, -0.26100647735452887, -0.46126763689102002, -0.5538059778591673], [-0.13796438067897321, 0.9455220175339234, -0.14001610155093669, -0.13853682926845678]]], [[[-0.88109448055064177, 0.042200298380294932, 0.97569411639878867, 0.055014350789691413], [-0.58023129058148948, -0.81286449921011528, 0.55426564144993939, 0.87587695474553762], [-0.19635452272327258, -0.53832837997779137, -0.025941720598393392, 0.68951865195447115]], [[-0.6367350497294797, 0.82779102060680665, 0.14724409720331422, -0.29315367370960499], [0.22190760573348678, -0.80567179915913845, 0.32495113629038319, -0.91983230608442446], [-0.32241542693213776, -0.85248386776413798, 0.78949099002770429, 0.094819493332709781]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[0.5, -0.29999999999999999, -0.064930862035132542, -0.29999999999999999], [-0.29999999999999999, -0.29999999999999999, 0.47935494949299517, -0.29999999999999999], [-0.13947535976114955, -0.29999999999999999, 0.5, 0.28856814133987152]], [[0.5, 0.5, 0.5, -0.29999999999999999], [-0.045611193265933991, -0.13516754948427256, -0.12079102468797509, 0.5], [0.42784337867530087, -0.29999999999999999, -0.29677529518365819, -0.29999999999999999]]], [[[-0.25053913879373635, 0.5, 0.5, -0.29999999999999999], [0.2098688758528251, -0.094827930093002388, -0.29999999999999999, 0.07353404666222918], [-0.29999999999999999, -0.24507666906852199, 0.073037984734869887, 0.45910186159723798]], [[-0.29999999999999999, 0.5, 0.5, -0.29999999999999999], [-0.29999999999999999, -0.26100647735452887, -0.29999999999999999, -0.29999999999999999], [-0.13796438067897321, 0.5, -0.14001610155093669, -0.13853682926845678]]], [[[-0.29999999999999999, 0.042200298380294932, 0.5, 0.055014350789691413], [-0.29999999999999999, -0.29999999999999999, 0.5, 0.5], [-0.19635452272327258, -0.29999999999999999, -0.025941720598393392, 0.5]], [[-0.29999999999999999, 0.5, 0.14724409720331422, -0.29315367370960499], [0.22190760573348678, -0.29999999999999999, 0.32495113629038319, -0.29999999999999999], [-0.29999999999999999, -0.29999999999999999, 0.5, 0.094819493332709781]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
3814     def test_clip_constData_rank0(self):     def test_clip_constData_rank0(self):
3815        arg=Data(0.873991409144,self.functionspace)        arg=Data(0.873991409144,self.functionspace)
3816        res=clip(arg,-0.3,0.5)        res=clip(arg,-0.3,0.5)
# Line 5350  class Test_util_unary_no_tagged_data(Tes Line 3949  class Test_util_unary_no_tagged_data(Tes
3949        self.failUnlessEqual(res.shape,(3, 2),"wrong shape of result.")        self.failUnlessEqual(res.shape,(3, 2),"wrong shape of result.")
3950        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
3951     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_trace_Symbol_rank2_offset0(self):  
       arg=Symbol(shape=(4, 4))  
       res=trace(arg,0)  
       s=numpy.array([[0.53170042435493015, -0.81813085266388819, 0.49776488697815036, -0.59308638942814595], [0.16020418993822272, -0.20879594431552184, -0.40438865299637583, -0.90709844441071552], [0.64375666096961881, -0.27517391230452315, 0.8807123412925002, -0.77747601880843309], [0.81384867834518992, 0.81300711507303358, -0.33478570998135648, -0.42745393629191275]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array(0.77616288503999575)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_trace_Symbol_rank3_offset0(self):  
       arg=Symbol(shape=(6, 6, 2))  
       res=trace(arg,0)  
       s=numpy.array([[[-0.89676591931694349, 0.95604978719490608], [-0.82494255250502535, -0.77648887659173571], [0.7124204966499359, -0.47918747979862353], [0.94253036599801887, -0.49525180470205044], [0.24456142502672207, -0.30004097354106674], [0.65768225250028256, 0.00086818156620172005]], [[-0.504909745584186, 0.85097185047497104], [0.81641180829143756, -0.39468331897086184], [-0.70635046887704656, 0.49890292017932292], [-0.92440555351961806, -0.06419549869111596], [-0.39579576071153322, -0.20288275718588511], [-0.77089133943822885, -0.0011741243199028251]], [[0.31645143359889882, 0.54967022870454052], [-0.84917283992702641, -0.22946831794661371], [0.30750555249731204, -0.53374075034351387], [-0.21836207994144496, 0.23970091940304572], [-0.44234380858409805, 0.69989440592744412], [0.41425030688237774, 0.31712081171648743]], [[-0.97517653574764496, 0.67982884392918397], [-0.73930329355781388, -0.36444953847109773], [0.8181436780917517, 0.67303437888161155], [0.77329820758899226, 0.93569742730703287], [-0.060808707180728616, -0.97611897228764177], [-0.65303659315383022, -0.49167562112149721]], [[-0.16892454101192822, 0.38900177003547309], [-0.54962224419488726, 0.60406179433423168], [0.92813587095618688, -0.38698563342530523], [-0.29798525812007171, 0.35475928811273061], [0.50046711017097834, 0.53301179072038263], [0.024397390795399598, 0.80190468820066285]], [[0.10762880008184106, -0.67082393783832939], [0.50591078418917101, 0.9772511084203972], [0.79683226798124229, -0.38827988854229489], [0.64666546087911647, 0.14312023138737207], [0.19844882751956772, -0.4568789350267275], [0.66590612284776474, -0.59174059377329358]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([2.1668228820795417, 0.90459434213465229])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_trace_Symbol_rank3_offset1(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=trace(arg,1)  
       s=numpy.array([[[-0.7977094488200962, 0.063978285487136244], [-0.97789454136636134, -0.96688805661820409]], [[0.04895543747537956, -0.063328269776439239], [0.21235577548435702, 0.28138547228954769]], [[0.90551519491645149, -0.42412566434759813], [0.28969999227312093, -0.3663613951232576]], [[0.17193620470155002, 0.41896450861309353], [-0.013424723566530128, -0.74392980520702934]], [[-0.87732745391242406, 0.54830351236065589], [-0.43758121288766083, -0.55971209822943058]], [[0.20614861931150297, 0.94201858882027967], [0.58259554554668425, -0.025276305291194401]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([-1.7645975054383003, 0.33034090976492725, 0.53915379979319389, -0.57199360050547932, -1.4370395521418546, 0.18087231402030857])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_trace_Symbol_rank4_offset0(self):  
       arg=Symbol(shape=(3, 3, 3, 4))  
       res=trace(arg,0)  
       s=numpy.array([[[[-0.80654952480556119, -0.69443824274047494, 0.78496167328791899, -0.42575436767465313], [0.12319287448070959, 0.75938161027494577, -0.4836414442506658, 0.43562960805621453], [0.20634708199571739, -0.70115826289934913, 0.2051734517191024, -0.3747855487381837]], [[0.38156829402705283, -0.73109343527655879, 0.4878500108749706, -0.32586491969049236], [0.089253266683069432, 0.19147413377319422, 0.88062066165505448, -0.15107823177659108], [0.74697716377640733, -0.6515229200918955, -0.3782893155439353, 0.47949490917041504]], [[0.65423612657751273, 0.79741744675367565, 0.55047425317188226, 0.90203544636176347], [-0.13377940079141148, 0.17280231055526629, 0.45003662395977972, 0.067433226867590346], [-0.22246738734039972, 0.38787020561779761, 0.35328502477232915, -0.10075668556673945]]], [[[-0.22329271744241797, -0.2707130236297024, -0.67541180823791946, 0.29445895278940659], [0.03095492342980255, 0.030262307093634977, 0.22659499566711006, 0.13568939898698895], [0.53495887340119186, -0.89494783812407808, 0.72903420908544447, -0.6940338048877337]], [[-0.67969622433272625, 0.045564774685938003, -0.085529480951626269, 0.32350565260596498], [-0.607413340326173, -0.05785501285407979, -0.72320594221116075, -0.48523666261110754], [-0.25900470283804955, 0.4959065468649948, 0.63349492718807388, -0.2017535601635978]], [[0.30350420718603899, 0.59176145201248787, -0.05893817640727006, -0.37431311327659222], [0.93988371599771248, 0.44898229362807229, -0.5009555998961428, -0.50488360148206923], [0.3810666681736814, 0.095905142522387354, -0.34696087767540829, 0.79409668966690927]]], [[[-0.90218333710423271, 0.86062329059996312, 0.1751195479385188, 0.71807543573065469], [-0.80031400477753589, 0.68485605290669604, 0.021018247021905578, 0.4533962598771164], [0.83575260591146128, 0.40206880744947626, -0.17463218432087935, -0.97329531576870409]], [[-0.64046742658297706, 0.57131672632728048, 0.26576340899352013, 0.26536529437565148], [0.5382705073633467, 0.50731197528556748, -0.71216687584177651, 0.9955562159049407], [0.32808570383408009, 0.16778611097035334, -0.10027128196717383, -0.48343905103716267]], [[0.8184542836987525, 0.52730109695941119, -0.88360001933499466, -0.47592646674336758], [0.71390985124247774, 0.051088798569194571, 0.67946117846981746, -0.45808667421780025], [-0.58858643667224553, -0.030929026706359997, -0.27948704074812269, 0.60160600529975539]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[-0.66779146543953494, -0.12157237109512575, -0.18416782699870193, -0.57817518181205574], [0.22968938539701433, 0.75261539599006055, -0.52738620799200908, -0.50769372877269325], [-0.64124405751457769, -0.23618074274071432, 0.55918133815905358, 0.025066896397973881]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_trace_Symbol_rank4_offset1(self):  
       arg=Symbol(shape=(3, 2, 2, 4))  
       res=trace(arg,1)  
       s=numpy.array([[[[0.67935028030080047, 0.87945762686854323, -0.030928776242075573, -0.12158036010546125], [0.24657234583687049, -0.79132752522266547, -0.40360303645871221, 0.54918832044309918]], [[-0.65986516747351875, 0.96638497681200985, 0.63728797931216952, -0.94035388523784835], [-0.23605266636044298, -0.96159056440728508, 0.92548159892971738, 0.38460211142921508]]], [[[0.0084721881107214791, 0.65963525484863594, 0.83038538937978146, 0.79420214695732749], [-0.60657534901222987, 0.62017585161777133, 0.038076548988372316, 0.45500630846667889]], [[0.35671818765868735, -0.78603103654019124, -0.47333087486303249, -0.689826710860731], [-0.94506875200451246, 0.86200222663885073, 0.69208520709875865, 0.38395127433652121]]], [[[-0.9763113290056924, 0.3429641288733174, -0.71779054851061197, 0.081219493894409966], [-0.2392668059090437, 0.23623854037827141, 0.60690820644969601, -0.90326490974279161]], [[-0.31549704230059428, 0.048655767557006735, -0.22849405041132687, -0.35309647594688798], [0.41606901157939413, -0.2735829973707995, -0.41739605378032718, 0.6066947777863847]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[0.44329761394035749, -0.082132937538741846, 0.8945528226876418, 0.26302175132375383], [-0.93659656389379098, 1.5216374814874867, 1.5224705964785401, 1.1781534212938487], [-0.56024231742629826, 0.069381131502517901, -1.1351866022909392, 0.68791427168079466]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_trace_Symbol_rank4_offset2(self):  
       arg=Symbol(shape=(3, 2, 3, 3))  
       res=trace(arg,2)  
       s=numpy.array([[[[-0.43379109997130949, -0.67189802508010876, -0.76838375769062317], [0.36956867556439454, 0.15750933013402357, 0.60890180315702702], [0.75504509257177355, 0.00093170425272193214, -0.60057980545979373]], [[0.029638066249704442, 0.98470665559384063, 0.38850159850271604], [-0.057921882937528535, 0.25260595789798157, -0.47461155702456748], [0.3538224192887085, -0.022692086367159137, 0.20841169768838075]]], [[[-0.8827077102270513, -0.2681753397732729, 0.45996386413852175], [0.79094787422332025, -0.77668488346273334, -0.4134155484834694], [0.39816757111729095, 0.67661052433840085, 0.50946905439722934]], [[0.014477455133028228, -0.80240877745916417, -0.42967869209737497], [0.54259276240450438, 0.39540943896966629, -0.92884898819887329], [0.56909547571069008, 0.69849658256509883, 0.35168988071735297]]], [[[0.76703210261643284, 0.56304082158407076, 0.90973794572357214], [-0.99504722326197359, 0.50876850644469274, -0.53578805027456489], [-0.83168706913026602, 0.18635945312951985, 0.15220552320592673]], [[-0.44163594145490803, 0.36619557701582539, -0.61146289808789267], [-0.19419519121700657, -0.47906398330805788, 0.3940088527490806], [0.96446396182503746, -0.50231016580819254, 0.10716862231226565]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[-0.87686157529707964, 0.49065572183606676], [-1.1499235392925553, 0.76157677482004749], [1.4280061322670523, -0.81353130245070027]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
3952     def test_trace_constData_rank2_offset0(self):     def test_trace_constData_rank2_offset0(self):
3953        arg=Data(numpy.array([[-0.29383963344234121, -0.015014018118957306, 0.99753580206723647, -0.50635236021974106], [-0.37905392076965927, 0.31528456608530631, 0.86721682590868698, 0.51278396705456841], [0.29008438489433841, 0.10101024328890973, 0.66687277847571313, 0.6654399862684186], [-0.5902980567859355, -0.57191420388096859, -0.51058587062074134, 0.93677538124606463]]),self.functionspace)        arg=Data(numpy.array([[-0.29383963344234121, -0.015014018118957306, 0.99753580206723647, -0.50635236021974106], [-0.37905392076965927, 0.31528456608530631, 0.86721682590868698, 0.51278396705456841], [0.29008438489433841, 0.10101024328890973, 0.66687277847571313, 0.6654399862684186], [-0.5902980567859355, -0.57191420388096859, -0.51058587062074134, 0.93677538124606463]]),self.functionspace)
3954        res=trace(arg,0)        res=trace(arg,0)
# Line 5539  class Test_util_unary_no_tagged_data(Tes Line 4078  class Test_util_unary_no_tagged_data(Tes
4078        self.failUnlessEqual(res.shape,(3, 3),"wrong shape of result.")        self.failUnlessEqual(res.shape,(3, 3),"wrong shape of result.")
4079        self.failUnless(Lsup(matrix_mult(res,arg)-kronecker(3))<=self.RES_TOL,"wrong result")        self.failUnless(Lsup(matrix_mult(res,arg)-kronecker(3))<=self.RES_TOL,"wrong result")
4080     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_inverse_Symbol_dim1(self):  
       arg=Symbol(shape=(1, 1))  
       res=inverse(arg)  
       s=numpy.array([[1.1980314049676126]])  
       sub=res.substitute({arg:s})  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(1, 1),"wrong shape of result.")  
       self.failUnless(Lsup(matrix_mult(sub,s)-kronecker(1))<=self.RES_TOL,"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_inverse_Symbol_dim2(self):  
       arg=Symbol(shape=(2, 2))  
       res=inverse(arg)  
       s=numpy.array([[2.0626000623432192, -0.19378103714358597], [-0.8695363129254492, 1.0318306215625603]])  
       sub=res.substitute({arg:s})  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(matrix_mult(sub,s)-kronecker(2))<=self.RES_TOL,"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_inverse_Symbol_dim3(self):  
       arg=Symbol(shape=(3, 3))  
       res=inverse(arg)  
       s=numpy.array([[2.4910151385693204, -0.74351863162413956, -0.40708461900873694], [0.51617920870611744, 2.8802512977704158, 0.47057466972995687], [-0.42822503793816469, -0.50381354993207417, 1.3317844973101152]])  
       sub=res.substitute({arg:s})  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 3),"wrong shape of result.")  
       self.failUnless(Lsup(matrix_mult(sub,s)-kronecker(3))<=self.RES_TOL,"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
4081     def test_inverse_constData_dim1(self):     def test_inverse_constData_dim1(self):
4082        arg=Data(numpy.array([[1.4764835684284772]]),self.functionspace)        arg=Data(numpy.array([[1.4764835684284772]]),self.functionspace)
4083        res=inverse(arg)        res=inverse(arg)
# Line 5822  class Test_util_unary_no_tagged_data(Tes Line 4334  class Test_util_unary_no_tagged_data(Tes
4334        self.failUnlessEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.")
4335        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
4336     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_transpose_Symbol_rank0_offset0(self):  
       arg=Symbol(shape=())  
       res=transpose(arg,0)  
       s=numpy.array(0.702109830578)  
       sub=res.substitute({arg:s})  
       ref=numpy.array(0.702109830578)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_transpose_Symbol_rank1_offset0(self):  
       arg=Symbol(shape=(3,))  
       res=transpose(arg,0)  
       s=numpy.array([0.80175002997618972, 0.33974683237530345, -0.90667311590340094])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([0.80175002997618972, 0.33974683237530345, -0.90667311590340094])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_transpose_Symbol_rank1_offset1(self):  
       arg=Symbol(shape=(3,))  
       res=transpose(arg,1)  
       s=numpy.array([-0.6888832458983043, 0.092146203004236815, 0.83844276648813998])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([-0.6888832458983043, 0.092146203004236815, 0.83844276648813998])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_transpose_Symbol_rank2_offset0(self):  
       arg=Symbol(shape=(4, 5))  
       res=transpose(arg,0)  
       s=numpy.array([[-0.85695249364437354, -0.21957818518746341, 0.69060242366767022, 0.45520777350762009, 0.90015629162949518], [0.07085570338374314, -0.77462893420237267, 0.9266563721673915, 0.93060655075431309, 0.7265587800501907], [0.64041420830301354, 0.88245271215121313, -0.55653732496185238, -0.3628291001667876, 0.54475202342689411], [-0.91874446432184942, 0.32765780993657412, 0.94288597434828225, 0.62409359976242484, -0.23407917735233341]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[-0.85695249364437354, -0.21957818518746341, 0.69060242366767022, 0.45520777350762009, 0.90015629162949518], [0.07085570338374314, -0.77462893420237267, 0.9266563721673915, 0.93060655075431309, 0.7265587800501907], [0.64041420830301354, 0.88245271215121313, -0.55653732496185238, -0.3628291001667876, 0.54475202342689411], [-0.91874446432184942, 0.32765780993657412, 0.94288597434828225, 0.62409359976242484, -0.23407917735233341]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_transpose_Symbol_rank2_offset1(self):  
       arg=Symbol(shape=(4, 5))  
       res=transpose(arg,1)  
       s=numpy.array([[-0.92936100446010705, 0.36351483791551265, 0.95562566420848372, -0.33801728675748444, 0.16778162290515941], [-0.26798973013566907, -0.060434641099009756, -0.20932725329866408, -0.4388730391011133, 0.045117290800432697], [-0.74947838016362955, -0.52817377987635927, 0.68853743203370366, -0.74360937161780161, 0.24113662434978833], [0.60720661370401419, 0.48358757628774196, -0.68536982925608725, -0.73280395453595371, -0.17373891810171016]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[-0.92936100446010705, -0.26798973013566907, -0.74947838016362955, 0.60720661370401419], [0.36351483791551265, -0.060434641099009756, -0.52817377987635927, 0.48358757628774196], [0.95562566420848372, -0.20932725329866408, 0.68853743203370366, -0.68536982925608725], [-0.33801728675748444, -0.4388730391011133, -0.74360937161780161, -0.73280395453595371], [0.16778162290515941, 0.045117290800432697, 0.24113662434978833, -0.17373891810171016]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(5, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_transpose_Symbol_rank2_offset2(self):  
       arg=Symbol(shape=(4, 5))  
       res=transpose(arg,2)  
       s=numpy.array([[0.59343490217709038, 0.47413066581368457, -0.9382373705844882, -0.12778328139910977, 0.45302193047462236], [0.053374478018759497, -0.55841028782880109, 0.60724259383161461, 0.1187730374584457, -0.95007108483772629], [0.75953800969278906, 0.14372072991754736, -0.19692895702456825, 0.86868261037212591, 0.51142654083948491], [-0.72911212219228227, 0.099924265868445383, -0.069434310847699576, -0.79445201008702804, 0.32035043318196688]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[0.59343490217709038, 0.47413066581368457, -0.9382373705844882, -0.12778328139910977, 0.45302193047462236], [0.053374478018759497, -0.55841028782880109, 0.60724259383161461, 0.1187730374584457, -0.95007108483772629], [0.75953800969278906, 0.14372072991754736, -0.19692895702456825, 0.86868261037212591, 0.51142654083948491], [-0.72911212219228227, 0.099924265868445383, -0.069434310847699576, -0.79445201008702804, 0.32035043318196688]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_transpose_Symbol_rank3_offset0(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=transpose(arg,0)  
       s=numpy.array([[[0.45703733401515612, -0.27476113035167748], [0.71419559051233628, -0.62752575490537854]], [[-0.01950866254358341, -0.6123315626521062], [0.99488365622819397, -0.64096535947920308]], [[0.44407245675381679, 0.96629752674787195], [0.79909880913317655, 0.40735279734406782]], [[0.76496940812471248, -0.88001234502773196], [-0.97873413410011501, 0.43670524883896289]], [[0.65622515272001913, 0.67869930547661039], [-0.11493022525066521, 0.69482892877144131]], [[-0.28281090573293244, -0.73767981044528042], [0.45315312055731893, 0.44904524980011296]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[0.45703733401515612, -0.27476113035167748], [0.71419559051233628, -0.62752575490537854]], [[-0.01950866254358341, -0.6123315626521062], [0.99488365622819397, -0.64096535947920308]], [[0.44407245675381679, 0.96629752674787195], [0.79909880913317655, 0.40735279734406782]], [[0.76496940812471248, -0.88001234502773196], [-0.97873413410011501, 0.43670524883896289]], [[0.65622515272001913, 0.67869930547661039], [-0.11493022525066521, 0.69482892877144131]], [[-0.28281090573293244, -0.73767981044528042], [0.45315312055731893, 0.44904524980011296]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_transpose_Symbol_rank3_offset1(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=transpose(arg,1)  
       s=numpy.array([[[0.68551961112777104, 0.38181203882280323], [-0.24737544655903143, -0.71199721169305996]], [[-0.67010756499708046, 0.014915141038687851], [0.24741431202176511, -0.84334118828218663]], [[-0.64631310440809275, 0.5825185510152957], [-0.4566997302728133, -0.46503691165830263]], [[-0.14858998032114901, 0.11887539216428267], [0.22477021592327651, -0.66243880583194881]], [[0.70317431650541429, 0.39861796885340661], [-0.48632988031126589, -0.06457399953950449]], [[0.94585783621803188, -0.0052696673269923], [-0.53840949355980428, -0.64575571446161173]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[0.68551961112777104, -0.67010756499708046, -0.64631310440809275, -0.14858998032114901, 0.70317431650541429, 0.94585783621803188], [0.38181203882280323, 0.014915141038687851, 0.5825185510152957, 0.11887539216428267, 0.39861796885340661, -0.0052696673269923]], [[-0.24737544655903143, 0.24741431202176511, -0.4566997302728133, 0.22477021592327651, -0.48632988031126589, -0.53840949355980428], [-0.71199721169305996, -0.84334118828218663, -0.46503691165830263, -0.66243880583194881, -0.06457399953950449, -0.64575571446161173]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2, 2, 6),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_transpose_Symbol_rank3_offset2(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=transpose(arg,2)  
       s=numpy.array([[[-0.83851414172649053, -0.9345472027993611], [-0.050051987461098291, 0.051207000708158201]], [[-0.45917464327982049, -0.72383868377493887], [-0.89306834101549981, 0.95772609944888143]], [[-0.2065776668223438, 0.42725210324333318], [0.7364228886378279, -0.68355623320214742]], [[0.89432956269945318, 0.047167913434807307], [-0.59615022906951576, -0.052604947166627003]], [[-0.019410260044968597, 0.12421192355633814], [0.77725134763332737, 0.049276142272715706]], [[0.12279204417499834, 0.57729537975214207], [-0.56531900149974712, 0.11474731096758073]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[-0.83851414172649053, -0.050051987461098291], [-0.45917464327982049, -0.89306834101549981], [-0.2065776668223438, 0.7364228886378279], [0.89432956269945318, -0.59615022906951576], [-0.019410260044968597, 0.77725134763332737], [0.12279204417499834, -0.56531900149974712]], [[-0.9345472027993611, 0.051207000708158201], [-0.72383868377493887, 0.95772609944888143], [0.42725210324333318, -0.68355623320214742], [0.047167913434807307, -0.052604947166627003], [0.12421192355633814, 0.049276142272715706], [0.57729537975214207, 0.11474731096758073]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2, 6, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_transpose_Symbol_rank3_offset3(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=transpose(arg,3)  
       s=numpy.array([[[0.43811687269107114, 0.070224123705617369], [0.98167093681025741, -0.84398466636536207]], [[0.17391498795892102, 0.45949829412989995], [-0.71568584070062768, 0.39546676294886907]], [[-0.65699545543981497, 0.57525050782461418], [0.11276781730101826, -0.41282493493770911]], [[0.079970674330177571, 0.18015355990979209], [0.90591997219556863, 0.83004133719305728]], [[0.26972784100484115, 0.59609584683694394], [0.90075223969792506, 0.73114145271184028]], [[-0.19861271928439272, -0.64401827469169226], [-0.37385530367201203, -0.06976906640088254]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[0.43811687269107114, 0.070224123705617369], [0.98167093681025741, -0.84398466636536207]], [[0.17391498795892102, 0.45949829412989995], [-0.71568584070062768, 0.39546676294886907]], [[-0.65699545543981497, 0.57525050782461418], [0.11276781730101826, -0.41282493493770911]], [[0.079970674330177571, 0.18015355990979209], [0.90591997219556863, 0.83004133719305728]], [[0.26972784100484115, 0.59609584683694394], [0.90075223969792506, 0.73114145271184028]], [[-0.19861271928439272, -0.64401827469169226], [-0.37385530367201203, -0.06976906640088254]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_transpose_Symbol_rank4_offset0(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=transpose(arg,0)  
       s=numpy.array([[[[0.25338455669731963, 0.73500471208920737, -0.40868724149572877, 0.91084792476567489], [0.29213307238943176, 0.26615681938372826, -0.20294274257108436, 0.57703872265202438], [-0.73892608500604795, -0.67066247346963537, -0.96356987459146182, 0.5457455546640797]], [[0.11094972582342955, 0.85016649584324244, 0.76462964928116017, 0.31901230439939088], [0.45243545742209523, -0.14019731091592047, -0.015218818306999449, -0.015845524715442316], [-0.29960153317064409, -0.025617317016113805, 0.71913297650565267, 0.76923642609694354]]], [[[0.17351922806845166, 0.37612517548855839, -0.80988734455181111, 0.7838280851636823], [-0.58482482688262549, 0.11089812508666963, 0.086564841446456819, -0.67645141045070289], [-0.5667103382083909, -0.64608750315569696, 0.13681550319654656, 0.91992031872387203]], [[-0.92740780147442625, -0.80163987111802126, 0.43747663433608319, -0.26244711544519461], [0.3576946921175499, 0.21732508704841291, -0.92834834522607035, -0.83448988258005352], [0.024510823691020756, -0.65671821624771698, 0.73997777757578009, -0.47567995097744808]]], [[[0.39151396929525006, -0.37608274093401728, 0.32625448845818439, 0.077258316687835338], [0.47835705923202987, 0.6018972045321842, 0.39609102633455628, -0.10045949285294653], [-0.98228291007259849, 0.59664144839269184, -0.97796159237059888, 0.24922429674239499]], [[-0.57268935996146841, -0.96274562912464012, -0.99814177664422488, 0.25657028539370419], [0.94551104099710881, 0.70625721057924706, 0.20988447951359834, -0.038012877147526547], [0.22246357475516443, 0.99081526817805754, 0.22704080971706597, -0.20551589811990967]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[0.25338455669731963, 0.73500471208920737, -0.40868724149572877, 0.91084792476567489], [0.29213307238943176, 0.26615681938372826, -0.20294274257108436, 0.57703872265202438], [-0.73892608500604795, -0.67066247346963537, -0.96356987459146182, 0.5457455546640797]], [[0.11094972582342955, 0.85016649584324244, 0.76462964928116017, 0.31901230439939088], [0.45243545742209523, -0.14019731091592047, -0.015218818306999449, -0.015845524715442316], [-0.29960153317064409, -0.025617317016113805, 0.71913297650565267, 0.76923642609694354]]], [[[0.17351922806845166, 0.37612517548855839, -0.80988734455181111, 0.7838280851636823], [-0.58482482688262549, 0.11089812508666963, 0.086564841446456819, -0.67645141045070289], [-0.5667103382083909, -0.64608750315569696, 0.13681550319654656, 0.91992031872387203]], [[-0.92740780147442625, -0.80163987111802126, 0.43747663433608319, -0.26244711544519461], [0.3576946921175499, 0.21732508704841291, -0.92834834522607035, -0.83448988258005352], [0.024510823691020756, -0.65671821624771698, 0.73997777757578009, -0.47567995097744808]]], [[[0.39151396929525006, -0.37608274093401728, 0.32625448845818439, 0.077258316687835338], [0.47835705923202987, 0.6018972045321842, 0.39609102633455628, -0.10045949285294653], [-0.98228291007259849, 0.59664144839269184, -0.97796159237059888, 0.24922429674239499]], [[-0.57268935996146841, -0.96274562912464012, -0.99814177664422488, 0.25657028539370419], [0.94551104099710881, 0.70625721057924706, 0.20988447951359834, -0.038012877147526547], [0.22246357475516443, 0.99081526817805754, 0.22704080971706597, -0.20551589811990967]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_transpose_Symbol_rank4_offset1(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=transpose(arg,1)  
       s=numpy.array([[[[-0.42383471927620953, 0.79262015390278595, -0.4294282165691532, 0.58630051915905068], [-0.74464161399651352, -0.93843536862014698, 0.93611241965527281, 0.37601310492751128], [0.95838337975393539, 0.49488642731433519, 0.097526972805529466, -0.094219901133543393]], [[0.069925183138124236, 0.46284010137770482, 0.25265982608529081, 0.85395109313794482], [0.82852088049836303, 0.83716051731739416, -0.87395374004065496, -0.46101688563420695], [-0.60737021834413518, -0.78213803651969194, -0.023739419187312594, 0.81371722891028742]]], [[[0.29857813856025994, -0.57418735321008763, -0.084515436984349046, -0.54351233310595148], [-0.70977426454613712, 0.52673630173919683, -0.36081856247830713, -0.21350979012125459], [-0.15850808738078137, 0.28109046353867062, -0.62459781707685758, 0.59324570097516371]], [[-0.37951452096003235, 0.52602689428547977, 0.33267178330788982, 0.58095558139376813], [0.47693152861730659, 0.51453683105418402, -0.97523170056787833, -0.97136823224786184], [-0.86870843032700495, 0.14433364338577137, 0.35485564375064116, 0.0084064388616631458]]], [[[-0.2033332990072616, -0.96185627602891977, 0.03154074941973839, 0.94715693706136062], [-0.82160862664211054, 0.48141026821110011, -0.81236980256065339, -0.2475044445948007], [-0.62424171382627858, 0.0079629745107963057, 0.4468407037235187, 0.7763765757911294]], [[-0.41411824279919873, -0.10999072623549244, 0.26545879315617071, -0.59337639297627054], [-0.98228798410545304, -0.79561261239634296, -0.76022578819725783, 0.99047748534153834], [0.63663032384984497, 0.56224877221874126, -0.78632856834928733, -0.80623107201984334]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[-0.42383471927620953, 0.29857813856025994, -0.2033332990072616], [0.79262015390278595, -0.57418735321008763, -0.96185627602891977], [-0.4294282165691532, -0.084515436984349046, 0.03154074941973839], [0.58630051915905068, -0.54351233310595148, 0.94715693706136062]], [[-0.74464161399651352, -0.70977426454613712, -0.82160862664211054], [-0.93843536862014698, 0.52673630173919683, 0.48141026821110011], [0.93611241965527281, -0.36081856247830713, -0.81236980256065339], [0.37601310492751128, -0.21350979012125459, -0.2475044445948007]], [[0.95838337975393539, -0.15850808738078137, -0.62424171382627858], [0.49488642731433519, 0.28109046353867062, 0.0079629745107963057], [0.097526972805529466, -0.62459781707685758, 0.4468407037235187], [-0.094219901133543393, 0.59324570097516371, 0.7763765757911294]]], [[[0.069925183138124236, -0.37951452096003235, -0.41411824279919873], [0.46284010137770482, 0.52602689428547977, -0.10999072623549244], [0.25265982608529081, 0.33267178330788982, 0.26545879315617071], [0.85395109313794482, 0.58095558139376813, -0.59337639297627054]], [[0.82852088049836303, 0.47693152861730659, -0.98228798410545304], [0.83716051731739416, 0.51453683105418402, -0.79561261239634296], [-0.87395374004065496, -0.97523170056787833, -0.76022578819725783], [-0.46101688563420695, -0.97136823224786184, 0.99047748534153834]], [[-0.60737021834413518, -0.86870843032700495, 0.63663032384984497], [-0.78213803651969194, 0.14433364338577137, 0.56224877221874126], [-0.023739419187312594, 0.35485564375064116, -0.78632856834928733], [0.81371722891028742, 0.0084064388616631458, -0.80623107201984334]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2, 3, 4, 3),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_transpose_Symbol_rank4_offset2(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=transpose(arg,2)  
       s=numpy.array([[[[-0.022039092203581356, 0.085031919524413579, -0.069414708854588225, -0.49908256005686069], [-0.27805726990017221, 0.23210793957032516, -0.53438510033143283, -0.45094613945799678], [0.049901632176387656, -0.30467021491280977, -0.49852582645095733, -0.75139956998982838]], [[0.60333419330614646, 0.45271539485536261, -0.52479202719377782, 0.81165565790632543], [0.94706245861673799, 0.021745262754251815, -0.27816438895568751, 0.58635467913937589], [0.28217708916665662, -0.85481083062789343, -0.7206400357912004, -0.60278972703019629]]], [[[0.10699833037272488, -0.83193876237357101, 0.75044722372562367, 0.49064630773056717], [-0.54311381534982717, 0.89116102540504172, -0.89619642340688932, 0.41430258909456796], [0.71961101006548778, -0.7320070311870519, 0.34422379105662371, 0.73097051647343303]], [[-0.43582281611067875, -0.015494802243947836, -0.63066171462939136, -0.030158507560761105], [-0.2505680268913415, -0.93536507226146415, -0.72772596394383804, -0.32135170915775779], [0.81011035123827746, 0.43762191138767581, 0.73793436841778126, -0.83618677373948236]]], [[[-0.06718092052953839, -0.34766612935842645, 0.49419088269492972, 0.68165855892174188], [0.4648624829208583, -0.57995975414683065, -0.86372848831622773, -0.63880376507035574], [0.04848471042848157, -0.10723241156805319, 0.51372178831305382, 0.38289668484804196]], [[-0.97936115645348454, 0.13735843559443706, 0.34961509498527876, 0.26841876180785773], [0.65671008147446219, -0.26135751846710042, 0.29594229772579661, -0.91704421780004042], [-0.92741781528137834, 0.51993307871585226, -0.74367067733342451, -0.65271757891582638]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[-0.022039092203581356, 0.60333419330614646], [0.10699833037272488, -0.43582281611067875], [-0.06718092052953839, -0.97936115645348454]], [[0.085031919524413579, 0.45271539485536261], [-0.83193876237357101, -0.015494802243947836], [-0.34766612935842645, 0.13735843559443706]], [[-0.069414708854588225, -0.52479202719377782], [0.75044722372562367, -0.63066171462939136], [0.49419088269492972, 0.34961509498527876]], [[-0.49908256005686069, 0.81165565790632543], [0.49064630773056717, -0.030158507560761105], [0.68165855892174188, 0.26841876180785773]]], [[[-0.27805726990017221, 0.94706245861673799], [-0.54311381534982717, -0.2505680268913415], [0.4648624829208583, 0.65671008147446219]], [[0.23210793957032516, 0.021745262754251815], [0.89116102540504172, -0.93536507226146415], [-0.57995975414683065, -0.26135751846710042]], [[-0.53438510033143283, -0.27816438895568751], [-0.89619642340688932, -0.72772596394383804], [-0.86372848831622773, 0.29594229772579661]], [[-0.45094613945799678, 0.58635467913937589], [0.41430258909456796, -0.32135170915775779], [-0.63880376507035574, -0.91704421780004042]]], [[[0.049901632176387656, 0.28217708916665662], [0.71961101006548778, 0.81011035123827746], [0.04848471042848157, -0.92741781528137834]], [[-0.30467021491280977, -0.85481083062789343], [-0.7320070311870519, 0.43762191138767581], [-0.10723241156805319, 0.51993307871585226]], [[-0.49852582645095733, -0.7206400357912004], [0.34422379105662371, 0.73793436841778126], [0.51372178831305382, -0.74367067733342451]], [[-0.75139956998982838, -0.60278972703019629], [0.73097051647343303, -0.83618677373948236], [0.38289668484804196, -0.65271757891582638]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 4, 3, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_transpose_Symbol_rank4_offset3(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=transpose(arg,3)  
       s=numpy.array([[[[0.27429242256531028, 0.84697272331285212, -0.15123527799616032, -0.20333158931192785], [0.35740759682219569, 0.87382335376002551, -0.83813233476033, 0.69450659290714389], [-0.67369180227532754, -0.70167311114916231, -0.73177474926618435, 0.34055665628378473]], [[0.88922753797947141, 0.65479698492204075, 0.48224049703880634, -0.26918869427282077], [0.75585597443271046, 0.21973256824582599, -0.50124194399344257, 0.92387834623291343], [0.28909969017327541, 0.97743262438855449, 0.91704333491197287, 0.72070435691553558]]], [[[0.76493545807084895, 0.49642100378675424, 0.41700962555209942, -0.99718227370004486], [-0.48164662621310184, 0.14219616846629779, -0.082932068937315417, 0.48464008628884825], [-0.30678648596254043, -0.44048537328383564, 0.40794364430538876, 0.40161397680138045]], [[-0.96226540599323585, -0.27786861998183543, 0.41308057800013209, -0.2526094966083372], [0.68334524785703432, 0.25895626664221272, -0.63025317778650458, 0.97906627194914031], [0.61928776882615399, -0.166471607785176, 0.25933308013922929, -0.30976980035226109]]], [[[0.73666430632836066, -0.65663609646351473, 0.98120843145205106, 0.67098869904256153], [0.77211808493439404, 0.63066203517820107, 0.95326370880499045, -0.86841691420416622], [-0.63537156914796178, -0.47951989786298954, -0.73165008878847337, -0.32768282735661347]], [[0.28636634822021034, 0.67105733064576123, -0.13235726898349709, -0.15228935774836905], [0.038763452322473801, 0.12792551502417981, -0.0057006857143544476, -0.8495591272901335], [-0.41123095208834859, -0.14712059863889682, -0.921343405324478, -0.42267024502568873]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[0.27429242256531028, 0.35740759682219569, -0.67369180227532754], [0.88922753797947141, 0.75585597443271046, 0.28909969017327541]], [[0.76493545807084895, -0.48164662621310184, -0.30678648596254043], [-0.96226540599323585, 0.68334524785703432, 0.61928776882615399]], [[0.73666430632836066, 0.77211808493439404, -0.63537156914796178], [0.28636634822021034, 0.038763452322473801, -0.41123095208834859]]], [[[0.84697272331285212, 0.87382335376002551, -0.70167311114916231], [0.65479698492204075, 0.21973256824582599, 0.97743262438855449]], [[0.49642100378675424, 0.14219616846629779, -0.44048537328383564], [-0.27786861998183543, 0.25895626664221272, -0.166471607785176]], [[-0.65663609646351473, 0.63066203517820107, -0.47951989786298954], [0.67105733064576123, 0.12792551502417981, -0.14712059863889682]]], [[[-0.15123527799616032, -0.83813233476033, -0.73177474926618435], [0.48224049703880634, -0.50124194399344257, 0.91704333491197287]], [[0.41700962555209942, -0.082932068937315417, 0.40794364430538876], [0.41308057800013209, -0.63025317778650458, 0.25933308013922929]], [[0.98120843145205106, 0.95326370880499045, -0.73165008878847337], [-0.13235726898349709, -0.0057006857143544476, -0.921343405324478]]], [[[-0.20333158931192785, 0.69450659290714389, 0.34055665628378473], [-0.26918869427282077, 0.92387834623291343, 0.72070435691553558]], [[-0.99718227370004486, 0.48464008628884825, 0.40161397680138045], [-0.2526094966083372, 0.97906627194914031, -0.30976980035226109]], [[0.67098869904256153, -0.86841691420416622, -0.32768282735661347], [-0.15228935774836905, -0.8495591272901335, -0.42267024502568873]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 3, 2, 3),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_transpose_Symbol_rank4_offset4(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=transpose(arg,4)  
       s=numpy.array([[[[0.58715862381140882, -0.85603535865516367, -0.9278119521738486, 0.35979125930208711], [-0.78476240821041965, -0.064119995323935752, 0.2265840692679304, 0.13764877082542681], [0.67765170224297466, 0.3931709361900706, 0.9756440050275359, 0.64748413050550435]], [[-0.62768716829197069, -0.35581302442836948, 0.7859361459142773, 0.80661910300067974], [0.27342707164098479, -0.81389725147143688, 0.017161883524137389, 0.4605333720818634], [0.10864842160621535, -0.12065624960982868, 0.56809825890777987, 0.72022724446116682]]], [[[-0.00042624010748593122, 0.988048390568667, 0.43192178654981617, 0.51253729861647424], [0.61411085699928414, 0.49455632638026015, 0.65071007183480845, -0.10283089570377535], [-0.24425022315633105, 0.31421351394253239, 0.2987742923711183, -0.69136091110465014]], [[0.19691720582554195, 0.72044948527426333, -0.064928955720874759, 0.77685694003736261], [-0.0089696927655209535, 0.24600846420155698, -0.27826399720550987, 0.42154403021024955], [0.58087107987943898, -0.13568326854518209, 0.59138798182350327, 0.64477983306976205]]], [[[0.73874087191621873, -0.04766297505431405, -0.018614524834952739, 0.71600968812047183], [-0.39504830434954785, 0.061558815891519014, -0.12909453128152748, -0.35510684272205806], [0.090338309596435185, -0.47412763049824336, -0.50588484479757589, -0.40980842342707247]], [[-0.40722535776080626, -0.80715456867314095, 0.48473725112015797, -0.19415741942876474], [0.24908282037234963, 0.75761435915120168, -0.71394726372841433, 0.34892157685808867], [0.55562523535564345, -0.57916534509207063, -0.7807764615589301, 0.67302663393633089]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[0.58715862381140882, -0.85603535865516367, -0.9278119521738486, 0.35979125930208711], [-0.78476240821041965, -0.064119995323935752, 0.2265840692679304, 0.13764877082542681], [0.67765170224297466, 0.3931709361900706, 0.9756440050275359, 0.64748413050550435]], [[-0.62768716829197069, -0.35581302442836948, 0.7859361459142773, 0.80661910300067974], [0.27342707164098479, -0.81389725147143688, 0.017161883524137389, 0.4605333720818634], [0.10864842160621535, -0.12065624960982868, 0.56809825890777987, 0.72022724446116682]]], [[[-0.00042624010748593122, 0.988048390568667, 0.43192178654981617, 0.51253729861647424], [0.61411085699928414, 0.49455632638026015, 0.65071007183480845, -0.10283089570377535], [-0.24425022315633105, 0.31421351394253239, 0.2987742923711183, -0.69136091110465014]], [[0.19691720582554195, 0.72044948527426333, -0.064928955720874759, 0.77685694003736261], [-0.0089696927655209535, 0.24600846420155698, -0.27826399720550987, 0.42154403021024955], [0.58087107987943898, -0.13568326854518209, 0.59138798182350327, 0.64477983306976205]]], [[[0.73874087191621873, -0.04766297505431405, -0.018614524834952739, 0.71600968812047183], [-0.39504830434954785, 0.061558815891519014, -0.12909453128152748, -0.35510684272205806], [0.090338309596435185, -0.47412763049824336, -0.50588484479757589, -0.40980842342707247]], [[-0.40722535776080626, -0.80715456867314095, 0.48473725112015797, -0.19415741942876474], [0.24908282037234963, 0.75761435915120168, -0.71394726372841433, 0.34892157685808867], [0.55562523535564345, -0.57916534509207063, -0.7807764615589301, 0.67302663393633089]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
4337     def test_transpose_constData_rank0_offset0(self):     def test_transpose_constData_rank0_offset0(self):
4338        arg=Data(0.225959396074,self.functionspace)        arg=Data(0.225959396074,self.functionspace)
4339        res=transpose(arg,0)        res=transpose(arg,0)
# Line 6242  class Test_util_unary_no_tagged_data(Tes Line 4604  class Test_util_unary_no_tagged_data(Tes
4604        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
4605        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
4606     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_eigenvalues_Symbol_dim1(self):  
       arg=Symbol(shape=(1, 1))  
       res=eigenvalues(arg)  
       s=numpy.array([[-0.88333892054593477]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([-0.88333892054593477])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(1,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_eigenvalues_Symbol_dim2(self):  
       arg=Symbol(shape=(2, 2))  
       res=eigenvalues(arg)  
       s=numpy.array([[-0.19774975364468905, 0.72605762053517053], [0.72605762053517053, -0.17702492646411461]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([-0.91351890385851708, 0.53874422374971342])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_eigenvalues_Symbol_dim3(self):  
       arg=Symbol(shape=(3, 3))  
       res=eigenvalues(arg)  
       s=numpy.array([[-0.39666022712158422, 0.043213499565241786, -0.2718619768786924], [0.043213499565241786, 0.61677493984107223, 0.57159082148513496], [-0.2718619768786924, 0.57159082148513496, 0.3652453545986567]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([-0.53716021759378285, 0.033257939187142031, 1.0892623457247856])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_eigenvalues_Symbol_zero_dim1(self):  
       arg=Symbol(shape=(1, 1))  
       res=eigenvalues(arg)  
       s=numpy.zeros((1,1),numpy.float_)  
       sub=res.substitute({arg:s})  
       ref=numpy.zeros((1,),numpy.float_)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(1,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_eigenvalues_Symbol_zero_dim2(self):  
       arg=Symbol(shape=(2, 2))  
       res=eigenvalues(arg)  
       s=numpy.zeros((2,2),numpy.float_)  
       sub=res.substitute({arg:s})  
       ref=numpy.zeros((2,),numpy.float_)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_eigenvalues_Symbol_zero_dim3(self):  
       arg=Symbol(shape=(3, 3))  
       res=eigenvalues(arg)  
       s=numpy.zeros((3,3),numpy.float_)  
       sub=res.substitute({arg:s})  
       ref=numpy.zeros((3,),numpy.float_)  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3,),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
4607     def test_eigenvalues_constData_dim1(self):     def test_eigenvalues_constData_dim1(self):
4608        arg=Data(numpy.array([[0.18644177194421618]]),self.functionspace)        arg=Data(numpy.array([[0.18644177194421618]]),self.functionspace)
4609        res=eigenvalues(arg)        res=eigenvalues(arg)
# Line 6396  class Test_util_unary_no_tagged_data(Tes Line 4698  class Test_util_unary_no_tagged_data(Tes
4698        self.failUnlessEqual(res.shape,(2, 3, 2, 3),"wrong shape of result.")        self.failUnlessEqual(res.shape,(2, 3, 2, 3),"wrong shape of result.")
4699        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
4700     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_symmetric_Symbol_rank2(self):  
       arg=Symbol(shape=(3, 3))  
       res=symmetric(arg)  
       s=numpy.array([[0.0, 1.0, 2.0], [3.0, 4.0, 5.0], [6.0, 7.0, 8.0]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[0.0, 2.0, 4.0], [2.0, 4.0, 6.0], [4.0, 6.0, 8.0]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 3),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_symmetric_Symbol_rank4(self):  
       arg=Symbol(shape=(2, 3, 2, 3))  
       res=symmetric(arg)  
       s=numpy.array([[[[0.0, 1.0, 2.0], [3.0, 4.0, 5.0]], [[6.0, 7.0, 8.0], [9.0, 10.0, 11.0]], [[12.0, 13.0, 14.0], [15.0, 16.0, 17.0]]], [[[18.0, 19.0, 20.0], [21.0, 22.0, 23.0]], [[24.0, 25.0, 26.0], [27.0, 28.0, 29.0]], [[30.0, 31.0, 32.0], [33.0, 34.0, 35.0]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[0.0, 3.5, 7.0], [10.5, 14.0, 17.5]], [[3.5, 7.0, 10.5], [14.0, 17.5, 21.0]], [[7.0, 10.5, 14.0], [17.5, 21.0, 24.5]]], [[[10.5, 14.0, 17.5], [21.0, 24.5, 28.0]], [[14.0, 17.5, 21.0], [24.5, 28.0, 31.5]], [[17.5, 21.0, 24.5], [28.0, 31.5, 35.0]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2, 3, 2, 3),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
4701     def test_symmetric_constData_rank2(self):     def test_symmetric_constData_rank2(self):
4702        arg=Data(numpy.array([[0.0, 1.0, 2.0], [3.0, 4.0, 5.0], [6.0, 7.0, 8.0]]),self.functionspace)        arg=Data(numpy.array([[0.0, 1.0, 2.0], [3.0, 4.0, 5.0], [6.0, 7.0, 8.0]]),self.functionspace)
4703        res=symmetric(arg)        res=symmetric(arg)
# Line 6468  class Test_util_unary_no_tagged_data(Tes Line 4750  class Test_util_unary_no_tagged_data(Tes
4750        self.failUnlessEqual(res.shape,(2, 3, 2, 3),"wrong shape of result.")        self.failUnlessEqual(res.shape,(2, 3, 2, 3),"wrong shape of result.")
4751        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
4752     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_nonsymmetric_Symbol_rank2(self):  
       arg=Symbol(shape=(3, 3))  
       res=nonsymmetric(arg)  
       s=numpy.array([[0.0, 1.0, 2.0], [3.0, 4.0, 5.0], [6.0, 7.0, 8.0]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[0.0, -1.0, -2.0], [1.0, 0.0, -1.0], [2.0, 1.0, 0.0]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 3),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_nonsymmetric_Symbol_rank4(self):  
       arg=Symbol(shape=(2, 3, 2, 3))  
       res=nonsymmetric(arg)  
       s=numpy.array([[[[0.0, 1.0, 2.0], [3.0, 4.0, 5.0]], [[6.0, 7.0, 8.0], [9.0, 10.0, 11.0]], [[12.0, 13.0, 14.0], [15.0, 16.0, 17.0]]], [[[18.0, 19.0, 20.0], [21.0, 22.0, 23.0]], [[24.0, 25.0, 26.0], [27.0, 28.0, 29.0]], [[30.0, 31.0, 32.0], [33.0, 34.0, 35.0]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[0.0, -2.5, -5.0], [-7.5, -10.0, -12.5]], [[2.5, 0.0, -2.5], [-5.0, -7.5, -10.0]], [[5.0, 2.5, 0.0], [-2.5, -5.0, -7.5]]], [[[7.5, 5.0, 2.5], [0.0, -2.5, -5.0]], [[10.0, 7.5, 5.0], [2.5, 0.0, -2.5]], [[12.5, 10.0, 7.5], [5.0, 2.5, 0.0]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2, 3, 2, 3),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
4753     def test_nonsymmetric_constData_rank2(self):     def test_nonsymmetric_constData_rank2(self):
4754        arg=Data(numpy.array([[0.0, 1.0, 2.0], [3.0, 4.0, 5.0], [6.0, 7.0, 8.0]]),self.functionspace)        arg=Data(numpy.array([[0.0, 1.0, 2.0], [3.0, 4.0, 5.0], [6.0, 7.0, 8.0]]),self.functionspace)
4755        res=nonsymmetric(arg)        res=nonsymmetric(arg)
# Line 7358  class Test_util_unary_no_tagged_data(Tes Line 5620  class Test_util_unary_no_tagged_data(Tes
5620        self.failUnlessEqual(res.shape,(3, 2, 4, 3),"wrong shape of result.")        self.failUnlessEqual(res.shape,(3, 2, 4, 3),"wrong shape of result.")
5621        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
5622     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    def test_swapaxes_Symbol_rank2_axes_01(self):  
       arg=Symbol(shape=(4, 5))  
       res=swap_axes(arg,axis0=0,axis1=1)  
       s=numpy.array([[-4.0, 0.0, -3.0, -4.0, 0.0], [7.0, 6.0, 7.0, -4.0, 1.0], [4.0, 0.0, 6.0, 0.0, 1.0], [4.0, -7.0, -7.0, 5.0, 3.0]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[-4.0, 7.0, 4.0, 4.0], [0.0, 6.0, 0.0, -7.0], [-3.0, 7.0, 6.0, -7.0], [-4.0, -4.0, 0.0, 5.0], [0.0, 1.0, 1.0, 3.0]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(5, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_swapaxes_Symbol_rank3_axes_01(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=swap_axes(arg,axis0=0,axis1=1)  
       s=numpy.array([[[0.0, 1.0], [2.0, -7.0]], [[5.0, 0.0], [-2.0, 3.0]], [[-7.0, -6.0], [-2.0, -4.0]], [[0.0, 0.0], [5.0, 6.0]], [[-1.0, 1.0], [-6.0, -1.0]], [[-5.0, 0.0], [-1.0, 3.0]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[0.0, 1.0], [5.0, 0.0], [-7.0, -6.0], [0.0, 0.0], [-1.0, 1.0], [-5.0, 0.0]], [[2.0, -7.0], [-2.0, 3.0], [-2.0, -4.0], [5.0, 6.0], [-6.0, -1.0], [-1.0, 3.0]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2, 6, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_swapaxes_Symbol_rank3_axes_02(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=swap_axes(arg,axis0=0,axis1=2)  
       s=numpy.array([[[-6.0, 1.0], [6.0, -7.0]], [[-7.0, -1.0], [5.0, -1.0]], [[0.0, -4.0], [1.0, 2.0]], [[7.0, 3.0], [4.0, 5.0]], [[-1.0, -2.0], [3.0, -6.0]], [[6.0, -6.0], [3.0, 1.0]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[-6.0, -7.0, 0.0, 7.0, -1.0, 6.0], [6.0, 5.0, 1.0, 4.0, 3.0, 3.0]], [[1.0, -1.0, -4.0, 3.0, -2.0, -6.0], [-7.0, -1.0, 2.0, 5.0, -6.0, 1.0]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2, 2, 6),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_swapaxes_Symbol_rank3_axes_12(self):  
       arg=Symbol(shape=(6, 2, 2))  
       res=swap_axes(arg,axis0=1,axis1=2)  
       s=numpy.array([[[-1.0, 7.0], [-2.0, -6.0]], [[7.0, 7.0], [4.0, -3.0]], [[-7.0, 7.0], [-6.0, 1.0]], [[-2.0, 4.0], [0.0, 7.0]], [[5.0, -7.0], [0.0, -5.0]], [[5.0, 4.0], [7.0, -1.0]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[-1.0, -2.0], [7.0, -6.0]], [[7.0, 4.0], [7.0, -3.0]], [[-7.0, -6.0], [7.0, 1.0]], [[-2.0, 0.0], [4.0, 7.0]], [[5.0, 0.0], [-7.0, -5.0]], [[5.0, 7.0], [4.0, -1.0]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_swapaxes_Symbol_rank4_axes_01(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=swap_axes(arg,axis0=0,axis1=1)  
       s=numpy.array([[[[4.0, 6.0, -1.0, -2.0], [6.0, 3.0, 0.0, 0.0], [0.0, 0.0, 4.0, 0.0]], [[1.0, 1.0, 1.0, 5.0], [3.0, 0.0, 7.0, 0.0], [-1.0, -3.0, 0.0, -5.0]]], [[[-2.0, 2.0, 2.0, -7.0], [-1.0, 3.0, -2.0, 0.0], [-1.0, 0.0, -3.0, 3.0]], [[-2.0, -1.0, -7.0, 6.0], [2.0, -5.0, 0.0, -5.0], [5.0, 1.0, 1.0, -6.0]]], [[[5.0, -4.0, 0.0, 4.0], [-2.0, -2.0, -2.0, -1.0], [0.0, 5.0, -5.0, -6.0]], [[0.0, -6.0, -3.0, 2.0], [-5.0, -3.0, 3.0, -4.0], [-3.0, 2.0, 5.0, 4.0]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[4.0, 6.0, -1.0, -2.0], [6.0, 3.0, 0.0, 0.0], [0.0, 0.0, 4.0, 0.0]], [[-2.0, 2.0, 2.0, -7.0], [-1.0, 3.0, -2.0, 0.0], [-1.0, 0.0, -3.0, 3.0]], [[5.0, -4.0, 0.0, 4.0], [-2.0, -2.0, -2.0, -1.0], [0.0, 5.0, -5.0, -6.0]]], [[[1.0, 1.0, 1.0, 5.0], [3.0, 0.0, 7.0, 0.0], [-1.0, -3.0, 0.0, -5.0]], [[-2.0, -1.0, -7.0, 6.0], [2.0, -5.0, 0.0, -5.0], [5.0, 1.0, 1.0, -6.0]], [[0.0, -6.0, -3.0, 2.0], [-5.0, -3.0, 3.0, -4.0], [-3.0, 2.0, 5.0, 4.0]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(2, 3, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_swapaxes_Symbol_rank4_axes_02(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=swap_axes(arg,axis0=0,axis1=2)  
       s=numpy.array([[[[-2.0, 7.0, -6.0, 0.0], [4.0, 7.0, 7.0, 0.0], [7.0, 7.0, 4.0, 3.0]], [[0.0, 4.0, 2.0, 6.0], [-1.0, 1.0, -6.0, -3.0], [-6.0, -7.0, 0.0, 4.0]]], [[[3.0, -4.0, 1.0, 7.0], [2.0, 7.0, 2.0, -1.0], [5.0, -4.0, 4.0, 0.0]], [[6.0, 0.0, 7.0, 6.0], [-4.0, -1.0, 5.0, 0.0], [6.0, 0.0, 6.0, -3.0]]], [[[-1.0, -3.0, 0.0, 6.0], [-1.0, 7.0, 7.0, -7.0], [1.0, 2.0, -7.0, -7.0]], [[-3.0, 7.0, 1.0, 1.0], [1.0, 7.0, 3.0, -6.0], [-6.0, -5.0, 0.0, 3.0]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[-2.0, 7.0, -6.0, 0.0], [3.0, -4.0, 1.0, 7.0], [-1.0, -3.0, 0.0, 6.0]], [[0.0, 4.0, 2.0, 6.0], [6.0, 0.0, 7.0, 6.0], [-3.0, 7.0, 1.0, 1.0]]], [[[4.0, 7.0, 7.0, 0.0], [2.0, 7.0, 2.0, -1.0], [-1.0, 7.0, 7.0, -7.0]], [[-1.0, 1.0, -6.0, -3.0], [-4.0, -1.0, 5.0, 0.0], [1.0, 7.0, 3.0, -6.0]]], [[[7.0, 7.0, 4.0, 3.0], [5.0, -4.0, 4.0, 0.0], [1.0, 2.0, -7.0, -7.0]], [[-6.0, -7.0, 0.0, 4.0], [6.0, 0.0, 6.0, -3.0], [-6.0, -5.0, 0.0, 3.0]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_swapaxes_Symbol_rank4_axes_03(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=swap_axes(arg,axis0=0,axis1=3)  
       s=numpy.array([[[[-3.0, 3.0, 0.0, -7.0], [1.0, 3.0, 3.0, -7.0], [-5.0, -3.0, -5.0, 7.0]], [[3.0, 4.0, -5.0, -5.0], [7.0, 7.0, 7.0, -1.0], [7.0, 2.0, 3.0, 2.0]]], [[[-7.0, 0.0, -6.0, 4.0], [1.0, -3.0, -3.0, 7.0], [-4.0, -2.0, 1.0, -5.0]], [[1.0, 0.0, -4.0, -4.0], [3.0, 5.0, 7.0, 5.0], [-6.0, -7.0, -2.0, 4.0]]], [[[-6.0, -1.0, -7.0, 6.0], [1.0, 6.0, -4.0, 4.0], [-5.0, -1.0, 7.0, 0.0]], [[2.0, 6.0, 4.0, -1.0], [-4.0, 7.0, 0.0, -2.0], [4.0, -6.0, 6.0, -3.0]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[-3.0, -7.0, -6.0], [1.0, 1.0, 1.0], [-5.0, -4.0, -5.0]], [[3.0, 1.0, 2.0], [7.0, 3.0, -4.0], [7.0, -6.0, 4.0]]], [[[3.0, 0.0, -1.0], [3.0, -3.0, 6.0], [-3.0, -2.0, -1.0]], [[4.0, 0.0, 6.0], [7.0, 5.0, 7.0], [2.0, -7.0, -6.0]]], [[[0.0, -6.0, -7.0], [3.0, -3.0, -4.0], [-5.0, 1.0, 7.0]], [[-5.0, -4.0, 4.0], [7.0, 7.0, 0.0], [3.0, -2.0, 6.0]]], [[[-7.0, 4.0, 6.0], [-7.0, 7.0, 4.0], [7.0, -5.0, 0.0]], [[-5.0, -4.0, -1.0], [-1.0, 5.0, -2.0], [2.0, 4.0, -3.0]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(4, 2, 3, 3),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_swapaxes_Symbol_rank4_axes_12(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=swap_axes(arg,axis0=1,axis1=2)  
       s=numpy.array([[[[4.0, -7.0, 0.0, -5.0], [-6.0, 2.0, 5.0, 0.0], [-4.0, -7.0, 0.0, 2.0]], [[0.0, -4.0, -1.0, 2.0], [4.0, 5.0, 6.0, 5.0], [-6.0, 7.0, 1.0, 6.0]]], [[[-7.0, -1.0, 4.0, 0.0], [6.0, 6.0, -4.0, 6.0], [-6.0, -6.0, -4.0, -2.0]], [[-3.0, -1.0, -6.0, -6.0], [4.0, 7.0, 2.0, -2.0], [-7.0, 5.0, 4.0, -5.0]]], [[[-7.0, 4.0, -2.0, -6.0], [-3.0, 6.0, -6.0, 2.0], [7.0, 3.0, 3.0, -5.0]], [[4.0, 0.0, 0.0, -7.0], [-3.0, -5.0, 3.0, 6.0], [0.0, 0.0, -7.0, -2.0]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[4.0, -7.0, 0.0, -5.0], [0.0, -4.0, -1.0, 2.0]], [[-6.0, 2.0, 5.0, 0.0], [4.0, 5.0, 6.0, 5.0]], [[-4.0, -7.0, 0.0, 2.0], [-6.0, 7.0, 1.0, 6.0]]], [[[-7.0, -1.0, 4.0, 0.0], [-3.0, -1.0, -6.0, -6.0]], [[6.0, 6.0, -4.0, 6.0], [4.0, 7.0, 2.0, -2.0]], [[-6.0, -6.0, -4.0, -2.0], [-7.0, 5.0, 4.0, -5.0]]], [[[-7.0, 4.0, -2.0, -6.0], [4.0, 0.0, 0.0, -7.0]], [[-3.0, 6.0, -6.0, 2.0], [-3.0, -5.0, 3.0, 6.0]], [[7.0, 3.0, 3.0, -5.0], [0.0, 0.0, -7.0, -2.0]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 3, 2, 4),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_swapaxes_Symbol_rank4_axes_13(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=swap_axes(arg,axis0=1,axis1=3)  
       s=numpy.array([[[[-1.0, 1.0, -3.0, 0.0], [0.0, 3.0, 6.0, 7.0], [5.0, 6.0, 4.0, 2.0]], [[-7.0, 1.0, 6.0, 7.0], [1.0, -5.0, 6.0, 2.0], [-6.0, -5.0, -3.0, 3.0]]], [[[4.0, 0.0, -3.0, 5.0], [0.0, 6.0, -2.0, 4.0], [7.0, 3.0, 0.0, -2.0]], [[-6.0, 7.0, -3.0, 6.0], [-2.0, -4.0, 4.0, -6.0], [0.0, -6.0, 7.0, -1.0]]], [[[-5.0, 1.0, -4.0, -2.0], [1.0, 4.0, -5.0, 1.0], [5.0, 1.0, 7.0, -3.0]], [[-7.0, 2.0, 3.0, -7.0], [6.0, 7.0, 0.0, 1.0], [7.0, -5.0, 0.0, -2.0]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[-1.0, -7.0], [0.0, 1.0], [5.0, -6.0]], [[1.0, 1.0], [3.0, -5.0], [6.0, -5.0]], [[-3.0, 6.0], [6.0, 6.0], [4.0, -3.0]], [[0.0, 7.0], [7.0, 2.0], [2.0, 3.0]]], [[[4.0, -6.0], [0.0, -2.0], [7.0, 0.0]], [[0.0, 7.0], [6.0, -4.0], [3.0, -6.0]], [[-3.0, -3.0], [-2.0, 4.0], [0.0, 7.0]], [[5.0, 6.0], [4.0, -6.0], [-2.0, -1.0]]], [[[-5.0, -7.0], [1.0, 6.0], [5.0, 7.0]], [[1.0, 2.0], [4.0, 7.0], [1.0, -5.0]], [[-4.0, 3.0], [-5.0, 0.0], [7.0, 0.0]], [[-2.0, -7.0], [1.0, 1.0], [-3.0, -2.0]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 4, 3, 2),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_swapaxes_Symbol_rank4_axes_23(self):  
       arg=Symbol(shape=(3, 2, 3, 4))  
       res=swap_axes(arg,axis0=2,axis1=3)  
       s=numpy.array([[[[4.0, 7.0, 5.0, 0.0], [6.0, -5.0, -2.0, 7.0], [-2.0, 5.0, -7.0, -3.0]], [[-5.0, -2.0, -7.0, -1.0], [5.0, 4.0, 2.0, -2.0], [0.0, 6.0, 2.0, -1.0]]], [[[7.0, -5.0, 0.0, -2.0], [5.0, -7.0, 5.0, 2.0], [-6.0, 5.0, 4.0, 1.0]], [[4.0, -4.0, -3.0, 5.0], [-2.0, 4.0, -5.0, -5.0], [-3.0, 0.0, 7.0, -3.0]]], [[[-6.0, 7.0, -6.0, 6.0], [0.0, 5.0, 0.0, 6.0], [-4.0, 0.0, -5.0, 0.0]], [[-7.0, -2.0, 5.0, 0.0], [5.0, 4.0, -4.0, 6.0], [0.0, 6.0, 5.0, -7.0]]]])  
       sub=res.substitute({arg:s})  
       ref=numpy.array([[[[4.0, 6.0, -2.0], [7.0, -5.0, 5.0], [5.0, -2.0, -7.0], [0.0, 7.0, -3.0]], [[-5.0, 5.0, 0.0], [-2.0, 4.0, 6.0], [-7.0, 2.0, 2.0], [-1.0, -2.0, -1.0]]], [[[7.0, 5.0, -6.0], [-5.0, -7.0, 5.0], [0.0, 5.0, 4.0], [-2.0, 2.0, 1.0]], [[4.0, -2.0, -3.0], [-4.0, 4.0, 0.0], [-3.0, -5.0, 7.0], [5.0, -5.0, -3.0]]], [[[-6.0, 0.0, -4.0], [7.0, 5.0, 0.0], [-6.0, 0.0, -5.0], [6.0, 6.0, 0.0]], [[-7.0, 5.0, 0.0], [-2.0, 4.0, 6.0], [5.0, -4.0, 5.0], [0.0, 6.0, -7.0]]]])  
       self.failUnless(isinstance(res,Symbol),"wrong type of result.")  
       self.failUnlessEqual(res.getShape(),(3, 2, 4, 3),"wrong shape of result.")  
       self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
5623     def test_swapaxes_constData_rank2_axes_01(self):     def test_swapaxes_constData_rank2_axes_01(self):
5624        arg=Data(numpy.array([[-6.0, 4.0, 7.0, 7.0, -5.0], [-5.0, 2.0, 7.0, 6.0, 1.0], [0.0, 3.0, -6.0, 4.0, -7.0], [-4.0, 5.0, 0.0, 0.0, 3.0]]),self.functionspace)        arg=Data(numpy.array([[-6.0, 4.0, 7.0, 7.0, -5.0], [-5.0, 2.0, 7.0, 6.0, 1.0], [0.0, 3.0, -6.0, 4.0, -7.0], [-4.0, 5.0, 0.0, 0.0, 3.0]]),self.functionspace)
5625        res=swap_axes(arg,axis0=0,axis1=1)        res=swap_axes(arg,axis0=0,axis1=1)

Legend:
Removed from v.3492  
changed lines
  Added in v.3493

  ViewVC Help
Powered by ViewVC 1.1.26