/[escript]/trunk/escript/py_src/test_util.py
ViewVC logotype

Diff of /trunk/escript/py_src/test_util.py

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

revision 287 by gross, Thu Dec 1 06:40:51 2005 UTC revision 341 by gross, Mon Dec 12 05:26:10 2005 UTC
# Line 55  This test assumes that the functionspace Line 55  This test assumes that the functionspace
55  __author__="Lutz Gross, l.gross@uq.edu.au"  __author__="Lutz Gross, l.gross@uq.edu.au"
56  __licence__="contact: esys@access.uq.edu.au"  __licence__="contact: esys@access.uq.edu.au"
57  __url__="http://www.iservo.edu.au/esys/escript"  __url__="http://www.iservo.edu.au/esys/escript"
58  __version__="$Revision$"  __version__="$Revision: 313 $"
59  __date__="$Date$"  __date__="$Date$"
60    
61  import unittest  import unittest
# Line 10325  class Test_util_unary_no_tagged_data(Tes Line 10325  class Test_util_unary_no_tagged_data(Tes
10325        arg=numarray.array(45.1686859861)        arg=numarray.array(45.1686859861)
10326        res=log10(arg)        res=log10(arg)
10327        ref=numarray.array(1.65483745657)        ref=numarray.array(1.65483745657)
10328        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
10329        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
10330             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
10331        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
10332     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10333     def test_log10_array_rank1(self):     def test_log10_array_rank1(self):
# Line 10512  class Test_util_unary_no_tagged_data(Tes Line 10513  class Test_util_unary_no_tagged_data(Tes
10513        arg=numarray.array(-15.0739210922)        arg=numarray.array(-15.0739210922)
10514        res=wherePositive(arg)        res=wherePositive(arg)
10515        ref=numarray.array(0.0)        ref=numarray.array(0.0)
10516        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
10517        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
10518             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
10519        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
10520     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10521     def test_wherePositive_array_rank1(self):     def test_wherePositive_array_rank1(self):
# Line 10699  class Test_util_unary_no_tagged_data(Tes Line 10701  class Test_util_unary_no_tagged_data(Tes
10701        arg=numarray.array(12.3306392667)        arg=numarray.array(12.3306392667)
10702        res=whereNegative(arg)        res=whereNegative(arg)
10703        ref=numarray.array(0.0)        ref=numarray.array(0.0)
10704        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
10705        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
10706             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
10707        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
10708     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10709     def test_whereNegative_array_rank1(self):     def test_whereNegative_array_rank1(self):
# Line 10886  class Test_util_unary_no_tagged_data(Tes Line 10889  class Test_util_unary_no_tagged_data(Tes
10889        arg=numarray.array(-77.2396345376)        arg=numarray.array(-77.2396345376)
10890        res=whereNonNegative(arg)        res=whereNonNegative(arg)
10891        ref=numarray.array(0.0)        ref=numarray.array(0.0)
10892        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
10893        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
10894             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
10895        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
10896     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10897     def test_whereNonNegative_array_rank1(self):     def test_whereNonNegative_array_rank1(self):
# Line 11073  class Test_util_unary_no_tagged_data(Tes Line 11077  class Test_util_unary_no_tagged_data(Tes
11077        arg=numarray.array(-63.8959249588)        arg=numarray.array(-63.8959249588)
11078        res=whereNonPositive(arg)        res=whereNonPositive(arg)
11079        ref=numarray.array(1.0)        ref=numarray.array(1.0)
11080        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
11081        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
11082             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
11083        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
11084     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11085     def test_whereNonPositive_array_rank1(self):     def test_whereNonPositive_array_rank1(self):
# Line 11260  class Test_util_unary_no_tagged_data(Tes Line 11265  class Test_util_unary_no_tagged_data(Tes
11265        arg=numarray.array(-93.2286970236)        arg=numarray.array(-93.2286970236)
11266        res=whereZero(arg)        res=whereZero(arg)
11267        ref=numarray.array(0.0)        ref=numarray.array(0.0)
11268        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
11269        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
11270             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
11271        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
11272     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11273     def test_whereZero_array_rank1(self):     def test_whereZero_array_rank1(self):
# Line 11447  class Test_util_unary_no_tagged_data(Tes Line 11453  class Test_util_unary_no_tagged_data(Tes
11453        arg=numarray.array(71.1859507003)        arg=numarray.array(71.1859507003)
11454        res=whereNonZero(arg)        res=whereNonZero(arg)
11455        ref=numarray.array(1.0)        ref=numarray.array(1.0)
11456        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
11457        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
11458             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
11459        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
11460     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11461     def test_whereNonZero_array_rank1(self):     def test_whereNonZero_array_rank1(self):
# Line 11634  class Test_util_unary_no_tagged_data(Tes Line 11641  class Test_util_unary_no_tagged_data(Tes
11641        arg=numarray.array(-19.1395275546)        arg=numarray.array(-19.1395275546)
11642        res=sin(arg)        res=sin(arg)
11643        ref=numarray.array(-0.285925042532)        ref=numarray.array(-0.285925042532)
11644        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
11645        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
11646             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
11647        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
11648     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11649     def test_sin_array_rank1(self):     def test_sin_array_rank1(self):
# Line 11821  class Test_util_unary_no_tagged_data(Tes Line 11829  class Test_util_unary_no_tagged_data(Tes
11829        arg=numarray.array(81.9030902279)        arg=numarray.array(81.9030902279)
11830        res=cos(arg)        res=cos(arg)
11831        ref=numarray.array(0.975529175116)        ref=numarray.array(0.975529175116)
11832        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
11833        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
11834             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
11835        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
11836     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11837     def test_cos_array_rank1(self):     def test_cos_array_rank1(self):
# Line 12008  class Test_util_unary_no_tagged_data(Tes Line 12017  class Test_util_unary_no_tagged_data(Tes
12017        arg=numarray.array(90.0547372602)        arg=numarray.array(90.0547372602)
12018        res=tan(arg)        res=tan(arg)
12019        ref=numarray.array(-1.74918567862)        ref=numarray.array(-1.74918567862)
12020        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
12021        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
12022             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
12023        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
12024     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12025     def test_tan_array_rank1(self):     def test_tan_array_rank1(self):
# Line 12195  class Test_util_unary_no_tagged_data(Tes Line 12205  class Test_util_unary_no_tagged_data(Tes
12205        arg=numarray.array(-0.116366973393)        arg=numarray.array(-0.116366973393)
12206        res=asin(arg)        res=asin(arg)
12207        ref=numarray.array(-0.116631212893)        ref=numarray.array(-0.116631212893)
12208        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
12209        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
12210             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
12211        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
12212     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12213     def test_asin_array_rank1(self):     def test_asin_array_rank1(self):
# Line 12382  class Test_util_unary_no_tagged_data(Tes Line 12393  class Test_util_unary_no_tagged_data(Tes
12393        arg=numarray.array(0.826889176675)        arg=numarray.array(0.826889176675)
12394        res=acos(arg)        res=acos(arg)
12395        ref=numarray.array(0.597243033529)        ref=numarray.array(0.597243033529)
12396        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
12397        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
12398             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
12399        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
12400     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12401     def test_acos_array_rank1(self):     def test_acos_array_rank1(self):
# Line 12569  class Test_util_unary_no_tagged_data(Tes Line 12581  class Test_util_unary_no_tagged_data(Tes
12581        arg=numarray.array(-21.3588712779)        arg=numarray.array(-21.3588712779)
12582        res=atan(arg)        res=atan(arg)
12583        ref=numarray.array(-1.5240115377)        ref=numarray.array(-1.5240115377)
12584        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
12585        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
12586             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
12587        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
12588     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12589     def test_atan_array_rank1(self):     def test_atan_array_rank1(self):
# Line 12756  class Test_util_unary_no_tagged_data(Tes Line 12769  class Test_util_unary_no_tagged_data(Tes
12769        arg=numarray.array(2.05667480474)        arg=numarray.array(2.05667480474)
12770        res=sinh(arg)        res=sinh(arg)
12771        ref=numarray.array(3.84602263608)        ref=numarray.array(3.84602263608)
12772        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
12773        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
12774             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
12775        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
12776     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12777     def test_sinh_array_rank1(self):     def test_sinh_array_rank1(self):
# Line 12943  class Test_util_unary_no_tagged_data(Tes Line 12957  class Test_util_unary_no_tagged_data(Tes
12957        arg=numarray.array(-3.22296171288)        arg=numarray.array(-3.22296171288)
12958        res=cosh(arg)        res=cosh(arg)
12959        ref=numarray.array(12.5710965319)        ref=numarray.array(12.5710965319)
12960        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
12961        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
12962             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
12963        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
12964     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12965     def test_cosh_array_rank1(self):     def test_cosh_array_rank1(self):
# Line 13130  class Test_util_unary_no_tagged_data(Tes Line 13145  class Test_util_unary_no_tagged_data(Tes
13145        arg=numarray.array(-1.1594273991)        arg=numarray.array(-1.1594273991)
13146        res=tanh(arg)        res=tanh(arg)
13147        ref=numarray.array(-0.820853186665)        ref=numarray.array(-0.820853186665)
13148        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
13149        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
13150             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
13151        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
13152     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
13153     def test_tanh_array_rank1(self):     def test_tanh_array_rank1(self):
# Line 13317  class Test_util_unary_no_tagged_data(Tes Line 13333  class Test_util_unary_no_tagged_data(Tes
13333        arg=numarray.array(-28.2897331664)        arg=numarray.array(-28.2897331664)
13334        res=asinh(arg)        res=asinh(arg)
13335        ref=numarray.array(-4.03595836682)        ref=numarray.array(-4.03595836682)
13336        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
13337        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
13338             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
13339        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
13340     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
13341     def test_asinh_array_rank1(self):     def test_asinh_array_rank1(self):
# Line 13504  class Test_util_unary_no_tagged_data(Tes Line 13521  class Test_util_unary_no_tagged_data(Tes
13521        arg=numarray.array(79.3820855421)        arg=numarray.array(79.3820855421)
13522        res=acosh(arg)        res=acosh(arg)
13523        ref=numarray.array(5.0673802251)        ref=numarray.array(5.0673802251)
13524        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
13525        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
13526             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
13527        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
13528     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
13529     def test_acosh_array_rank1(self):     def test_acosh_array_rank1(self):
# Line 13691  class Test_util_unary_no_tagged_data(Tes Line 13709  class Test_util_unary_no_tagged_data(Tes
13709        arg=numarray.array(-0.30414451933)        arg=numarray.array(-0.30414451933)
13710        res=atanh(arg)        res=atanh(arg)
13711        ref=numarray.array(-0.314080283997)        ref=numarray.array(-0.314080283997)
13712        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
13713        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
13714             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
13715        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
13716     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
13717     def test_atanh_array_rank1(self):     def test_atanh_array_rank1(self):
# Line 13878  class Test_util_unary_no_tagged_data(Tes Line 13897  class Test_util_unary_no_tagged_data(Tes
13897        arg=numarray.array(3.06107617426)        arg=numarray.array(3.06107617426)
13898        res=exp(arg)        res=exp(arg)
13899        ref=numarray.array(21.3505216848)        ref=numarray.array(21.3505216848)
13900        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
13901        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
13902             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
13903        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
13904     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
13905     def test_exp_array_rank1(self):     def test_exp_array_rank1(self):
# Line 14065  class Test_util_unary_no_tagged_data(Tes Line 14085  class Test_util_unary_no_tagged_data(Tes
14085        arg=numarray.array(34.7398492007)        arg=numarray.array(34.7398492007)
14086        res=sqrt(arg)        res=sqrt(arg)
14087        ref=numarray.array(5.89405201883)        ref=numarray.array(5.89405201883)
14088        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
14089        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
14090             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
14091        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14092     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14093     def test_sqrt_array_rank1(self):     def test_sqrt_array_rank1(self):
# Line 14252  class Test_util_unary_no_tagged_data(Tes Line 14273  class Test_util_unary_no_tagged_data(Tes
14273        arg=numarray.array(15.4265888534)        arg=numarray.array(15.4265888534)
14274        res=log(arg)        res=log(arg)
14275        ref=numarray.array(2.73609256957)        ref=numarray.array(2.73609256957)
14276        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
14277        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
14278             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
14279        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14280     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14281     def test_log_array_rank1(self):     def test_log_array_rank1(self):
# Line 14439  class Test_util_unary_no_tagged_data(Tes Line 14461  class Test_util_unary_no_tagged_data(Tes
14461        arg=numarray.array(-96.6649118156)        arg=numarray.array(-96.6649118156)
14462        res=sign(arg)        res=sign(arg)
14463        ref=numarray.array(-1.0)        ref=numarray.array(-1.0)
14464        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
14465        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
14466             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
14467        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14468     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14469     def test_sign_array_rank1(self):     def test_sign_array_rank1(self):
# Line 14626  class Test_util_unary_no_tagged_data(Tes Line 14649  class Test_util_unary_no_tagged_data(Tes
14649        arg=numarray.array(38.7009229865)        arg=numarray.array(38.7009229865)
14650        res=abs(arg)        res=abs(arg)
14651        ref=numarray.array(38.7009229865)        ref=numarray.array(38.7009229865)
14652        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
14653        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
14654             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
14655        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14656     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14657     def test_abs_array_rank1(self):     def test_abs_array_rank1(self):
# Line 14801  class Test_util_unary_no_tagged_data(Tes Line 14825  class Test_util_unary_no_tagged_data(Tes
14825        self.failUnless(isinstance(res,Symbol),"wrong type of result.")        self.failUnless(isinstance(res,Symbol),"wrong type of result.")
14826        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
14827        self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14828       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14829       def test_length_float_rank0(self):
14830          arg=-0.510102533262
14831          res=length(arg)
14832          ref=0.510102533262
14833          self.failUnless(isinstance(res,float),"wrong type of result.")
14834          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14835       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14836       def test_length_array_rank0(self):
14837          arg=numarray.array(0.991109436523)
14838          res=length(arg)
14839          ref=numarray.array(0.991109436523)
14840          if not isinstance(res,float):
14841             self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
14842             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
14843          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14844       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14845       def test_length_array_rank1(self):
14846          arg=numarray.array([-0.76294483500740484, 0.011677546682929307])
14847          res=length(arg)
14848          ref=numarray.array(0.763034197373)
14849          if not isinstance(res,float):
14850             self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
14851             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
14852          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14853       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14854       def test_length_array_rank2(self):
14855          arg=numarray.array([[0.43339000667591221, -0.56813106354058163, -0.70722435943768658, 0.31944814927174714, 0.79536111956010869], [-0.58324348156333672, -0.43307121633826595, 0.32581231177090197, 0.71482009238312316, -0.21002576061225442], [-0.49917603582374914, -0.63591527310476903, -0.87332002545344389, -0.91612221194664523, -0.93005892936163725], [-0.19058313727475529, -0.099980978412387289, 0.065023988386496923, -0.50908214426833687, 0.50919445067665525]])
14856          res=length(arg)
14857          ref=numarray.array(2.57369396272)
14858          if not isinstance(res,float):
14859              self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
14860              self.failUnlessEqual(res.shape,(),"wrong shape of result.")
14861          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14862       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14863       def test_length_array_rank3(self):
14864          arg=numarray.array([[[-0.9803545808261207, 0.16576061210577353], [-0.30011375458769374, 0.36782112416630941]], [[0.71430934303489013, 0.031917178828326564], [0.62738715091020936, -0.53865697329064433]], [[-0.39594881663888426, 0.51031034827379074], [-0.65321242269094326, 0.066960424832211762]], [[0.21295172167752496, 0.043385792033981962], [0.21039492093814283, -0.45875763326068775]], [[-0.14049283840925275, -0.43861027040015732], [-0.23520058218222872, -0.82264226361451076]], [[0.54845190061311566, 0.51238745343929559], [0.77453965957753224, 0.63412987812923882]]])
14865          res=length(arg)
14866          ref=numarray.array(2.46349793439)
14867          if not isinstance(res,float):
14868              self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
14869              self.failUnlessEqual(res.shape,(),"wrong shape of result.")
14870          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14871       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14872       def test_length_array_rank4(self):
14873          arg=numarray.array([[[[-0.0089365634034204167, -0.84148551298030028, -0.86751121336543813, -0.15969541886143923], [-0.094576010082227269, -0.29859956741061855, -0.9668492649640319, 0.85706900506152772], [-0.53010678888957452, 0.23317712237751809, -0.54934453799322802, 0.63239069375979762]], [[-0.13286296817699417, 0.38304157353272172, 0.94879997873099398, -0.41152562922857516], [-0.084699118599110834, -0.77799719953735957, -0.73697310382304981, -0.57686761933311148], [-0.691418224706843, 0.86481171901741027, -0.65768637189088874, -0.36467431513366044]]], [[[-0.84165953650117875, -0.030676018280178408, 0.68829493775738415, -0.3155228468519129], [-0.7871478173248736, -0.079032190579141126, -0.2177526168512447, -0.22662606238170069], [-0.36280488027671387, -0.30025872969028122, -0.1153990482492997, -0.64384164007636602]], [[0.43765759938201887, -0.83664343730186874, 0.20723950229710386, -0.56690864703827692], [-0.5752004595601341, 0.45715366983278116, -0.60791501104508927, -0.12584705515500483], [0.013022887283654638, -0.82203757609388917, 0.2276716578033573, -0.82649410580263871]]], [[[-0.73587736736778697, -0.075026122599631151, 0.47107705394337485, -0.5188872506774429], [-0.91844772159081667, -0.17389147261342175, -0.53243380583847233, -0.25336755215727336], [-0.7085054821135035, 0.92376667162885795, 0.31427206042606071, 0.58305001351683972]], [[0.021860457140477907, -0.21893493890938442, 0.78089201272561026, -0.30413016651663138], [0.57250768478386815, 0.12062954871057352, -0.39418583967206589, 0.81081960816290599], [-0.62197759509633688, 0.26606514367555634, -0.71790752119252188, -0.75228782860426513]]]])
14874          res=length(arg)
14875          ref=numarray.array(4.74889961553)
14876          if not isinstance(res,float):
14877              self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
14878              self.failUnlessEqual(res.shape,(),"wrong shape of result.")
14879          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14880       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14881       def test_length_constData_rank0(self):
14882          arg=Data(-0.621348324338,self.functionspace)
14883          res=length(arg)
14884          ref=Data(0.621348324338,self.functionspace)
14885          self.failUnless(isinstance(res,Data),"wrong type of result.")
14886          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14887          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14888       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14889       def test_length_constData_rank1(self):
14890          arg=Data(numarray.array([0.32933097146312651, 0.074695318351896134]),self.functionspace)
14891          res=length(arg)
14892          ref=Data(0.337695542388,self.functionspace)
14893          self.failUnless(isinstance(res,Data),"wrong type of result.")
14894          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14895          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14896       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14897       def test_length_constData_rank2(self):
14898          arg=Data(numarray.array([[-0.78192059954553383, -0.90936771512644765, -0.62922561123663545, 0.017784281736960006, 0.9748747532171671], [0.058303280563049231, -0.2728591332910737, 0.031130134154037092, -0.77308681021304904, -0.11934107563523066], [0.16559555223913947, 0.42636646304641856, -0.57573933774337149, 0.94979031593856034, 0.50631731019815573], [0.93403604481436431, -0.93439497144943484, -0.41539043658961994, -0.19785740903293636, -0.37401756164552413]]),self.functionspace)
14899          res=length(arg)
14900          ref=Data(2.69665449585,self.functionspace)
14901          self.failUnless(isinstance(res,Data),"wrong type of result.")
14902          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14903          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14904       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14905       def test_length_constData_rank3(self):
14906          arg=Data(numarray.array([[[-0.56969059522354204, 0.080095572899512968], [0.10882275113239914, 0.5219995791238794]], [[-0.45702291442137533, -0.48209810378998008], [-0.45061700485329181, 0.13409269350080355]], [[0.82959328262385434, 0.43146697783249], [-0.17051774940195052, -0.11306038728528978]], [[0.1343766654439873, 0.26708535580201764], [-0.72182400606958974, 0.68503438438868658]], [[0.63507734978497932, 0.20722711779440695], [0.096695049458556781, -0.72783199691610112]], [[0.15899265871592516, -0.59393453523719764], [0.81362670777065538, 0.44781346438355851]]]),self.functionspace)
14907          res=length(arg)
14908          ref=Data(2.34509551447,self.functionspace)
14909          self.failUnless(isinstance(res,Data),"wrong type of result.")
14910          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14911          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14912       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14913       def test_length_constData_rank4(self):
14914          arg=Data(numarray.array([[[[-0.15764527853259791, -0.30365168015204125, 0.47795233787343117, -0.98256953311171458], [0.0042986463256691199, 0.8035927446211617, -0.16701915572918757, 0.71275425093914158], [-0.96088340875110778, 0.44246392270280177, -0.86258499735816296, -0.83799786987315006]], [[0.9570143548429173, 0.038448779070990424, -0.85758098571845975, 0.54765015129054828], [-0.87491827027518299, -0.45074431963780448, -0.3985454061322331, -0.96368920535242153], [0.68864777189463311, 0.08364027809503205, -0.15072701440063496, 0.37493446731949942]]], [[[-0.40037966034446559, -0.20439352375445297, -0.00083579211732121017, 0.71146162550419212], [0.57902779303828478, 0.36965035149772829, -0.80710960825758327, -0.22291291503275867], [-0.050754745699356008, -0.74788880214762354, -0.29584218595779421, -0.15944687137497104]], [[-0.22559210423055043, -0.39361850034269019, -0.38362580334572582, 0.45418102497613622], [0.42704140840065086, -0.16313142654556012, 0.27467683038933854, -0.92068758637216352], [-0.25578430722641832, -0.83470097064580551, 0.3737146950202388, 0.77547342867161784]]], [[[0.7869046231589758, 0.42798876622613702, 0.063281236738654822, 0.90878329459830454], [0.9439304175181531, 0.50711996212079513, -0.23938857199714936, 0.55774844240445276], [0.5514271888482718, -0.71911109998895695, -0.079482513135118893, -0.50190162484878265]], [[-0.075988757174491495, 0.21390351071272762, -0.34834540192677776, -0.67335194629906114], [0.10253847169273911, 0.63514982365898098, 0.54802667295899443, -0.16433191310464568], [-0.74944750341855726, 0.99070513266942384, -0.55535271544968623, 0.41204768838694661]]]]),self.functionspace)
14915          res=length(arg)
14916          ref=Data(4.80409161546,self.functionspace)
14917          self.failUnless(isinstance(res,Data),"wrong type of result.")
14918          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14919          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14920       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14921       def test_length_expandedData_rank0(self):
14922          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
14923          arg=msk_arg*(0.883776938505)+(1.-msk_arg)*(-0.0468902435277)
14924          res=length(arg)
14925          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
14926          ref=msk_ref*(0.883776938505)+(1.-msk_ref)*(0.0468902435277)
14927          self.failUnless(isinstance(res,Data),"wrong type of result.")
14928          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14929          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14930       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14931       def test_length_expandedData_rank1(self):
14932          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
14933          arg=msk_arg*numarray.array([-0.58845041644366813, 0.84032988075424919])+(1.-msk_arg)*numarray.array([0.24641851124094183, -0.83673496226594679])
14934          res=length(arg)
14935          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
14936          ref=msk_ref*(1.0258792332)+(1.-msk_ref)*(0.872265716259)
14937          self.failUnless(isinstance(res,Data),"wrong type of result.")
14938          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14939          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14940       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14941       def test_length_expandedData_rank2(self):
14942          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
14943          arg=msk_arg*numarray.array([[-0.29586555942077419, 0.34274407148638875, -0.88727513948396664, 0.27160261149044485, 0.21413449360849302], [0.28011027275430478, 0.75357944869733395, 0.24679947624917853, 0.23083266549318582, -0.031185959204752756], [0.80951928180904842, 0.1946069687658758, 0.19231558044922537, -0.78993705668305569, -0.34498118770326403], [-0.90798215978462582, 0.36396049398056696, -0.99479482070441749, 0.71319176756439284, -0.173316315027086]])+(1.-msk_arg)*numarray.array([[0.78326921791525206, 0.44780263366625617, 0.90004049588763002, 0.86601571330532723, 0.89302226317470446], [-0.49280621379733769, 0.032223308649646842, -0.063785824564493776, -0.45830913844852361, 0.75573504780401213], [0.029363497650474857, 0.3732291937763248, -0.23856608969815407, -0.78387113786982909, 0.51309780260863525], [-0.055709228333384875, 0.47635746182366057, 0.69511257282026917, -0.70929759063656039, 0.65249778651689483]])
14944          res=length(arg)
14945          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
14946          ref=msk_ref*(2.41490921017)+(1.-msk_ref)*(2.63013072264)
14947          self.failUnless(isinstance(res,Data),"wrong type of result.")
14948          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14949          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14950       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14951       def test_length_expandedData_rank3(self):
14952          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
14953          arg=msk_arg*numarray.array([[[-0.46999515470673003, 0.35828008438348191], [-0.75807606560681484, 0.17336937881565895]], [[0.50255994290015416, 0.74389850916125733], [0.56251892098022993, -0.77887021071121221]], [[-0.94958377643932868, -0.55488659642221627], [-0.81161288797652253, 0.80725266426883979]], [[-0.38519127035487832, 0.85595943718503564], [-0.54032736868611431, -0.93807094048446449]], [[-0.18354593266618413, -0.14323695746161924], [-0.41586461136365327, 0.83381306861717031]], [[-0.56427207094458476, 0.47224479851988166], [-0.93279101876654669, -0.48877724755416652]]])+(1.-msk_arg)*numarray.array([[[0.86959183228486547, -0.46716569229451088], [0.3766416916310138, -0.26875186058841827]], [[-0.85315616483044532, -0.44895823472349328], [-0.019719427383600552, 0.87331397676878764]], [[0.18450481536393126, -0.93079080072281672], [-0.51399520036784985, 0.02094393310881526]], [[0.34454271397516889, -0.057292572357173555], [0.88270644599519299, 0.55068444546064366]], [[0.79135120340267306, -0.21348692991823648], [0.56803236664975065, 0.91336197474998104]], [[0.16655314750502104, -0.42962978230839477], [0.44885045412539593, 0.42912119101208823]]])
14954          res=length(arg)
14955          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
14956          ref=msk_ref*(3.13508828546)+(1.-msk_ref)*(2.77076207142)
14957          self.failUnless(isinstance(res,Data),"wrong type of result.")
14958          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14959          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14960       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14961       def test_length_expandedData_rank4(self):
14962          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
14963          arg=msk_arg*numarray.array([[[[-0.93886781108675321, 0.75905716358672759, 0.37094825123593167, -0.19680193477839869], [-0.69130982226153326, -0.097833952605903773, -0.18032702039691939, -0.65126134878000252], [-0.50441371581635863, 0.19853216992359735, 0.75211775926254854, 0.93313886601723994]], [[-0.81202720654711702, 0.39117544309224295, 0.32422500396848175, -0.86970863899495798], [0.15860494885441168, -0.99388324869686295, -0.6126507983503755, 0.45539570478611968], [-0.29981340221794484, 0.43378007384304418, -0.07804401429490726, 0.10520159837508403]]], [[[-0.067360545733815114, -0.75432265949843069, 0.23150713101298548, -0.62781393972269117], [0.16588303814612515, 0.6338577465238171, 0.44543958860038324, -0.6116568441601038], [0.62085456412712414, -0.59591336867783595, 0.31657816819520201, 0.96855037419698409]], [[0.89768670071243273, 0.047512605872325642, 0.38802965964728497, -0.047024004368128258], [0.28534214825759774, 0.79378823415801558, -0.41325077352252704, -0.41319182463438486], [-0.41172433227767002, -0.99248504691886752, -0.61435540813756728, -0.79377934237436421]]], [[[0.31056101760667421, 0.03997905342037944, -0.54839575574971211, -0.54963398878208447], [-0.19258715091848266, -0.67023816299126682, -0.61922833170488634, -0.3132139396514777], [0.95178737480931175, -0.84632696057445056, -0.043652087473059931, -0.39857277601740737]], [[-0.91850296338642701, 0.72749660991813925, 0.4827895084985423, -0.10560131182372157], [-0.91003622797953954, 0.35676038745111271, -0.26082661035830013, -0.12361013193170001], [-0.22592227457768388, -0.20389666165635489, -0.008049373422560846, -0.50062341851266434]]]])+(1.-msk_arg)*numarray.array([[[[-0.021088077793533166, 0.62042392362261389, -0.90699620151616278, 0.83244686127694245], [-0.65935596202227198, 0.2773135818931769, -0.14671290779705948, -0.42303151477725387], [-0.67360170011508336, -0.94136391147369758, 0.60593006592988452, 0.53271662567479994]], [[-0.68567319305989449, -0.33687160212342526, 0.48445948721184595, 0.8639977742197007], [0.41684351239404371, -0.47583440168725621, 0.46055807978272645, 0.19279035992433058], [0.83098230075402957, -0.7973760655728046, 0.22342511963387834, -0.89134877289705128]]], [[[0.35974286191438831, 0.21872434629252235, -0.63220544985048988, -0.52612039893949269], [-0.34493816049763404, -0.34015531655509457, 0.44937887672159205, -0.58847483438357262], [-0.34681966794346097, -0.91972234941106046, -0.51080277628557447, 0.45147645224503452]], [[0.70760788343718772, -0.031664619981034203, -0.16729804256437064, -0.80164830175689361], [0.97863767766204868, 0.91357020902462205, -0.0895749852663974, 0.50091501286651696], [-0.88377743658291208, 0.4536825024535025, 0.61591907060400253, 0.57165024614346471]]], [[[-0.37160858934673713, 0.50843004647167334, 0.39647835504208251, 0.28802988212615177], [-0.9374130465768602, -0.97417359787823421, -0.54320852345322379, 0.48577720898699028], [-0.95423595276764428, 0.033048674364561048, 0.69837226182049372, 0.037284034055920845]], [[-0.18095086863386811, 0.51687760740956334, -0.035166388385410308, -0.54024030399678025], [0.15723730135407932, 0.57872797253456132, -0.50187686605795045, -0.19174626179381882], [-0.36712116936754535, -0.94080998057238707, -0.84929322547542996, 0.46359997819244714]]]])
14964          res=length(arg)
14965          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
14966          ref=msk_ref*(4.72250379236)+(1.-msk_ref)*(4.95651187575)
14967          self.failUnless(isinstance(res,Data),"wrong type of result.")
14968          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14969          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14970       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14971       def test_length_Symbol_rank0(self):
14972          arg=Symbol(shape=())
14973          res=length(arg)
14974          s=numarray.array(-0.789837980175)
14975          sub=res.substitute({arg:s})
14976          ref=numarray.array(0.789837980175)
14977          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
14978          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14979          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14980       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14981       def test_length_Symbol_rank1(self):
14982          arg=Symbol(shape=(2,))
14983          res=length(arg)
14984          s=numarray.array([-0.99278720130643516, -0.31635710603880374])
14985          sub=res.substitute({arg:s})
14986          ref=numarray.array(1.04197324611)
14987          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
14988          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14989          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14990       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14991       def test_length_Symbol_rank2(self):
14992          arg=Symbol(shape=(4, 5))
14993          res=length(arg)
14994          s=numarray.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]])
14995          sub=res.substitute({arg:s})
14996          ref=numarray.array(3.04731243366)
14997          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
14998          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14999          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15000       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15001       def test_length_Symbol_rank3(self):
15002          arg=Symbol(shape=(6, 2, 2))
15003          res=length(arg)
15004          s=numarray.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]]])
15005          sub=res.substitute({arg:s})
15006          ref=numarray.array(2.99147603017)
15007          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15008          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15009          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15010       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15011       def test_length_Symbol_rank4(self):
15012          arg=Symbol(shape=(3, 2, 3, 4))
15013          res=length(arg)
15014          s=numarray.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]]]])
15015          sub=res.substitute({arg:s})
15016          ref=numarray.array(4.83951826943)
15017          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15018          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15019          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15020       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15021       def test_maxval_float_rank0(self):
15022          arg=0.315854880825
15023          res=maxval(arg)
15024          ref=0.315854880825
15025          self.failUnless(isinstance(res,float),"wrong type of result.")
15026          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15027       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15028       def test_maxval_array_rank0(self):
15029          arg=numarray.array(-0.377472785293)
15030          res=maxval(arg)
15031          ref=numarray.array(-0.377472785293)
15032          self.failUnless(isinstance(res,float),"wrong type of result.")
15033          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15034       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15035       def test_maxval_array_rank1(self):
15036          arg=numarray.array([0.67183156228324403, 0.98323683252360539])
15037          res=maxval(arg)
15038          ref=numarray.array(0.983236832524)
15039          self.failUnless(isinstance(res,float),"wrong type of result.")
15040          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15041       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15042       def test_maxval_array_rank2(self):
15043          arg=numarray.array([[0.84034096955817894, 0.29665901063728572, -0.42190010384108523, -0.7150438773637906, 0.14643629018234949], [0.22677764147443136, 0.14594960752890751, -0.74161102103554177, -0.042525371203158802, 0.45739481907885904], [0.92281820938114612, -0.74136143299473378, -0.082616726724768386, 0.024796098776131537, -0.26761237274922411], [0.44638984793823289, 0.45566292575391332, -0.45703791845559705, 0.96294823838515708, 0.20865001046980014]])
15044          res=maxval(arg)
15045          ref=numarray.array(0.962948238385)
15046          self.failUnless(isinstance(res,float),"wrong type of result.")
15047          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15048       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15049       def test_maxval_array_rank3(self):
15050          arg=numarray.array([[[-0.69786738686010863, 0.22220015828286921], [0.39818252195561255, 0.62828383756907602]], [[-0.30663179429588383, 0.58142297666853637], [0.58551100004900891, -0.26454346793231442]], [[0.82280266855051476, -0.89955650739217519], [0.0091889934169460119, -0.10055418070372735]], [[0.40193434282716689, 0.77124273444864078], [-0.70873019803530313, -0.81529900334190519]], [[0.46864138606445871, 0.65526620123485468], [-0.8719674792548715, -0.94339546902627047]], [[0.56873047860501025, 0.38953302649374399], [-0.98526085240200989, -0.48033381512355788]]])
15051          res=maxval(arg)
15052          ref=numarray.array(0.822802668551)
15053          self.failUnless(isinstance(res,float),"wrong type of result.")
15054          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15055       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15056       def test_maxval_array_rank4(self):
15057          arg=numarray.array([[[[0.85720742878416645, 0.27988827387323667, 0.49070838881477474, -0.45763132819743535], [-0.67237336183311225, -0.25445937371923955, 0.10361458853479233, 0.10413904498543669], [-0.93692345104386443, 0.2678428054175328, 0.25533247056621211, -0.32305638067221998]], [[0.59340473127311899, -0.87227874511895909, 0.6241736038770771, 0.79467283603250483], [-0.92762377016283226, -0.68487229864254506, -0.066576628979943431, -0.33180819533101635], [-0.50565694661802785, -0.27864825619146205, -0.10892529985569377, -0.38472639795925501]]], [[[0.89332236053146707, -0.53172955419735013, 0.041432658449450654, 0.46681521077857546], [0.021583966439083779, 0.41850959174604618, 0.51949264416518059, -0.66312837589642548], [0.33246856848437045, -0.4801113671503936, 0.55902212823529829, -0.63177305756143087]], [[-0.33448057589573166, -0.75739896498945303, 0.91642906573402105, -0.29316527400677339], [-0.55921776067113349, 0.11502888427705971, 0.60735749648784854, 0.41281299421768169], [0.90078770354412674, 0.93534572171226271, 0.67200314010782347, -0.83277182798924998]]], [[[0.50057755897525991, -0.7863579282681803, -0.78780741517599662, -0.80342487860441247], [0.71775356842357452, 0.60691302920938384, -0.61563688967106733, 0.89279476199536179], [0.60907733165373656, -0.97645380984070052, -0.68344826887442944, 0.02838484569891464]], [[-0.39073286697774301, -0.37909899562646054, 0.16487244638410781, -0.20422979552499498], [0.42360937159006551, -0.21911732897340896, -0.77260176428047567, -0.39140596490426249], [-0.25978163449682445, 0.69597575969217407, -0.82813780051302399, -0.2437763687760135]]]])
15058          res=maxval(arg)
15059          ref=numarray.array(0.935345721712)
15060          self.failUnless(isinstance(res,float),"wrong type of result.")
15061          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15062       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15063       def test_maxval_constData_rank0(self):
15064          arg=Data(0.00425301467094,self.functionspace)
15065          res=maxval(arg)
15066          ref=Data(0.00425301467094,self.functionspace)
15067          self.failUnless(isinstance(res,Data),"wrong type of result.")
15068          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15069          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15070       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15071       def test_maxval_constData_rank1(self):
15072          arg=Data(numarray.array([0.24481630771410834, 0.8482027633371616]),self.functionspace)
15073          res=maxval(arg)
15074          ref=Data(0.848202763337,self.functionspace)
15075          self.failUnless(isinstance(res,Data),"wrong type of result.")
15076          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15077          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15078       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15079       def test_maxval_constData_rank2(self):
15080          arg=Data(numarray.array([[-0.62805848358264393, 0.47792569168847021, 0.63753766788606292, 0.56872613192380017, -0.62140547559582826], [-0.53300885909946549, 0.087728738264873707, 0.27815721899198342, -0.60846756436547444, 0.76312701161889152], [-0.90031662952456015, -0.93562023084611834, -0.077605527954475173, -0.51077693482781039, 0.95897780151638878], [-0.32875230962884427, -0.40568224632821437, 0.60125655094211172, 0.73095614466625314, 0.77566626029390551]]),self.functionspace)
15081          res=maxval(arg)
15082          ref=Data(0.958977801516,self.functionspace)
15083          self.failUnless(isinstance(res,Data),"wrong type of result.")
15084          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15085          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15086       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15087       def test_maxval_constData_rank3(self):
15088          arg=Data(numarray.array([[[-0.41133807237181697, 0.339475432953392], [0.751688023632332, -0.45416714276660897]], [[-0.82710852884284014, -0.54581937207379094], [0.96752580081305073, 0.017286990318454487]], [[0.95948104622292951, 0.57403336395794513], [-0.4652813457699212, 0.87679325951992881]], [[-0.27378818188120158, 0.29628771669225618], [0.55915654739024712, -0.90003391143575473]], [[0.61472043944167232, 0.35735658086868294], [-0.20019759448385233, -0.0097721699054988953]], [[0.55933363921880153, 0.97230703622729164], [-0.97883751547481035, -0.16616084753658722]]]),self.functionspace)
15089          res=maxval(arg)
15090          ref=Data(0.972307036227,self.functionspace)
15091          self.failUnless(isinstance(res,Data),"wrong type of result.")
15092          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15093          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15094       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15095       def test_maxval_constData_rank4(self):
15096          arg=Data(numarray.array([[[[-0.10987928269740532, 0.34460441718388068, -0.42251161876169707, -0.21841227109764882], [-0.52039679114287773, -0.067873360247190373, 0.71884821427626466, -0.77230257512959066], [-0.36304670040479614, -0.16015922187117293, 0.86853171882086122, -0.96567539865168328]], [[0.96601317514359786, 0.83752149178113511, 0.65892376484600801, 0.31630886002000169], [-0.66226270610768667, -0.68350164369220967, -0.81054005335510793, 0.3180480536844339], [-0.87422470417268672, -0.17129283972715248, 0.28039370045536738, 0.29695941930546255]]], [[[-0.47630810423711178, 0.52959745217192444, 0.040993980179728773, 0.5245591726930805], [-0.89383657059829846, 0.029315208725834152, 0.88056186549081983, -0.63784231116158785], [-0.60183199925280473, -0.92921784953609343, 0.01889309869387179, -0.49090749904730235]], [[-0.32390997756647799, 0.36642208468565207, -0.68111798476689711, -0.92004014931390654], [-0.0292412230442054, -0.71320760352104884, -0.57106096519639893, 0.012657128392972838], [0.70387931057541575, 0.25942878473151754, 0.78392882823935928, -0.26722465851260502]]], [[[0.26096223103983385, 0.89553376726470413, -0.56049710274754716, 0.51051997594553389], [-0.87602756662141301, -0.29261382562617144, -0.12873590235943388, 0.69707757280626437], [0.63111654272128237, -0.56667864380284994, 0.04781100525711901, 0.062962267029093688]], [[0.83354469589166058, 0.49147678083366575, -0.47313464330467436, -0.37984462029444055], [0.048709899932206424, -0.28197892047593331, 0.61145832786089915, -0.051745145517938074], [0.97194002325382467, -0.068565885935067961, 0.7719415422184297, -0.27187882484530701]]]]),self.functionspace)
15097          res=maxval(arg)
15098          ref=Data(0.971940023254,self.functionspace)
15099          self.failUnless(isinstance(res,Data),"wrong type of result.")
15100          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15101          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15102       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15103       def test_maxval_expandedData_rank0(self):
15104          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15105          arg=msk_arg*(0.332235320145)+(1.-msk_arg)*(-0.24604500324)
15106          res=maxval(arg)
15107          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15108          ref=msk_ref*(0.332235320145)+(1.-msk_ref)*(-0.24604500324)
15109          self.failUnless(isinstance(res,Data),"wrong type of result.")
15110          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15111          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15112       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15113       def test_maxval_expandedData_rank1(self):
15114          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15115          arg=msk_arg*numarray.array([-0.59427677340505958, -0.84740257716903722])+(1.-msk_arg)*numarray.array([-0.72031138157212804, 0.92918576704192746])
15116          res=maxval(arg)
15117          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15118          ref=msk_ref*(-0.594276773405)+(1.-msk_ref)*(0.929185767042)
15119          self.failUnless(isinstance(res,Data),"wrong type of result.")
15120          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15121          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15122       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15123       def test_maxval_expandedData_rank2(self):
15124          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15125          arg=msk_arg*numarray.array([[0.41368801368105679, 0.29360526282114119, -0.30954301330224121, 0.26476660295182097, 0.37942955464311723], [-0.14137058932732383, 0.56216536188087152, 0.85723969959744473, -0.34157407776672866, 0.71187680163817757], [0.028323013942354924, -0.8271833359392009, -0.46852604935440745, 0.17851739216808915, 0.66516251742568744], [-0.65769919956640965, 0.82148451636261277, -0.99401768066284557, 0.10732593805672952, -0.28231159743214285]])+(1.-msk_arg)*numarray.array([[-0.35422666104845879, -0.83499817780768693, 0.94898016702033416, -0.035772961794744429, 0.57477321877630838], [0.22489182670080199, -0.41146981529375215, -0.72758976996124791, -0.41066296298400817, 0.80718619480745124], [0.80235446968120638, -0.35840819741634955, -0.05618651096108862, -0.94078438157309785, -0.56658816600726691], [-0.73505106729271441, -0.33158257909652189, 0.44199211387292636, 0.29529742850205309, 0.85346454421416262]])
15126          res=maxval(arg)
15127          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15128          ref=msk_ref*(0.857239699597)+(1.-msk_ref)*(0.94898016702)
15129          self.failUnless(isinstance(res,Data),"wrong type of result.")
15130          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15131          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15132       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15133       def test_maxval_expandedData_rank3(self):
15134          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15135          arg=msk_arg*numarray.array([[[-0.496818524218406, 0.26161963352560824], [0.91044707618692389, -0.9432697535729444]], [[-0.10609846145317547, -0.72291144577158972], [-0.15568936492204277, -0.053141421374103048]], [[0.53303053127115252, 0.24937055476184278], [-0.85544018056817905, 0.32023326034177413]], [[-0.19803538880229699, 0.071601808939763201], [0.78888291536029431, 0.10606346665910005]], [[-0.83691574508233346, 0.75194007447412869], [-0.46213522303320165, 0.74118532899627509]], [[-0.27203854500308888, 0.0556603061557428], [-0.27568024558144644, -0.6596832871328886]]])+(1.-msk_arg)*numarray.array([[[-0.38387363639151295, -0.03233312164578428], [-0.7132988320484781, -0.12222778087194741]], [[-0.23514106160045301, 0.42068398992463907], [-0.73285598813751607, -0.85491869063637438]], [[-0.096049701961620437, 0.39603320496426764], [-0.86688149264271797, -0.48263249645534678]], [[0.61270540922521399, -0.27815399087641524], [-0.75568629133180254, 0.06586879881883867]], [[-0.98103416178316749, -0.34258493606401386], [-0.44344220314932414, -0.92896633412201046]], [[0.75303826320532785, -0.75939337307517341], [0.66523101128309792, 0.42131106360540072]]])
15136          res=maxval(arg)
15137          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15138          ref=msk_ref*(0.910447076187)+(1.-msk_ref)*(0.753038263205)
15139          self.failUnless(isinstance(res,Data),"wrong type of result.")
15140          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15141          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15142       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15143       def test_maxval_expandedData_rank4(self):
15144          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15145          arg=msk_arg*numarray.array([[[[-0.39063884840579055, -0.062593055462244251, -0.022752676756311097, 0.82567766395652442], [-0.61782203411671532, -0.7174987171488576, 0.012416472497936981, 0.77732527522608708], [0.2581482129115249, -0.028970138751502228, 0.21400817374883752, 0.096518944579570443]], [[-0.9333652649577453, -0.3485799161416816, -0.22059438876339588, -0.32222484146513297], [0.049776858853060491, -0.39729968061906007, -0.15644245293308434, 0.57933231238347394], [-0.91585792154697998, 0.6490525691757576, 0.13701512944986138, -0.50714811705008134]]], [[[0.94717926915302164, 0.44616257454360975, -0.40750067768073506, -0.50001686912458432], [-0.5640527606203567, -0.16806643428738455, -0.99809710887506187, -0.28997095902879977], [0.96080123261322714, 0.7072630535529012, 0.060165698718575689, -0.48760045654442763]], [[0.8605264623824691, 0.37995771692823999, -0.58889533613098277, -0.12102927983038536], [-0.75913777624959944, 0.95883798144078658, -0.0170674547606533, 0.40302350028136646], [-0.41467348140561078, -0.34169615998854042, -0.094247808145228928, -0.77243636153593309]]], [[[0.76847611775181623, 0.31114571658639933, 0.3375738255385885, 0.8252971351240701], [0.16843391508372885, -0.17487468243823523, 0.9500225050341351, 0.15765605380472492], [0.84806367006401939, -0.8921145799188599, 0.70066703654989038, -0.29226492555032313]], [[0.26167372305421277, -0.14246109041907506, 0.67992861287405981, -0.85922091895242425], [-0.20238389587707561, -0.2880395272779086, -0.58172933182948428, 0.98397658132546684], [-0.70323630626752842, 0.047805048436355024, 0.1334599526040372, 0.091415361986823429]]]])+(1.-msk_arg)*numarray.array([[[[0.45435533405178563, -0.24704909409153553, 0.20906352762224722, 0.87632790903409052], [-0.27526942171841084, -0.20312196158302176, 0.62221965869732276, -0.51231649769277432], [-0.91064163780949081, -0.67582252480982086, 0.50052639822596001, -0.069909103979628684]], [[-0.83392522017960569, -0.87540703757185967, 0.02544719796251993, -0.68287237837241843], [-0.10314783966584584, 0.33658223994757219, 0.2486432654565609, -0.50566553769425715], [0.3590841982402051, -0.69644955060860281, 0.055034764880927289, -0.028554584782987558]]], [[[0.68013452135981023, -0.80066123330402261, 0.33556647382902027, 0.58147090184653938], [0.55665998011202222, -0.69132338787736347, 0.91301301976970572, -0.36903333405262262], [0.84606547219969408, 0.1992186661680091, 0.74823224796946786, 0.43629167990068662]], [[-0.49014959276017844, 0.774758193648448, 0.14961755035441104, 0.40547083361887415], [0.37831252161933504, -0.4349417215086282, 0.71836802753181694, -0.24652218870808684], [-0.38428296978779963, 0.99667296612807799, 0.16883895231650103, -0.42076923428686475]]], [[[-0.08342541607713061, -0.69745118901650538, -0.83706308088889525, 0.81201518967613806], [-0.38122402193435234, -0.46153944893815702, 0.43276508943432845, -0.086332781036586592], [0.7242527519061337, -0.60544717368864243, -0.29315538455633927, -0.97452928976637287]], [[-0.61595949771180325, 0.87520574402241502, 0.61694207224169428, -0.37854520619327103], [-0.14310710281978745, -0.61259903416672601, -0.66322044415369796, 0.89868948108915769], [0.95673622765714006, 0.17577298932819585, -0.11163387589198637, -0.61928756437099852]]]])
15146          res=maxval(arg)
15147          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15148          ref=msk_ref*(0.983976581325)+(1.-msk_ref)*(0.996672966128)
15149          self.failUnless(isinstance(res,Data),"wrong type of result.")
15150          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15151          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15152       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15153       def test_maxval_Symbol_rank0(self):
15154          arg=Symbol(shape=())
15155          res=maxval(arg)
15156          s=numarray.array(0.264444652408)
15157          sub=res.substitute({arg:s})
15158          ref=numarray.array(0.264444652408)
15159          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15160          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15161          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15162       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15163       def test_maxval_Symbol_rank1(self):
15164          arg=Symbol(shape=(2,))
15165          res=maxval(arg)
15166          s=numarray.array([-0.46872519059702666, -0.34377250714318253])
15167          sub=res.substitute({arg:s})
15168          ref=numarray.array(-0.343772507143)
15169          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15170          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15171          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15172       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15173       def test_maxval_Symbol_rank2(self):
15174          arg=Symbol(shape=(4, 5))
15175          res=maxval(arg)
15176          s=numarray.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]])
15177          sub=res.substitute({arg:s})
15178          ref=numarray.array(0.88423312487)
15179          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15180          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15181          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15182       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15183       def test_maxval_Symbol_rank3(self):
15184          arg=Symbol(shape=(6, 2, 2))
15185          res=maxval(arg)
15186          s=numarray.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]]])
15187          sub=res.substitute({arg:s})
15188          ref=numarray.array(0.932998747348)
15189          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15190          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15191          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15192       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15193       def test_maxval_Symbol_rank4(self):
15194          arg=Symbol(shape=(3, 2, 3, 4))
15195          res=maxval(arg)
15196          s=numarray.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]]]])
15197          sub=res.substitute({arg:s})
15198          ref=numarray.array(0.97442268603)
15199          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15200          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15201          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15202       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15203       def test_minval_float_rank0(self):
15204          arg=-0.0813988872107
15205          res=minval(arg)
15206          ref=-0.0813988872107
15207          self.failUnless(isinstance(res,float),"wrong type of result.")
15208          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15209       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15210       def test_minval_array_rank0(self):
15211          arg=numarray.array(0.203135339689)
15212          res=minval(arg)
15213          ref=numarray.array(0.203135339689)
15214          self.failUnless(isinstance(res,float),"wrong type of result.")
15215          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15216       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15217       def test_minval_array_rank1(self):
15218          arg=numarray.array([0.53544902048869591, -0.81095461710032879])
15219          res=minval(arg)
15220          ref=numarray.array(-0.8109546171)
15221          self.failUnless(isinstance(res,float),"wrong type of result.")
15222          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15223       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15224       def test_minval_array_rank2(self):
15225          arg=numarray.array([[0.27214337670370048, 0.15560988073469084, 0.90015619199343311, -0.9025114039043387, -0.84476541550754214], [0.067681521831817637, 0.49725231481834298, -0.44690725788544317, 0.81611521497601935, -0.23818755255201474], [0.39409048948021819, -0.32989779963822996, 0.071598660625914912, -0.048721135674946847, -0.88486359278268867], [-0.047242209881730668, 0.5117999752695459, -0.065254537763000275, -0.98426384139999601, 0.42640166196036344]])
15226          res=minval(arg)
15227          ref=numarray.array(-0.9842638414)
15228          self.failUnless(isinstance(res,float),"wrong type of result.")
15229          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15230       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15231       def test_minval_array_rank3(self):
15232          arg=numarray.array([[[-0.57801369559578375, 0.8475709087853267], [-0.62156558628902858, 0.16317256776729372]], [[0.82280749191458802, 0.86757046029308138], [-0.80468648257487341, 0.50347496153235838]], [[0.57910271328476837, 0.31832794067003101], [-0.43115546130737159, 0.96031608499179488]], [[0.49539799715856692, -0.10882931867648438], [-0.10954143472670097, -0.40160540217269403]], [[0.24326476418285869, 0.73974055647226611], [-0.062874816874243677, -0.084436498355318745]], [[0.022195220279687566, 0.77562819716638032], [-0.88624021250624607, 0.39848396848232337]]])
15233          res=minval(arg)
15234          ref=numarray.array(-0.886240212506)
15235          self.failUnless(isinstance(res,float),"wrong type of result.")
15236          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15237       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15238       def test_minval_array_rank4(self):
15239          arg=numarray.array([[[[-0.14474876918789525, 0.54987363867145578, 0.041514287216928958, 0.50784202943730339], [0.22428027284721597, -0.90703539828428648, -0.57639520455060667, -0.48198988610144466], [0.94878712908709151, -0.34378540985741024, -0.85617090009829844, 0.38542149004545845]], [[0.40439396247960424, -0.33396533725982902, 0.57102838967013425, -0.77292398584017619], [-0.30211593932962177, 0.31377477534575848, -0.65372193392871303, 0.7598903854852137], [0.93212303414631692, -0.9918986741212521, -0.31650029155130377, -0.79547565383603569]]], [[[0.22810964805040368, 0.36801496715542159, -0.50290854627818193, -0.031218734373054335], [0.91491532038518919, 0.3432896329141184, -0.67365848697820074, -0.56415601144850136], [-0.94529850756161604, 0.063750250741384518, -0.94341968293701362, 0.0086523607884236853]], [[-0.15793249822138344, 0.33733718444805083, -0.071528717305355149, -0.67498602448352707], [0.36887437066094186, -0.045164571795437425, 0.50187055239691203, -0.68431142493430408], [-0.5805689340418223, -0.1405830463965192, 0.49818568480317338, -0.49073491820057957]]], [[[-0.4547271777538564, 0.0052825628200054986, 0.8386907168648059, -0.79277949820721361], [-0.17773231635682119, -0.73046788469917323, -0.32125176839388025, -0.81768823086027997], [0.97056323533228195, -0.12463448959269829, -0.057103597501829473, 0.40417829046576115]], [[0.055559060913653591, -0.2205433998937556, -0.4707694934849973, 0.27520647582020419], [-0.7793261855641469, 0.2312443862224689, 0.49823564342243087, 0.50087939122723002], [0.13357337216768128, -0.21846566992619709, -0.67496935894945098, -0.047733069730594435]]]])
15240          res=minval(arg)
15241          ref=numarray.array(-0.991898674121)
15242          self.failUnless(isinstance(res,float),"wrong type of result.")
15243          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15244       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15245       def test_minval_constData_rank0(self):
15246          arg=Data(-0.570106420108,self.functionspace)
15247          res=minval(arg)
15248          ref=Data(-0.570106420108,self.functionspace)
15249          self.failUnless(isinstance(res,Data),"wrong type of result.")
15250          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15251          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15252       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15253       def test_minval_constData_rank1(self):
15254          arg=Data(numarray.array([-0.19847831559753981, 0.40610397160211087]),self.functionspace)
15255          res=minval(arg)
15256          ref=Data(-0.198478315598,self.functionspace)
15257          self.failUnless(isinstance(res,Data),"wrong type of result.")
15258          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15259          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15260       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15261       def test_minval_constData_rank2(self):
15262          arg=Data(numarray.array([[-0.9639131333497899, -0.30622184254591556, -0.56534225119979475, 0.97113536551499657, 0.72771392953144876], [-0.71538714174098872, 0.52973718939771963, -0.028651679335222946, 0.5929024511132337, -0.4866110022815282], [0.027770288586371983, -0.32978280221198308, 0.13790608674958271, -0.45983276751063973, 0.31586441270296217], [-0.25006380493198432, -0.23317987015724517, -0.49457991065340834, -0.66183045720993428, 0.6546653003791596]]),self.functionspace)
15263          res=minval(arg)
15264          ref=Data(-0.96391313335,self.functionspace)
15265          self.failUnless(isinstance(res,Data),"wrong type of result.")
15266          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15267          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15268       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15269       def test_minval_constData_rank3(self):
15270          arg=Data(numarray.array([[[0.78772704902154156, 0.69698576470167839], [0.58349353871022425, -0.44429652744170367]], [[0.95122195248495611, -0.13329242810307163], [0.61489426950194725, -0.82627278543241833]], [[-0.20676898827641677, 0.90746615695355337], [-0.21454902325466274, -0.06996179955865367]], [[-0.77386810656368321, -0.50452086581667466], [0.10741771738964179, 0.54945560673302318]], [[0.62059435342635272, 0.42764710981542731], [-0.69961537691414666, 0.41473366544360712]], [[-0.69496424443778304, -0.71149599990967038], [0.41282921885173396, 0.38102417382970177]]]),self.functionspace)
15271          res=minval(arg)
15272          ref=Data(-0.826272785432,self.functionspace)
15273          self.failUnless(isinstance(res,Data),"wrong type of result.")
15274          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15275          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15276       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15277       def test_minval_constData_rank4(self):
15278          arg=Data(numarray.array([[[[-0.31617134142491587, -0.79150138292975791, -0.69179461153514898, 0.64957729213045989], [-0.81436417612892531, 0.42248652353980631, -0.25642022653882335, 0.27550856107884569], [0.0095865917205664175, 0.13528115156489906, 0.72542268735015081, 0.30411944968409288]], [[0.43223908791872279, -0.031384323435708961, -0.27138787236554074, 0.94846267932468575], [-0.003171134402055964, -0.23874859540786719, -0.88544193420317718, 0.81720893129705563], [0.9901501746767003, 0.23991422240922367, 0.10638468953085067, 0.4302537013800245]]], [[[-0.85020088072889277, 0.4552859449987976, -0.92342379862574431, 0.21936304106407478], [0.41100362018711367, 0.69396272891408439, 0.4157617323953402, 0.79743336407104493], [-0.59192141405336196, -0.084339584940965606, -0.52187164926130802, -0.12126412509513074]], [[0.40596845427308348, 0.24314808354086681, 0.85019356732762463, 0.68633031900498054], [0.13575440057734922, -0.056231914047657483, -0.71847761514904684, 0.16852540949725237], [-0.45562770062897218, 0.61253598275865895, -0.018428323215295084, 0.63750932492290602]]], [[[-0.95140029572331875, 0.35903135903332606, 0.35062441928298194, 0.27289245766078674], [0.95038622171897491, 0.065120389529117251, 0.39001097938148432, 0.41345777245129756], [0.42532849657704208, 0.19939457782565295, 0.77528674822056765, -0.050697957849086928]], [[-0.24970902580501475, -0.78386638935427833, -0.25378258399293552, -0.83330630180475596], [-0.030380655291931902, -0.96043242888909464, -0.14531326816314305, 0.39809472723243222], [-0.66171460089490175, -0.51291855133171671, 0.36594014782248796, 0.80253386528405168]]]]),self.functionspace)
15279          res=minval(arg)
15280          ref=Data(-0.960432428889,self.functionspace)
15281          self.failUnless(isinstance(res,Data),"wrong type of result.")
15282          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15283          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15284       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15285       def test_minval_expandedData_rank0(self):
15286          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15287          arg=msk_arg*(-0.778944214859)+(1.-msk_arg)*(0.953941502903)
15288          res=minval(arg)
15289          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15290          ref=msk_ref*(-0.778944214859)+(1.-msk_ref)*(0.953941502903)
15291          self.failUnless(isinstance(res,Data),"wrong type of result.")
15292          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15293          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15294       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15295       def test_minval_expandedData_rank1(self):
15296          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15297          arg=msk_arg*numarray.array([-0.73159504520188157, 0.68299192035807255])+(1.-msk_arg)*numarray.array([-0.3100681210597318, -0.65103554359904581])
15298          res=minval(arg)
15299          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15300          ref=msk_ref*(-0.731595045202)+(1.-msk_ref)*(-0.651035543599)
15301          self.failUnless(isinstance(res,Data),"wrong type of result.")
15302          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15303          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15304       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15305       def test_minval_expandedData_rank2(self):
15306          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15307          arg=msk_arg*numarray.array([[-0.52277742513644765, -0.2277572152261802, -0.9511128526148902, 0.32017435807815242, -0.11136201958976244], [-0.80459257355669767, -0.95924143992579869, 0.50769588182449388, 0.86438625827388305, 0.16860560966597427], [-0.72754696854920198, 0.67889538815250394, 0.6088408927519946, -0.72782010895545679, 0.56616049103099786], [-0.11534623429520585, -0.092041379862312089, 0.56715923140761726, 0.0028734812988140401, -0.13593267576797796]])+(1.-msk_arg)*numarray.array([[0.32400946916673323, -0.99131325248594693, -0.29006290223719677, -0.81287830308772602, -0.14575320006496795], [0.23894418840621556, 0.99107715887800141, 0.69785171074135177, 0.20540649144636669, -0.022178813617514059], [0.97125674513729066, 0.54103580977289178, -0.69594163458966074, 0.045941422243358288, 0.51911179383180106], [-0.040941899113513314, 0.29908960491193759, 0.31070274901135231, -0.42386794845092379, -0.14020897842782176]])
15308          res=minval(arg)
15309          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15310          ref=msk_ref*(-0.959241439926)+(1.-msk_ref)*(-0.991313252486)
15311          self.failUnless(isinstance(res,Data),"wrong type of result.")
15312          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15313          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15314       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15315       def test_minval_expandedData_rank3(self):
15316          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15317          arg=msk_arg*numarray.array([[[0.2243593847183587, -0.55964269546917778], [0.086055585732637496, 0.85322676708491429]], [[-0.95462358187710294, -0.85991920026432767], [0.19704146031466507, 0.12266428022749887]], [[0.62491825811592427, 0.74058421362755578], [-0.00909447859974577, -0.98100849454252903]], [[-0.35262739845910374, -0.92427752522606532], [0.26279257951943724, -0.94076289760274867]], [[0.2774731787257616, 0.66406607908393478], [-0.10466380765605798, 0.9590095850576017]], [[-0.63686305073922522, 0.8055769733197482], [-0.18278593082199945, -0.34288116248154421]]])+(1.-msk_arg)*numarray.array([[[0.57238934623145776, -0.6008625917571444], [0.3693766407620318, 0.70221455793260423]], [[-0.58848946803840674, -0.096161764675626982], [0.78217332385378691, 0.61375244943994911]], [[-0.30778069185951695, -0.55126352159863301], [0.6408299490321927, 0.99953805406121954]], [[0.26931958474181017, -0.60531989284036225], [-0.89886607437725319, 0.74907780969586568]], [[0.57734208195866099, -0.58661021170011907], [0.38922797525267239, 0.29493691914357334]], [[0.46695639713123049, 0.23171759126301761], [-0.052706998692634732, -0.78334544272850204]]])
15318          res=minval(arg)
15319          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15320          ref=msk_ref*(-0.981008494543)+(1.-msk_ref)*(-0.898866074377)
15321          self.failUnless(isinstance(res,Data),"wrong type of result.")
15322          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15323          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15324       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15325       def test_minval_expandedData_rank4(self):
15326          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15327          arg=msk_arg*numarray.array([[[[0.46483848448463783, -0.87939053653747745, 0.18006027907711064, 0.59393412035549553], [-0.060446335653558059, -0.58654265140261042, -0.7103456625567921, -0.87737620348261225], [0.7915602685554104, 0.058998481855049523, 0.68263476322383454, -0.346029376351082]], [[0.11758788080658089, 0.24948633626899586, -0.6136373781657769, 0.99819746973171686], [-0.5990037217573525, 0.81089434898012391, -0.79998545086485873, -0.99177417401308809], [-0.77652852159987606, -0.2482337515175721, 0.11649788623113655, -0.074557844494566483]]], [[[0.26806387309289925, 0.82459759920272702, 0.33106191528634432, 0.89462805607445128], [-0.19028989619203829, 0.68615021175809709, 0.44076423865654846, 0.2756983480068973], [-0.77132677194140387, 0.99573172063081605, -0.57302930492670434, -0.50733002523701476]], [[-0.84471955813954591, -0.85176783029149705, -0.92684957977259796, 0.59023847705979327], [0.68196420699586402, 0.58361004083768364, -0.71922201576501466, -0.20596576225294583], [0.79395039679328305, 0.472333500890604, -0.13097923185774984, 0.24331532019306423]]], [[[-0.83479197740948829, -0.0075589700651166325, -0.78975633265041978, 0.018667115085772901], [-0.049769243736694113, 0.5209394114068675, 0.065925130190574111, -0.7431184749488009], [0.62313144993384539, -0.98514078085147361, -0.87222126612101603, 0.90735220611080991]], [[0.79727858426486953, -0.85669952349479006, -0.74511584235611039, 0.026323551913185472], [-0.23933451992599641, 0.60640846085161648, -0.14396449329896144, 0.16035835222923356], [-0.050012848665722975, 0.5731667028545524, 0.99860242361478924, 0.32146275555560866]]]])+(1.-msk_arg)*numarray.array([[[[0.62874848202922995, 0.25537251444066023, -0.698374966993069, -0.38687588298399156], [0.49378024086811134, 0.7769539896932669, -0.10934606676333569, -0.21298971767267072], [-0.61708921394679916, -0.84745222820602195, 0.80837213654566931, 0.43012734925042673]], [[0.46908437808287862, 0.15847492833174037, 0.43970355055642618, -0.45249108496330326], [-0.99773656166168645, -0.30411024919059959, 0.29944789752031253, -0.92091659949825022], [0.14139835253841881, 0.65286819300206411, -0.33942314449708033, -0.25137887940591175]]], [[[0.12370235507304339, -0.26504015746942589, -0.77988713910590435, -0.90788635421965291], [-0.90705126108317047, 0.069929652428008193, 0.99718954015895278, -0.97450250453685361], [-0.70326152893105709, -0.091126066100986503, 0.78506550006102915, -0.72917498081256715]], [[0.42629906246786486, -0.91603749611465091, 0.31297245971177445, -0.8326590552190356], [0.3039549953318279, -0.71996259445943389, 0.9724420712657329, 0.41592436425988466], [0.57718038790671078, -0.39375559879969191, 0.55089171490650224, -0.15686786098227512]]], [[[0.91433628175647907, -0.8335217876290042, 0.14319348718149993, -0.15460951345782847], [-0.1413557115515387, -0.7965552409354113, -0.6647827134700568, -0.6562005559403794], [0.8996333133589296, -0.60792710713831077, 0.32829660654943127, 0.59993702653925007]], [[-0.20459622156626156, 0.54626282250284341, -0.12114642969601674, 0.31432342880341024], [0.44005219027624398, 0.45505989580530981, -0.30837994783093614, -0.88417181461185046], [0.2415549698483368, 0.03180095496331381, 0.53977209810077453, -0.41688385798938143]]]])
15328          res=minval(arg)
15329          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15330          ref=msk_ref*(-0.991774174013)+(1.-msk_ref)*(-0.997736561662)
15331          self.failUnless(isinstance(res,Data),"wrong type of result.")
15332          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15333          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15334       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15335       def test_minval_Symbol_rank0(self):
15336          arg=Symbol(shape=())
15337          res=minval(arg)
15338          s=numarray.array(0.507552163379)
15339          sub=res.substitute({arg:s})
15340          ref=numarray.array(0.507552163379)
15341          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15342          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15343          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15344       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15345       def test_minval_Symbol_rank1(self):
15346          arg=Symbol(shape=(2,))
15347          res=minval(arg)
15348          s=numarray.array([-0.91662367981879389, 0.4198006315668994])
15349          sub=res.substitute({arg:s})
15350          ref=numarray.array(-0.916623679819)
15351          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15352          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15353          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15354       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15355       def test_minval_Symbol_rank2(self):
15356          arg=Symbol(shape=(4, 5))
15357          res=minval(arg)
15358          s=numarray.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]])
15359          sub=res.substitute({arg:s})
15360          ref=numarray.array(-0.897490434505)
15361          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15362          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15363          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15364       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15365       def test_minval_Symbol_rank3(self):
15366          arg=Symbol(shape=(6, 2, 2))
15367          res=minval(arg)
15368          s=numarray.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]]])
15369          sub=res.substitute({arg:s})
15370          ref=numarray.array(-0.969839189966)
15371          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15372          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15373          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15374       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15375       def test_minval_Symbol_rank4(self):
15376          arg=Symbol(shape=(3, 2, 3, 4))
15377          res=minval(arg)
15378          s=numarray.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]]]])
15379          sub=res.substitute({arg:s})
15380          ref=numarray.array(-0.991347203321)
15381          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15382          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15383          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15384    
15385  class Test_util_unary_with_tagged_data(Test_util_base):  class Test_util_unary_with_tagged_data(Test_util_base):
15386     """     """
# Line 16007  class Test_util_unary_with_tagged_data(T Line 16586  class Test_util_unary_with_tagged_data(T
16586        self.failUnless(isinstance(res,Data),"wrong type of result.")        self.failUnless(isinstance(res,Data),"wrong type of result.")
16587        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
16588        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16589       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16590       def test_length_taggedData_rank0(self):
16591          arg=Data(0.0304173948959,self.functionspace)
16592          arg.setTaggedValue(1,0.218413236568)
16593          res=length(arg)
16594          ref=Data(0.0304173948959,self.functionspace)
16595          ref.setTaggedValue(1,0.218413236568)
16596          self.failUnless(isinstance(res,Data),"wrong type of result.")
16597          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16598          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16599       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16600       def test_length_taggedData_rank1(self):
16601          arg=Data(numarray.array([0.39703364688152853, -0.33246454817593807]),self.functionspace)
16602          arg.setTaggedValue(1,numarray.array([-0.53598331151915435, 0.50067334409291053]))
16603          res=length(arg)
16604          ref=Data(0.517849777976,self.functionspace)
16605          ref.setTaggedValue(1,0.73345204868)
16606          self.failUnless(isinstance(res,Data),"wrong type of result.")
16607          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16608          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16609       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16610       def test_length_taggedData_rank2(self):
16611          arg=Data(numarray.array([[0.6907462872229877, -0.90522553862549726, 0.087785407451554276, 0.30466419540456768, 0.79322552033540972], [0.88191058742529571, 0.99529532885936489, 0.41490962783197238, -0.0016893790093754912, -0.95814885065677502], [-0.060249764286741447, 0.63991926602596116, -0.086836131633126534, 0.18124915949321885, 0.68271069967418541], [0.64740861624348423, -0.57455334179273243, -0.5571704702710476, 0.2573850096331336, -0.34168400956685985]]),self.functionspace)
16612          arg.setTaggedValue(1,numarray.array([[0.81018021133002383, 0.99939497604482352, -0.14079723796118393, 0.40272555558488365, 0.18472338544851841], [-0.07594389046701755, 0.63538212017493612, -0.60010668894251618, -0.33610184381106811, -0.15191875538531718], [-0.24439106568273194, 0.66671313634788354, 0.14904931462513904, -0.58653890475427217, -0.58062369844301442], [0.098248585440467551, 0.20530555521782179, -0.51610019710067645, 0.16323562948354797, -0.71041456409833881]]))
16613          res=length(arg)
16614          ref=Data(2.6546513714,self.functionspace)
16615          ref.setTaggedValue(1,2.19865063671)
16616          self.failUnless(isinstance(res,Data),"wrong type of result.")
16617          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16618          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16619       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16620       def test_length_taggedData_rank3(self):
16621          arg=Data(numarray.array([[[-0.90704201804086337, 0.6329509253938721], [0.21915003710942882, -0.77286765743151387]], [[-0.49454988231884833, -0.52787084998857448], [-0.50038642296401559, 0.25066877240869223]], [[-0.11435301241890539, -0.43863272457515157], [-0.21789841788237019, 0.67485153176592272]], [[-0.55566679864765667, -0.57930055750016884], [0.86011645143557036, -0.7526814967676656]], [[0.51094878077660111, 0.77929881123688749], [-0.42495639450230005, -0.07585333420623952]], [[-0.89054330821722716, -0.35325589691741888], [-0.3768246899267691, -0.41975230182765833]]]),self.functionspace)
16622          arg.setTaggedValue(1,numarray.array([[[-0.12217784564610956, -0.42220631009895904], [-0.61429599365799681, 0.61618111022446365]], [[-0.97675816669720295, 0.82574624011080133], [0.81295724921140167, 0.25317345312076855]], [[-0.051786152179434497, 0.7305249935930429], [-0.93380271417452732, 0.50018267655097737]], [[-0.80264399896632499, 0.79509218774376844], [-0.21791667132633941, 0.66634447245200645]], [[-0.55794532541196795, -0.048202617623965605], [-0.05960274244353414, 0.74611871917265127]], [[0.88304823875965166, 0.42665187568627805], [-0.43824304428388317, -0.62742457744585889]]]))
16623          res=length(arg)
16624          ref=Data(2.76676324475,self.functionspace)
16625          ref.setTaggedValue(1,3.02637754858)
16626          self.failUnless(isinstance(res,Data),"wrong type of result.")
16627          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16628          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16629       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16630       def test_length_taggedData_rank4(self):
16631          arg=Data(numarray.array([[[[0.031685672552886901, -0.9267701908635706, -0.056148458903377607, -0.84202454095770185], [-0.3616646666858836, -0.29520741814627049, 0.024595806152944988, -0.71158936975814591], [0.12440081378701895, 0.72960501658634347, -0.87170545922253151, 0.10882643738812559]], [[0.88800242901141169, 0.48693301422640589, -0.13887736360495673, -0.743971681222801], [-0.74717247198853753, 0.35260473534815429, 0.43837149883392601, -0.55027619071689737], [0.66850441314063103, 0.7728717623705943, 0.21470523696142552, -0.71541050236116877]]], [[[-0.48211303782598347, 0.3644457740018654, 0.68984391713960602, 0.74515540572117134], [0.53899835618675929, -0.70996632321229947, -0.51515930082178918, -0.36888505048093223], [0.78774470226335747, -0.39544353241612185, 0.32281697817612787, -0.16311128990188162]], [[-0.51374217556516255, -0.45792789001444856, 0.47007708506811818, -0.43333371235667362], [-0.02632140668309213, 0.93007210792179462, 0.59736202366291802, 0.22152676969085516], [0.39775547303207204, 0.53313877938239496, 0.77934427730455358, -0.21566366366398793]]], [[[0.91343257162829294, -0.77320607588319645, -0.85087366672245945, -0.8231988743945351], [0.2844336912954244, -0.91728899258227847, -0.46154275241222287, -0.93255280333208801], [-0.53369991345904522, 0.12949000049493731, 0.53421477536661266, -0.63975708880504234]], [[0.058270730436794649, 0.0515918698875375, -0.24523619977036026, 0.29671975332241707], [-0.95019879958514597, -0.94737283445325193, -0.41748226318386861, -0.048340741857560765], [0.59312485406738369, -0.30988717510892605, 0.090027828305644153, -0.51722372921834436]]]]),self.functionspace)
16632          arg.setTaggedValue(1,numarray.array([[[[-0.20169792059747449, 0.13920330493621691, 0.034614492760971061, -0.82851290218784412], [-0.01651072019815425, -0.78097847045185942, -0.13764015571975197, -0.35461745589441884], [-0.49540307831103148, 0.2474487427834613, 0.22695961470352821, -0.37681697269105396]], [[0.68611428610099079, -0.29255652866384385, -0.42345462193199213, 0.82794567130265717], [-0.092325345849896712, -0.15183768034385192, 0.13712248884188671, -0.72118044002659931], [-0.050604578031925973, -0.58555183018848322, -0.92016117326965108, 0.90294256985722066]]], [[[0.37734783987332321, 0.50440698564950592, -0.98813708121482202, 0.35026860039322605], [0.69439644470699591, -0.065391298373910445, 0.22537555580617075, -0.56010684906819108], [0.8850708627713344, 0.33442383771972017, -0.88133340777125468, 0.79499967022722062]], [[0.84658289102126205, -0.45737265507509539, 0.22891245018035788, 0.66506738603993654], [0.30854215900653492, -0.15997939628404678, 0.60133183458548922, 0.41180859119482771], [-0.82182443995887455, 0.40193978476563985, -0.47097558780935489, -0.78813126661061927]]], [[[-0.60025729863753186, -0.47916988408835803, -0.66879674780784004, -0.34290183723542933], [0.86889784066785403, 0.32127797136956282, 0.96139056560192393, 0.19777452842099286], [-0.52352911870216756, 0.70260881377974083, -0.83733962168226328, -0.56735885586741075]], [[-0.94301726877443093, -0.25226331153593828, 0.52038556769907629, 0.53828722724477851], [-0.70767715580900048, -0.57712655180776129, -0.14200458485618395, -0.1111721398291996], [0.64852743898007059, 0.99188751270956743, 0.55982434354197941, 0.038358717131004916]]]]))
16633          res=length(arg)
16634          ref=Data(4.84097039803,self.functionspace)
16635          ref.setTaggedValue(1,4.824055271)
16636          self.failUnless(isinstance(res,Data),"wrong type of result.")
16637          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16638          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16639       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16640       def test_maxval_taggedData_rank0(self):
16641          arg=Data(-0.219558082185,self.functionspace)
16642          arg.setTaggedValue(1,0.373894454941)
16643          res=maxval(arg)
16644          ref=Data(-0.219558082185,self.functionspace)
16645          ref.setTaggedValue(1,0.373894454941)
16646          self.failUnless(isinstance(res,Data),"wrong type of result.")
16647          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16648          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16649       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16650       def test_maxval_taggedData_rank1(self):
16651          arg=Data(numarray.array([0.64744990357184862, -0.52792070755787024]),self.functionspace)
16652          arg.setTaggedValue(1,numarray.array([-0.10929307972444979, 0.83862721932489936]))
16653          res=maxval(arg)
16654          ref=Data(0.647449903572,self.functionspace)
16655          ref.setTaggedValue(1,0.838627219325)
16656          self.failUnless(isinstance(res,Data),"wrong type of result.")
16657          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16658          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16659       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16660       def test_maxval_taggedData_rank2(self):
16661          arg=Data(numarray.array([[-0.27229065227200344, 0.82294949506313886, -0.17177977432508462, -0.010882074546768816, 0.21768109521645918], [-0.29157181238782481, -0.25380425885757485, 0.027706303762511597, -0.94845012536927964, 0.87176092732644639], [-0.51643332578214518, 0.71998926614777581, 0.40354991809580687, 0.70904315000536799, 0.54655648312080007], [0.32165817766188853, -0.20424131255028888, 0.42895961651274672, -0.99791274480618064, -0.85669519376242986]]),self.functionspace)
16662          arg.setTaggedValue(1,numarray.array([[0.97262314128809613, 0.48547675148247826, 0.042278165643087728, -0.41624875992248667, 0.030567800083523444], [-0.049791194357233781, -0.79704488987202815, -0.96082903842770118, -0.83554878345036676, 0.60236115537073709], [0.28354667286636603, -0.29929954525932323, 0.022969958455315576, -0.24737146774844909, 0.19469978983867731], [-0.35513081769146426, -0.1046032314241474, 0.49567238233255839, -0.80993625419310633, -0.9139531605288036]]))
16663          res=maxval(arg)
16664          ref=Data(0.871760927326,self.functionspace)
16665          ref.setTaggedValue(1,0.972623141288)
16666          self.failUnless(isinstance(res,Data),"wrong type of result.")
16667          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16668          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16669       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16670       def test_maxval_taggedData_rank3(self):
16671          arg=Data(numarray.array([[[0.61474553298852697, 0.55779486217197505], [-0.31091458562805419, 0.016419889635135521]], [[0.21004151551334682, 0.027687106765762914], [0.6637113716450791, -0.95040841718825075]], [[-0.9300566761481408, -0.68906964030797435], [-0.97014359375905679, -0.74418973910997255]], [[0.97835172429442774, -0.46756642182408092], [-0.42578086461554476, 0.52069167480569556]], [[-0.38782064307268715, 0.49053364163876134], [0.068892813320603263, -0.053107367737293076]], [[-0.48133213301475331, 0.25593099013174481], [0.44390577068431614, -0.97257874780052989]]]),self.functionspace)
16672          arg.setTaggedValue(1,numarray.array([[[0.257603663342449, -0.038214017051409144], [-0.66873613005791666, -0.035099420794828529]], [[0.91705389480638777, -0.92302237979729274], [0.7106922910822433, -0.94404085701758933]], [[-0.79556970254884352, -0.25132479916123152], [0.29858220297465121, 0.90707472048112803]], [[-0.29244201831636918, -0.017346997146175047], [0.12733928111159498, -0.38855138005928658]], [[0.14291175066952921, -0.49761469275017678], [-0.76189392983334514, 0.84493776228691786]], [[-0.22005917389939156, -0.61656374043989004], [0.99298796284139845, -0.067815876101644967]]]))
16673          res=maxval(arg)
16674          ref=Data(0.978351724294,self.functionspace)
16675          ref.setTaggedValue(1,0.992987962841)
16676          self.failUnless(isinstance(res,Data),"wrong type of result.")
16677          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16678          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16679       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16680       def test_maxval_taggedData_rank4(self):
16681          arg=Data(numarray.array([[[[-0.38913213142622194, -0.54148345216537774, 0.41714738540363649, 0.71966537757449256], [-0.88902480268446227, -0.3777307304947799, -0.13183640051157219, 0.81415347389128234], [-0.74384993993115311, -0.89127969698262977, -0.55809388984463593, 0.83808549468591687]], [[-0.0072160550394104739, -0.32635219120000691, 0.62522095163012725, -0.84470730211227218], [-0.76620143726977852, -0.49704334323428423, 0.65091921570676603, 0.37557075348586233], [-0.88570985653924961, -0.14885693428091606, -0.1460372910003831, 0.46444747179886625]]], [[[0.30454098886894498, 0.6867161497858465, 0.72424680264691355, 0.5095615427094411], [0.072474613257559994, 0.43806936539601549, -0.59905605757280056, -0.45990321243729815], [-0.72712992491035378, -0.55689232155025548, 0.36037470124764459, -0.57195607819276018]], [[0.0051060589653528776, -0.47599982553998998, -0.39156196066990367, -0.71880248868370389], [0.41451955450758748, 0.0028147774045290674, -0.6972003711983854, 0.78507608882318736], [0.25418862509575768, 0.2284337652701498, 0.61856440627353049, 0.98714160660309891]]], [[[-0.47720293386376555, -0.65125648891362786, -0.30435692372835654, 0.31977497838442503], [0.72827978446594854, -0.63983256938337552, 0.78982468457827881, 0.22954824117307959], [0.32315333011323544, 0.53527371494472065, -0.4131594330366064, 0.99215992692482535]], [[-0.74789735956161274, -0.62925352602039042, 0.71361119864052269, -0.98014330258009075], [-0.89800389430130223, -0.37060754911664562, 0.3856639538855593, 0.034422663486305183], [-0.34490780926818876, 0.47458909120499637, 0.94818559671902958, 0.1617906804998257]]]]),self.functionspace)
16682          arg.setTaggedValue(1,numarray.array([[[[0.99933153424495091, -0.39534988719092179, -0.16778504692207585, -0.5906967701363508], [0.43387683071959104, 0.99162615949373745, 0.10547807703791179, -0.8113777964293909], [0.24291475766513315, -0.71669244345435779, -0.76485897580613305, 0.15564799608712043]], [[-0.75156489257223669, -0.055450247835175936, 0.3346750287693776, -0.66254424416459123], [0.35374045325725345, -0.051590559912436884, -0.587757300739292, -0.33917336326606917], [-0.57544619252547657, 0.20907053572412782, 0.68711149771337832, -0.056393263581338671]]], [[[0.75211852960020509, -0.10030934714915718, 0.33951992771212902, 0.60018880521446327], [0.78716758837909295, -0.059231168586686644, -0.35866282572045227, 0.85083431016927791], [0.15298677857710419, 0.89780425582787293, -0.20576313384645473, 0.062421360873735843]], [[-0.70974271086498986, -0.45339037418498562, 0.41140062690705359, -0.37665346319424886], [-0.044537762904711675, -0.39079696673697262, 0.089532841376569916, 0.2190192547531522], [0.36139300850043266, -0.44279309647849896, -0.86452061630608856, -0.1231662099055526]]], [[[-0.58039192544896112, 0.53706765389132238, -0.72356516474408639, 0.6503741573846944], [-0.30912719510660591, -0.83285543652320859, -0.37306494080273778, 0.6518672264629326], [0.98787250878747979, 0.54733052031198159, -0.15622032199949798, 0.09467999908286262]], [[0.40533336391796038, 0.73239200515802327, 0.39369121056194256, 0.081340379201521706], [-0.88455610311843214, 0.51118489146623691, -0.19795740083901325, 0.46388740676326989], [0.54780674501660931, 0.63586854173407947, 0.92134722611145814, -0.39904465723137394]]]]))
16683          res=maxval(arg)
16684          ref=Data(0.992159926925,self.functionspace)
16685          ref.setTaggedValue(1,0.999331534245)
16686          self.failUnless(isinstance(res,Data),"wrong type of result.")
16687          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16688          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16689       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16690       def test_minval_taggedData_rank0(self):
16691          arg=Data(0.00722788253378,self.functionspace)
16692          arg.setTaggedValue(1,0.691024712935)
16693          res=minval(arg)
16694          ref=Data(0.00722788253378,self.functionspace)
16695          ref.setTaggedValue(1,0.691024712935)
16696          self.failUnless(isinstance(res,Data),"wrong type of result.")
16697          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16698          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16699       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16700       def test_minval_taggedData_rank1(self):
16701          arg=Data(numarray.array([-0.47859075115756422, -0.15003593348682531]),self.functionspace)
16702          arg.setTaggedValue(1,numarray.array([-0.067933816863879004, -0.74579305994260148]))
16703          res=minval(arg)
16704          ref=Data(-0.478590751158,self.functionspace)
16705          ref.setTaggedValue(1,-0.745793059943)
16706          self.failUnless(isinstance(res,Data),"wrong type of result.")
16707          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16708          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16709       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16710       def test_minval_taggedData_rank2(self):
16711          arg=Data(numarray.array([[-0.36168873882657993, -0.67372921463813573, 0.95569685886688305, 0.15779096197431586, -0.24898227425545327], [-0.27356968554638628, 0.084426955507445944, -0.87908626632112941, -0.46051995344239027, -0.42541441304041916], [-0.14074836177854189, 0.75123070420356286, 0.86230982812739998, -0.54837108857321315, -0.77749802778211086], [-0.022482114313683077, 0.54155540121340873, -0.96328224231771142, 0.14101127782001344, 0.44096380596153772]]),self.functionspace)
16712          arg.setTaggedValue(1,numarray.array([[-0.4800201278086158, 0.030265479756139024, 0.18506553588051, 0.034952750086585604, 0.31613749260546875], [0.21702894874281076, 0.9905115362133845, 0.12091812867766771, -0.51948993749364369, 0.28399846164050846], [-0.12574413416415542, -0.28875489198619508, -0.98032997474740724, 0.26065946805344775, -0.79682683032993196], [0.78279712230924381, 0.49596074793599509, 0.61578931696589767, -0.32674782393935087, 0.15592301292387312]]))
16713          res=minval(arg)
16714          ref=Data(-0.963282242318,self.functionspace)
16715          ref.setTaggedValue(1,-0.980329974747)
16716          self.failUnless(isinstance(res,Data),"wrong type of result.")
16717          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16718          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16719       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16720       def test_minval_taggedData_rank3(self):
16721          arg=Data(numarray.array([[[-0.8465826019970264, 0.89694911727829285], [0.87594383540616905, 0.94342173268714724]], [[0.9706521300307176, -0.53661304945739108], [0.81066921409276915, -0.52315847873793642]], [[0.72760204320037447, 0.65094570568679222], [-0.77119150241041834, 0.4512829012153714]], [[0.49454458456031469, 0.58663758011234646], [-0.77569241585888848, -0.27133491940751875]], [[0.29690990109617243, 0.50502608076647637], [-0.7582923726315618, 0.0096946343625710085]], [[-0.4250267226063793, -0.6090497397361152], [0.098508158636596344, -0.56684989375571737]]]),self.functionspace)
16722          arg.setTaggedValue(1,numarray.array([[[0.31462028021419175, 0.59740363549297837], [0.054399091875714456, 0.089606631226896605]], [[0.9748509842440114, -0.39638194564239226], [0.20679313347688, -0.60337302735508302]], [[-0.8191687096963598, -0.81394151814838511], [0.44868905032346196, -0.28406609436304642]], [[0.12384704256533041, -0.95904548813036494], [0.61285482385311929, -0.17959569661829544]], [[0.19304181831790745, 0.36508908336882229], [-0.41743150582026445, -0.29917104704693598]], [[0.16069761697480067, 0.26671853918691113], [-0.5774634268596528, -0.31004354846465287]]]))
16723          res=minval(arg)
16724          ref=Data(-0.846582601997,self.functionspace)
16725          ref.setTaggedValue(1,-0.95904548813)
16726          self.failUnless(isinstance(res,Data),"wrong type of result.")
16727          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16728          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16729       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16730       def test_minval_taggedData_rank4(self):
16731          arg=Data(numarray.array([[[[-0.34624369284201362, 0.73107822148429458, -0.36551693557416232, -0.020215028669572366], [0.1351050067633206, 0.23249118524493095, -0.76011821576308392, 0.45071155860356837], [0.18426006390789262, -0.77886194275054765, -0.17063189696766501, 0.45075347499478347]], [[0.23551925256442985, -0.53414385378966478, -0.47679787077175595, -0.9726535726299459], [-0.91914615413530365, -0.17765391232754735, 0.45082787140479064, -0.968362694999094], [0.69666777807602775, 0.2130684865225696, 0.64760593585671877, 0.64903684670519413]]], [[[0.18180576019742634, 0.62890796445359309, -0.13877607363038269, -0.10822311814395635], [0.28895838281375896, -0.36598515521702191, 0.30413929033460807, -0.81140381230705128], [-0.76365479315177298, 0.71136700952304466, -0.95596671935962552, 0.52118084564552913]], [[-0.43905020629611879, 0.57723600864036473, -0.22582169869491397, -0.43742926957893391], [-0.46764952226860124, -0.066494182243584721, 0.92972113541559098, 0.044829809294563816], [-0.49878556156045928, -0.96153559198737559, -0.99767482086608483, 0.74525441641626755]]], [[[-0.59605054963850534, 0.56186148085748022, 0.77287286011247414, 0.035023085983731717], [-0.97342431925030803, 0.17825829308663432, -0.37794591543941247, 0.089384029569202106], [-0.75706695903965793, -0.31057995469060207, -0.57391135215614786, -0.56504897076385308]], [[0.42656492210469588, 0.92732907019274857, 0.71470561916432929, 0.96500484536009212], [0.18751272694170362, -0.95123662745307258, -0.8190703610202914, -0.66133004541039009], [-0.043758306539602554, 0.45325798844504162, -0.26304376860247247, 0.15468324307157122]]]]),self.functionspace)
16732          arg.setTaggedValue(1,numarray.array([[[[0.36591388135908987, -0.95486755838163839, -0.0013252788976745311, 0.69567157492793963], [-0.79676713780837027, 0.3214926946703327, -0.75096581427350828, 0.35710657155542735], [-0.97096953218037885, -0.3319681518796227, -0.57152204281278296, 0.10421746159115108]], [[-0.97119041056769873, 0.47173466396132091, 0.63208593730306029, -0.85656329130504094], [-0.62549849973292804, -0.75698243824438927, 0.46453304587151512, -0.42573348253225807], [-0.78748289295593743, 0.47450581221739219, -0.78643250843903134, 0.30232500379827609]]], [[[0.10369672224908166, 0.37373110705513635, 0.35557253428911517, -0.8134557994263798], [-0.63922930590149818, -0.34344343708131575, 0.081508957580154862, -0.045641914923246096], [0.045075125491382595, -0.81357712137145177, 0.19199928764727225, 0.98346733921059637]], [[0.016107659447112344, 0.36822191678862071, -0.05021241790306008, 0.50015935043378978], [0.011940872302404593, -0.46073951816738523, 0.71275071871696527, 0.55288336323320908], [-0.87646193066608746, -0.80998760193673003, 0.067859757365372753, 0.47872123549665657]]], [[[0.4683476290440689, 0.69014985356074243, -0.26471526741239182, 0.96932033126419936], [-0.1461901082287993, -0.76413258812010354, -0.67613738605542029, 0.60089152926266887], [0.41343229663812564, 0.64858241536864947, -0.84530164516922857, -0.79335799145751662]], [[-0.46974281932781614, -0.12403837218332758, 0.08729063956578309, 0.60621211421529453], [-0.82220451633893021, -0.54597977180396184, 0.58913700000503999, 0.087122789707702708], [-0.90671128506770948, -0.34903110797882597, 0.21581878455246306, 0.90495837687090042]]]]))
16733          res=minval(arg)
16734          ref=Data(-0.997674820866,self.functionspace)
16735          ref.setTaggedValue(1,-0.971190410568)
16736          self.failUnless(isinstance(res,Data),"wrong type of result.")
16737          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16738          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16739    
16740  class Test_util_unary(Test_util_unary_no_tagged_data,Test_util_unary_with_tagged_data):  class Test_util_unary(Test_util_unary_no_tagged_data,Test_util_unary_with_tagged_data):
16741     """     """
# Line 16033  class Test_util_binary_no_tagged_data(Te Line 16761  class Test_util_binary_no_tagged_data(Te
16761        arg1=numarray.array(4.05252282996)        arg1=numarray.array(4.05252282996)
16762        res=add(arg0,arg1)        res=add(arg0,arg1)
16763        ref=numarray.array(8.25248198451)        ref=numarray.array(8.25248198451)
16764        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
16765        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
16766             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
16767        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16768     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16769     def test_add_float_rank0_array_rank1(self):     def test_add_float_rank0_array_rank1(self):
# Line 16233  class Test_util_binary_no_tagged_data(Te Line 16962  class Test_util_binary_no_tagged_data(Te
16962        arg1=2.36940652044        arg1=2.36940652044
16963        res=add(arg0,arg1)        res=add(arg0,arg1)
16964        ref=numarray.array(4.75258026456)        ref=numarray.array(4.75258026456)
16965        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
16966        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
16967             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
16968        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16969     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16970     def test_add_array_rank1_float_rank0(self):     def test_add_array_rank1_float_rank0(self):
# Line 16278  class Test_util_binary_no_tagged_data(Te Line 17008  class Test_util_binary_no_tagged_data(Te
17008        arg1=numarray.array(0.298008631333)        arg1=numarray.array(0.298008631333)
17009        res=add(arg0,arg1)        res=add(arg0,arg1)
17010        ref=numarray.array(0.293241598371)        ref=numarray.array(0.293241598371)
17011        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
17012        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
17013             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
17014        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
17015     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
17016     def test_add_array_rank1_array_rank0(self):     def test_add_array_rank1_array_rank0(self):
# Line 20791  class Test_util_binary_no_tagged_data(Te Line 21522  class Test_util_binary_no_tagged_data(Te
21522        arg1=numarray.array(-2.11122757215)        arg1=numarray.array(-2.11122757215)
21523        res=mult(arg0,arg1)        res=mult(arg0,arg1)
21524        ref=numarray.array(-2.83121123046)        ref=numarray.array(-2.83121123046)
21525        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
21526        self.failUnlessEqual(res.shape,(),"wrong shape of result.")            self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
21527              self.failUnlessEqual(res.shape,(),"wrong shape of result.")
21528        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
21529     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21530     def test_mult_float_rank0_array_rank1(self):     def test_mult_float_rank0_array_rank1(self):
# Line 20991  class Test_util_binary_no_tagged_data(Te Line 21723  class Test_util_binary_no_tagged_data(Te
21723        arg1=2.5079501433        arg1=2.5079501433
21724        res=mult(arg0,arg1)        res=mult(arg0,arg1)
21725        ref=numarray.array(10.5277710171)        ref=numarray.array(10.5277710171)
21726        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
21727        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
21728             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
21729        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
21730     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21731     def test_mult_array_rank1_float_rank0(self):     def test_mult_array_rank1_float_rank0(self):
# Line 21036  class Test_util_binary_no_tagged_data(Te Line 21769  class Test_util_binary_no_tagged_data(Te
21769        arg1=numarray.array(3.1308073462)        arg1=numarray.array(3.1308073462)
21770        res=mult(arg0,arg1)        res=mult(arg0,arg1)
21771        ref=numarray.array(-8.67590596408)        ref=numarray.array(-8.67590596408)
21772        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
21773        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
21774             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
21775        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
21776     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21777     def test_mult_array_rank1_array_rank0(self):     def test_mult_array_rank1_array_rank0(self):
# Line 25549  class Test_util_binary_no_tagged_data(Te Line 26283  class Test_util_binary_no_tagged_data(Te
26283        arg1=numarray.array(-4.46156511129)        arg1=numarray.array(-4.46156511129)
26284        res=quotient(arg0,arg1)        res=quotient(arg0,arg1)
26285        ref=numarray.array(0.825966848548)        ref=numarray.array(0.825966848548)
26286        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
26287        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
26288             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
26289        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
26290     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
26291     def test_quotient_float_rank0_array_rank1(self):     def test_quotient_float_rank0_array_rank1(self):
# Line 25749  class Test_util_binary_no_tagged_data(Te Line 26484  class Test_util_binary_no_tagged_data(Te
26484        arg1=-2.69134968237        arg1=-2.69134968237
26485        res=quotient(arg0,arg1)        res=quotient(arg0,arg1)
26486        ref=numarray.array(-0.551023106399)        ref=numarray.array(-0.551023106399)
26487        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
26488        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
26489             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
26490        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
26491     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
26492     def test_quotient_array_rank1_float_rank0(self):     def test_quotient_array_rank1_float_rank0(self):
# Line 25794  class Test_util_binary_no_tagged_data(Te Line 26530  class Test_util_binary_no_tagged_data(Te
26530        arg1=numarray.array(1.50935966986)        arg1=numarray.array(1.50935966986)
26531        res=quotient(arg0,arg1)        res=quotient(arg0,arg1)
26532        ref=numarray.array(-0.292876069981)        ref=numarray.array(-0.292876069981)
26533        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
26534        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
26535             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
26536        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
26537     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
26538     def test_quotient_array_rank1_array_rank0(self):     def test_quotient_array_rank1_array_rank0(self):
# Line 30307  class Test_util_binary_no_tagged_data(Te Line 31044  class Test_util_binary_no_tagged_data(Te
31044        arg1=numarray.array(3.94140059405)        arg1=numarray.array(3.94140059405)
31045        res=power(arg0,arg1)        res=power(arg0,arg1)
31046        ref=numarray.array(152.611109443)        ref=numarray.array(152.611109443)
31047        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
31048        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
31049             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
31050        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
31051     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
31052     def test_power_float_rank0_array_rank1(self):     def test_power_float_rank0_array_rank1(self):
# Line 30487  class Test_util_binary_no_tagged_data(Te Line 31225  class Test_util_binary_no_tagged_data(Te
31225        arg1=1.96628444854        arg1=1.96628444854
31226        res=power(arg0,arg1)        res=power(arg0,arg1)
31227        ref=numarray.array(1.73902851501)        ref=numarray.array(1.73902851501)
31228        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
31229        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
31230             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
31231        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
31232     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
31233     def test_power_array_rank1_float_rank0(self):     def test_power_array_rank1_float_rank0(self):
# Line 30532  class Test_util_binary_no_tagged_data(Te Line 31271  class Test_util_binary_no_tagged_data(Te
31271        arg1=numarray.array(3.32321317072)        arg1=numarray.array(3.32321317072)
31272        res=power(arg0,arg1)        res=power(arg0,arg1)
31273        ref=numarray.array(24.3983890724)        ref=numarray.array(24.3983890724)
31274        self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")        if not isinstance(res,float):
31275        self.failUnlessEqual(res.shape,(),"wrong shape of result.")           self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
31276             self.failUnlessEqual(res.shape,(),"wrong shape of result.")
31277        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
31278     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
31279     def test_power_array_rank1_array_rank0(self):     def test_power_array_rank1_array_rank0(self):
# Line 60826  class Test_util_overloaded_binary_no_tag Line 61566  class Test_util_overloaded_binary_no_tag
61566        self.failUnless(isinstance(res,Symbol),"wrong type of result.")        self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61567        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
61568        self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61569       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61570       def test_generalTensorProduct_float_rank0_float_rank0_offset0(self):
61571          arg0=-0.816058209277
61572          arg1=-0.334851342127
61573          res=generalTensorProduct(arg0,arg1,offset=0)
61574          ref=0.27325818663014179
61575          self.failUnless(isinstance(res,float),"wrong type of result.")
61576          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61577       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61578       def test_generalTensorProduct_float_rank0_array_rank0_offset0(self):
61579          arg0=-0.0378781468644
61580          arg1=numarray.array(-0.223764515469)
61581          res=generalTensorProduct(arg0,arg1,offset=0)
61582          ref=numarray.array(0.008475785179988933)
61583          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61584          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
61585          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61586       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61587       def test_generalTensorProduct_float_rank0_array_rank1_offset0(self):
61588          arg0=0.543146680723
61589          arg1=numarray.array([-0.92731085296922822, -0.36581780458574942])
61590          res=generalTensorProduct(arg0,arg1,offset=0)
61591          ref=numarray.array([-0.50366581178893521, -0.19869272631023729])
61592          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61593          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
61594          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61595       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61596       def test_generalTensorProduct_float_rank0_array_rank2_offset0(self):
61597          arg0=-0.559404776535
61598          arg1=numarray.array([[-0.73633376974850639, -0.068583989340989415, -0.58700884536720088, 0.41828463778594793, -0.13130077394080808], [0.21022430355207389, -0.89023705295881594, -0.98599053548811422, -0.011942717529535241, -0.49444669262957119], [0.32064546170075658, 0.68151799398521828, 0.58093384094003797, -0.84765413248022803, -0.53426528691691533], [-0.97631867410054096, -0.76752519044492384, -0.38935877053278678, -0.1817765419702333, -0.63370674570498831]])
61599          res=generalTensorProduct(arg0,arg1,offset=0)
61600          ref=numarray.array([[0.41190862792168437, 0.038366211231207328, 0.32837555196698404, -0.23399042432886874, 0.073450280105292171], [-0.11760047955087297, 0.49800285967402291, 0.55156781517081821, 0.0066808132308359171, 0.27659584159914813], [-0.17937060284982476, -0.38124442113020368, -0.32497716547295497, 0.47418177055947069, 0.29887055343841645], [0.54615732971262076, 0.42935725764618765, 0.21780915602201942, 0.10168666584024907, 0.35449858047011973]])
61601          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61602          self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.")
61603          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61604       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61605       def test_generalTensorProduct_float_rank0_array_rank3_offset0(self):
61606          arg0=-0.959498524214
61607          arg1=numarray.array([[[0.027563264138124266, -0.86134683154644165], [-0.8117329937722968, -0.82085247002658135]], [[0.16560117669229291, -0.13409471539984441], [0.84610060594912695, 0.27635482631912045]], [[-0.30630109192629895, 0.65944726866182668], [-0.79975424716626953, -0.52724052564802748]], [[-0.71815840628111416, -0.060534894755772006], [-0.32528952507958842, -0.4407791883975869]], [[-0.11672438023008391, 0.98658294864906182], [-0.7586019012956271, -0.70780594519726536]], [[-0.27061897876441532, 0.50264763097728116], [-0.13069146868469272, -0.93327923188153727]]])
61608          res=generalTensorProduct(arg0,arg1,offset=0)
61609          ref=numarray.array([[[-0.026446911263045492, 0.82646101370504654], [0.77885660958017144, 0.78760673358776034]], [[-0.15889408464432439, 0.12866368153102073], [-0.81183228274459229, -0.2651620480125581]], [[0.29389544566836046, -0.63273868107784637], [0.76736301988975719, 0.50588650626499243]], [[0.68907193097846631, 0.058083142181601162], [0.31211481925607415, 0.42292698077164276]], [[0.11199687057053639, -0.94662488324327765], [0.72787740475893981, 0.67913875984653249]], [[0.25965851074870316, -0.48228966012226587], [0.12539827133029721, 0.89548004566972728]]])
61610          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61611          self.failUnlessEqual(res.shape,(6, 2, 2),"wrong shape of result.")
61612          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61613       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61614       def test_generalTensorProduct_float_rank0_array_rank4_offset0(self):
61615          arg0=-0.9304595906
61616          arg1=numarray.array([[[[-0.71233817194649296, 0.99590387266544389, -0.54947329367573428, 0.13512463808082553], [-0.0096671503124188263, -0.71547424252371372, -0.87762902434985546, -0.51167011163989562], [-0.53976710827994245, -0.81722257339839532, 0.66609455953777674, -0.3012912274862769]], [[-0.3835829449196122, 0.40197040371247073, -0.35580710017866091, -0.22359872548955528], [0.89475596756920872, -0.038969787629618002, 0.42318904869360141, -0.62860155992094824], [0.18493393151046011, 0.30831212239060291, -0.97294385206858314, 0.34374933089323689]]], [[[0.75135090873481869, 0.84105513930538378, 0.96419194632206584, 0.4852944932936063], [0.91295235140726794, -0.31225039241780017, 0.72482670566986074, -0.86549920269175828], [0.79904918654713297, 0.20271226330974756, 0.86916793104369861, 0.97625696820391017]], [[0.84237487359749474, 0.19875587560825458, -0.1370588278661049, 0.48021237433557817], [0.93576386199601491, -0.29835765385660262, -0.28932131971598651, -0.35577113589894438], [-0.54706437371089223, 0.9747796823610706, -0.69765793608042537, 0.73540906219094726]]], [[[-0.57475948602306959, 0.31447138930161533, 0.55698363425662079, 0.7023790406039192], [-0.49766651685862384, 0.72614255431525354, 0.9196332538458043, 0.21160591767894599], [0.66872133503379083, -0.17608099285829648, -0.43372494211856294, -0.14815693304419097]], [[-0.86705044864551706, 0.55419517665074491, -0.16633978403913985, -0.56691172352847152], [-0.60732289573658971, 0.11286145485281507, -0.2159763164709434, 0.13593235955593097], [-0.43283967020676672, 0.24820403897102916, -0.90853794595044901, -0.50887126866884214]]]])
61617          res=generalTensorProduct(arg0,arg1,offset=0)
61618          ref=numarray.array([[[[0.66280188383834704, -0.92664830963760803, 0.51126269587935846, -0.12572801542870757], [0.0089948927219654223, 0.66571987078372175, 0.81659834269556519, 0.47608836259890092], [0.50223148258969874, 0.7603925810736486, -0.61977407116865091, 0.280339312178363]], [[0.35690842989118515, -0.3740172172717694, 0.33106412876494029, 0.20804957857777526], [-0.83253427127168034, 0.036259812643637576, -0.39376030899400677, 0.584888350094797], [-0.17207355020133885, -0.28687197117669033, 0.90528493827287704, -0.31984486169207099]]], [[[-0.69910165893861242, -0.78256782059042129, -0.8971416436349996, -0.45154691555058102], [-0.84946527112804804, 0.29053637229387003, -0.67442195981379072, 0.80531203380151672], [-0.7434829789842009, -0.18861556952886133, -0.80872563728188707, -0.90836765895576488]], [[-0.78379578001956007, -0.18493431064787386, 0.12752770086446202, -0.4468182092255118], [-0.87069045993142946, 0.27760974045990022, 0.26920179669489441, 0.33103066545595899], [0.50902129319508249, -0.9069931041752366, 0.64914251758448893, -0.68426841492998791]]], [[[0.53479047605870211, -0.29260292014510936, -0.5182507643015194, -0.65353531456660052], [0.46305858353178531, -0.67564630380567492, -0.85568158087584967, -0.19689075553216687], [-0.62221817962127124, 0.16383624852743653, 0.40356353207680556, 0.13785403926490378]], [[0.80675540547657154, -0.51565621717914967, 0.15477244735761136, 0.52748845018084956], [0.56508941292929604, -0.10501302307691202, 0.20095723500292909, -0.1264795676217533], [0.40273982233618566, -0.2309438284863411, 0.8453578452339523, 0.47348415231389973]]]])
61619          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61620          self.failUnlessEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.")
61621          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61622       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61623       def test_generalTensorProduct_float_rank0_Symbol_rank0_offset0(self):
61624          arg0=0.562491357932
61625          arg1=Symbol(shape=())
61626          res=generalTensorProduct(arg0,arg1,offset=0)
61627          s1=numarray.array(0.00324768537641)
61628          sub=res.substitute({arg1:s1})
61629          ref=numarray.array(0.0018267949575127625)
61630          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61631          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
61632          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61633       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61634       def test_generalTensorProduct_float_rank0_Symbol_rank1_offset0(self):
61635          arg0=0.91409519904
61636          arg1=Symbol(shape=(2,))
61637          res=generalTensorProduct(arg0,arg1,offset=0)
61638          s1=numarray.array([0.25097568619682953, 0.66141307495224799])
61639          sub=res.substitute({arg1:s1})
61640          ref=numarray.array([0.22941566982832673, 0.60459451639622652])
61641          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61642          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
61643          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61644       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61645       def test_generalTensorProduct_float_rank0_Symbol_rank2_offset0(self):
61646          arg0=-0.311325649398
61647          arg1=Symbol(shape=(4, 5))
61648          res=generalTensorProduct(arg0,arg1,offset=0)
61649          s1=numarray.array([[-0.53341277380602681, 0.052789259508221553, -0.46627917301069455, 0.40862339417134952, 0.15143180032582815], [0.54096274036698166, -0.82847910456928209, 0.55799114401979533, 0.065333685515621687, -0.4530989159792318], [-0.39265311994330632, 0.24478822309545256, -0.80333346366189651, -0.95364825169535239, 0.96393006642570644], [-0.67841811398166496, -0.080815522855093525, 0.67452861057759494, 0.63833330100743257, -0.60552157272965412]])
61650          sub=res.substitute({arg1:s1})
61651          ref=numarray.array([[0.16606507820234179, -0.01643465049763583, 0.14516466633830988, -0.12721494354960419, -0.047144603575944445], [-0.16841557644486413, 0.25792679524269291, -0.17371695527028735, -0.02034005207071465, 0.1410613142587574], [0.12224298755449474, -0.076208852520170609, 0.25009831225767254, 0.29689516125630866, -0.30009615390422589], [0.21120895989869806, 0.025159945134299692, -0.2099980577255903, -0.19872952946849839, 0.18851439685454879]])
61652          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61653          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
61654          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61655       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61656       def test_generalTensorProduct_float_rank0_Symbol_rank3_offset0(self):
61657          arg0=0.948217578168
61658          arg1=Symbol(shape=(6, 2, 2))
61659          res=generalTensorProduct(arg0,arg1,offset=0)
61660          s1=numarray.array([[[0.98956741355064559, -0.066566677430423216], [0.18490642626135512, 0.084333580416641851]], [[-0.38416624166659097, 0.8916666431591378], [0.92443095579442658, -0.95236048247261551]], [[0.090214611115947196, 0.32155545842962718], [-0.89091389581014746, -0.13578318477225881]], [[-0.80325400851047579, -0.68882946382410637], [0.67724602964181235, 0.26516640136299263]], [[-0.25182151850795664, 0.60267348542466626], [-0.32739949654327516, 0.9846936281180958]], [[-0.32951069619917894, -0.19958050878192046], [0.22979437488771959, 0.40330955678907743]]])
61661          sub=res.substitute({arg1:s1})
61662          ref=numarray.array([[[0.93832521631142629, -0.063119693659797402], [0.17533152369732824, 0.079966583380943729]], [[-0.36427318328717662, 0.84549398490996364], [0.87656168208735175, -0.90304495023353559]], [[0.085543080067773447, 0.30490453803899203], [-0.84478021664173131, -0.12875200262075262]], [[-0.76165957060391598, -0.65316020595837732], [0.64217659005116867, 0.25143544291206438]], [[-0.23878159041032027, 0.57146559277572551], [-0.31044595770583955, 0.93370380729206115]], [[-0.3124478343305907, -0.18924574668682295], [0.21789506563277009, 0.38242521119073652]]])
61663          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61664          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
61665          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61666       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61667       def test_generalTensorProduct_float_rank0_Symbol_rank4_offset0(self):
61668          arg0=-0.830323568577
61669          arg1=Symbol(shape=(3, 2, 3, 4))
61670          res=generalTensorProduct(arg0,arg1,offset=0)
61671          s1=numarray.array([[[[0.92676883544399891, -0.95357774937706141, 0.44347735429402935, -0.53674237545550874], [-0.53618249287540465, 0.054049986177377995, 0.72613620912428045, -0.28868935976044963], [0.20433401785227878, 0.27989385328052796, -0.3658661214474892, -0.75219187171324098]], [[-0.63438082192292056, -0.27326168466178813, -0.57030787945284733, 0.91431123438277839], [-0.53016547615535026, 0.29706122745133667, -0.8448922838417019, 0.98820530445796062], [0.65022989699942624, -0.18844283546637386, -0.47823095324118414, -0.51899670756954275]]], [[[-0.3559753902541265, -0.69420800259668458, -0.33725718940187477, -0.72032568863041679], [-0.075850351806678207, 0.99922387833838888, 0.30593283824914952, -0.83367628611194378], [-0.4885046491104339, -0.59346613300382312, 0.33205663307371358, -0.1422627978413098]], [[0.21495156425639994, -0.65773972125079339, -0.76226004103345057, 0.84364839691041404], [-0.55673769626116831, -0.13335088242311155, 0.67181611603927371, -0.21087210630906528], [-0.69602070926428317, -0.81184445666761773, -0.40347003250595415, 0.1046531171453815]]], [[[0.94481376866460276, 0.43015674438105722, 0.95064531378740225, -0.6933804604356999], [-0.30034452340652074, 0.48851034708096575, 0.35779832302502368, -0.39943794345218087], [-0.53735828002736974, -0.96196465128721043, -0.32324088295403741, -0.64525597145923785]], [[0.39078335151136634, -0.76954000771915809, 0.53002063914038744, 0.98370783019272001], [0.61744183260742247, -0.72158480396307612, -0.32831391466301851, -0.54773198963454428], [0.13277046692417094, -0.39115875964425006, 0.28530880796795333, -0.29975932254106996]]]])
61672          sub=res.substitute({arg1:s1})
61673          ref=numarray.array([[[[-0.7695180066917473, 0.7917780797783196, -0.36822969940047423, 0.44566984459467673], [0.44520496089278067, -0.044878977404334268, -0.60292800843299688, 0.23970557940648587], [-0.16966335088476636, -0.2324024630786358, 0.3037872635816799, 0.62456263917549903]], [[0.52674134789580573, 0.22689561716371981, 0.47354007365483014, -0.75917416692268691], [0.440208890097598, -0.24665693846323711, 0.70153397618255486, -0.82053015488418601], [-0.53990120847197365, 0.15646852761719493, 0.39708643169916724, 0.43093519830882043]]], [[[0.29557475636137182, 0.57641726605074217, 0.28003259303239042, 0.59810339632124265], [0.062980334789936684, -0.82967913646921176, -0.25402324599990272, 0.69222106892243129], [0.40561692351579676, 0.49276891738528572, -0.27571444854340627, 0.1181241539793348]], [[-0.1784793499045674, 0.54613679254375436, 0.63292247745449226, -0.70050114754686177], [0.46227243072087254, 0.11072438056644067, -0.55782475489722305, 0.17509207982387695], [0.57792239911976584, 0.67409358638965566, 0.33501067720419403, -0.086895949690852722]]], [[[-0.78450114003821148, -0.35716928304191398, -0.78934320939489178, 0.57573013829048558], [0.24938313647743976, -0.40562165467502242, -0.29708838040497898, 0.33166273863224499], [0.44618124467668718, 0.79874192210165917, 0.26839452344435427, 0.53577124086760841]], [[-0.32447662696737073, 0.63896720537209006, -0.44008862851047204, -0.81679579600268848], [-0.51267650583927482, 0.59914886945750623, 0.27260678123645937, 0.45479478025709713], [-0.11024244789810295, 0.32478833718793959, -0.2368986275783812, 0.24889723040650436]]]])
61674          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61675          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
61676          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61677       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61678       def test_generalTensorProduct_float_rank0_constData_rank0_offset0(self):
61679          arg0=0.492353721328
61680          arg1=Data(-0.437214319534,self.functionspace)
61681          res=generalTensorProduct(arg0,arg1,offset=0)
61682          ref=Data(-0.21526409724074577,self.functionspace)
61683          self.failUnless(isinstance(res,Data),"wrong type of result.")
61684          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
61685          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61686       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61687       def test_generalTensorProduct_float_rank0_constData_rank1_offset0(self):
61688          arg0=0.979385563268
61689          arg1=Data(numarray.array([0.22021089255261517, 0.058911120671208295]),self.functionspace)
61690          res=generalTensorProduct(arg0,arg1,offset=0)
61691          ref=Data(numarray.array([0.21567136904043174, 0.057696701101331072]),self.functionspace)
61692          self.failUnless(isinstance(res,Data),"wrong type of result.")
61693          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
61694          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61695       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61696       def test_generalTensorProduct_float_rank0_constData_rank2_offset0(self):
61697          arg0=0.893109236094
61698          arg1=Data(numarray.array([[0.24257610887747383, -0.65008541717841628, 0.48802129697853314, 0.30692856887415387, -0.19693437626450594], [0.13995561961849101, -0.84910283958592947, 0.75493100427342497, -0.49757304316066131, -0.19063332091428498], [-0.79406208009322277, 0.19120266450540702, -0.45800904239997786, 0.97077527365053884, -0.093067565850555312], [-0.48333222905652629, 0.33404120334791765, -0.95795583626960612, -0.73075610350636455, -0.21982935302054085]]),self.functionspace)
61699          res=generalTensorProduct(arg0,arg1,offset=0)
61700          ref=Data(numarray.array([[0.21664696329411298, -0.58059729033178953, 0.43585632774189431, 0.27412073968249034, -0.17588391034615794], [0.12499565652447372, -0.75834158842747634, 0.67423585252999541, -0.44438708047797454, -0.17025637961573875], [-0.70918417776293485, 0.17076486563548052, -0.40905210598179487, 0.86700836306856577, -0.083119502641878118], [-0.4316684778720799, 0.29833528394583791, -0.85555920514213146, -0.65264502537328806, -0.19633162554712047]]),self.functionspace)
61701          self.failUnless(isinstance(res,Data),"wrong type of result.")
61702          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
61703          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61704       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61705       def test_generalTensorProduct_float_rank0_constData_rank3_offset0(self):
61706          arg0=-0.924871621274
61707          arg1=Data(numarray.array([[[-0.49196475442088961, -0.89958484497998437], [0.03667241962030432, -0.91332100267882388]], [[-0.068836761067621488, -0.8937589667158885], [0.352093300296908, -0.81959241996961585]], [[-0.80055182544351133, -0.3773665122896539], [-0.69441106223348092, -0.63654140604730358]], [[0.42481016174814346, -0.45547410821063816], [0.74132831354824424, 0.31652739609917768]], [[0.38927838785348512, 0.61511029145913154], [0.067559642866422021, -0.36889709018737538]], [[-0.71710685925061046, -0.93229262781841427], [-0.14607137297036554, 0.76869118084057808]]]),self.functionspace)
61708          res=generalTensorProduct(arg0,arg1,offset=0)
61709          ref=Data(numarray.array([[[0.45500424003079537, 0.83200049404994214], [-0.033917280190262501, 0.84470467649093994]], [[0.063665166811845531, 0.82661230457448431], [-0.32564110148523012, 0.75801777024098305]], [[0.74040766471160846, 0.3490155780357565], [0.64224108495831334, 0.58871908221884839]], [[-0.39289486302957366, 0.42125507690899289], [-0.68563351924750693, -0.29274720600780807]], [[-0.36003253370088834, -0.56889805252398207], [-0.062483996430543948, 0.34118244988477031]], [[0.66323178354164614, 0.86225099419199092], [0.13509726754078608, -0.71094065868286649]]]),self.functionspace)
61710          self.failUnless(isinstance(res,Data),"wrong type of result.")
61711          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
61712          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61713       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61714       def test_generalTensorProduct_float_rank0_constData_rank4_offset0(self):
61715          arg0=-0.654494887933
61716          arg1=Data(numarray.array([[[[-0.31265817991493638, -0.56344925108921839, -0.57407369384449813, 0.028201611177590236], [-0.38160761903964802, -0.94776552441561646, 0.12952381532000024, 0.99370451175785579], [-0.45670830806395868, -0.4269561068126726, -0.3197087826645344, -0.56291971481992209]], [[0.0099674773600433308, -0.79509036110792475, 0.12830933951956824, -0.71959824965957853], [-0.057384362906059749, -0.12489982212229056, 0.75546275888631653, 0.60256192749401727], [0.94843178641124792, -0.32002343091073437, 0.36892162742911272, 0.42888548418981642]]], [[[-0.2571586475956773, -0.6554762697408425, -0.80029997202655712, 0.63741645520041756], [-0.96452873606684619, 0.22876390981988015, 0.19455884399440571, -0.030775884405276566], [-0.65171657793426574, -0.91060004615194057, 0.23746336000046475, -0.97272499257481537]], [[0.66919098226677409, -0.79235908747095452, -0.12370863164652168, -0.64863084247180791], [0.07763296595450031, 0.025873684646505968, -0.55172752736832331, 0.30779290739216703], [-0.45176445022090106, -0.36574516631567411, 0.61968281176274198, -0.7996747868985763]]], [[[-0.21325609084379304, -0.92770142734538341, -0.80644823451720549, -0.021573294263919518], [-0.56304400996409343, 0.88063022592481244, 0.53014487801115928, 0.65994018859582404], [-0.23765598450411773, 0.45571357522494549, 0.86787085427924882, 0.33054855747647127]], [[-0.14130841318382781, -0.097733741841565136, -0.90093713704584788, -0.59209444992807092], [-0.9823260800621505, -0.89018187293512185, -0.87797797897766827, -0.66633877208399461], [0.45851185562387342, -0.82922164076306015, 0.27949294872833819, 0.82705868854527842]]]]),self.functionspace)
61717          res=generalTensorProduct(arg0,arg1,offset=0)
61718          ref=Data(numarray.array([[[[0.20463318042481957, 0.36877465444767443, 0.37572829791814377, -0.018457810347212149], [0.2497602358578036, 0.62030769068933422, -0.084772674992541971, -0.65037452306165711], [0.29891325290447474, 0.27944058928074866, 0.20924776388127911, 0.36842807566644481]], [[-0.0065236629777381087, 0.52038257679008604, -0.083977806789640674, 0.47097337576786119], [0.037557772169318736, 0.081746295082803178, -0.49444651371499376, -0.39437370120800019], [-0.62074375575949925, 0.20945369954991414, -0.24145731920034499, -0.28070335691098325]]], [[[0.16830902023918198, 0.4290058677068942, 0.52379224050445183, -0.41718581141316469], [0.63127912702040612, -0.14972480952071948, -0.12733776879652839, 0.020142659014876111], [0.42654516863928543, 0.59598307515816651, -0.1554185551917415, 0.63664353500506099]], [[-0.43798207694458963, 0.51859497215714234, 0.080966667005857751, 0.42452557055359263], [-0.05081037935231137, -0.016934194333133468, 0.36110284619458349, -0.20144888443026523], [0.29567752321952512, 0.23937834163988086, -0.40557923243877619, 0.52338306003417645]]], [[[0.13957502127787724, 0.60717584172587158, 0.52781624687425255, 0.014119610811613606], [0.36850942620289984, -0.57636798102723463, -0.34697711252226521, -0.43192747977762819], [0.15554462694467305, -0.29826220534648129, -0.56801703751197363, -0.2163423410820387]], [[0.092485634050765445, 0.063966234413885908, 0.58965875054566586, 0.387522790651533], [0.6429273976841211, 0.58261948516682438, 0.57463209895879241, 0.43611531996064951], [-0.30009366556258327, 0.54272132484298996, -0.18292670615606885, -0.5413056836736081]]]]),self.functionspace)
61719          self.failUnless(isinstance(res,Data),"wrong type of result.")
61720          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
61721          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61722       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61723       def test_generalTensorProduct_float_rank0_expandedData_rank0_offset0(self):
61724          arg0=0.817315288431
61725          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
61726          arg1=msk_arg1*(-0.107441089832)+(1.-msk_arg1)*(-0.984717408273)
61727          res=generalTensorProduct(arg0,arg1,offset=0)
61728          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
61729          ref=msk_ref*numarray.array(-0.087813245324982178)+(1.-msk_ref)*numarray.array(-0.80482459256581285)
61730          self.failUnless(isinstance(res,Data),"wrong type of result.")
61731          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
61732          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61733       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61734       def test_generalTensorProduct_float_rank0_expandedData_rank1_offset0(self):
61735          arg0=-0.731273459059
61736          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
61737          arg1=msk_arg1*numarray.array([0.32690953465836348, -0.45530172275332514])+(1.-msk_arg1)*numarray.array([-0.88987813857334852, -0.4432112304820599])
61738          res=generalTensorProduct(arg0,arg1,offset=0)
61739          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
61740          ref=msk_ref*numarray.array([-0.23906026620885493, 0.33295006571315844])+(1.-msk_ref)*numarray.array([0.65074426453515033, 0.32410860960822918])
61741          self.failUnless(isinstance(res,Data),"wrong type of result.")
61742          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
61743          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61744       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61745       def test_generalTensorProduct_float_rank0_expandedData_rank2_offset0(self):
61746          arg0=0.360959926398
61747          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
61748          arg1=msk_arg1*numarray.array([[0.21279479867851991, -0.79951867079866279, -0.51299350043200365, 0.43341112620605893, 0.43115383961180132], [0.095600939708326615, -0.62487659659900729, -0.8972300314905306, 0.70070531945488557, -0.043889499904746776], [0.036459699641055776, 0.36036292372913703, 0.76467901872563138, -0.94350337048486743, 0.64310715960498266], [-0.52886376314585903, -0.55067938504224667, -0.62817382273271871, -0.28542028247487106, -0.93139070440443028]])+(1.-msk_arg1)*numarray.array([[-0.41945831254126453, 0.74812933596756603, 0.024606024120077175, 0.30230913992714581, -0.83094099057447934], [-0.93950985371619633, 0.1289378703502706, -0.091682152683265628, 0.83274570145517623, -0.78477292031180745], [-0.31532918040306912, -0.73226858806142991, -0.018223951762351032, -0.71913243020658002, 0.99376692794750765], [-0.46929748118089498, 0.49015272355041128, 0.49943394318132239, 0.70263478992839801, 0.64512615939951812]])
61749          res=generalTensorProduct(arg0,arg1,offset=0)
61750          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
61751          ref=msk_ref*numarray.array([[0.07681039486886862, -0.28859420056528523, -0.18517009615857116, 0.15644404821539876, 0.15562925821247639], [0.034508108160693995, -0.22555541031618939, -0.32386408612886697, 0.25292654053709901, -0.015842350655260948], [0.013160490498927454, 0.13007657442582526, 0.27601848231727305, -0.34056690716645094, 0.23213591299701974], [-0.1908986250196808, -0.19877319029372675, -0.22674557681873131, -0.10302528415461623, -0.33619472010957319]])+(1.-msk_ref)*numarray.array([[-0.15140764162191003, 0.27004471004701208, 0.0088817886553296428, 0.10912148489753506, -0.29993639879881734], [-0.33912540764756238, 0.046541404191544206, -0.033093583084558675, 0.30058782710548326, -0.28327157555486715], [-0.11382119774942288, -0.26431961565019652, -0.0065781162868183175, -0.25957798907775781, 0.35871003716866551], [-0.16939758426580687, 0.17692549101651922, 0.18027563937137625, 0.25362300205720512, 0.23286469101425278]])
61752          self.failUnless(isinstance(res,Data),"wrong type of result.")
61753          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
61754          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61755       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61756       def test_generalTensorProduct_float_rank0_expandedData_rank3_offset0(self):
61757          arg0=0.460701578466
61758          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
61759          arg1=msk_arg1*numarray.array([[[0.54899887614412735, 0.61695096532471561], [0.42902761477167273, 0.53516312400600285]], [[0.34321063427267418, 0.74380368798820795], [0.31540686527488004, -0.80432967300638936]], [[0.8394622964445968, 0.28392277440231517], [-0.33424678334360336, -0.066072706587715802]], [[-0.73373584571143158, -0.54187213946866164], [0.20402337375362967, -0.36147631706777439]], [[0.025149006205081648, 0.24833725969162024], [0.11408358615465741, 0.88899127442537362]], [[-0.090389209416217309, 0.26603033945702514], [-0.86492517119016843, -0.76494342510693047]]])+(1.-msk_arg1)*numarray.array([[[0.38159118801718828, -0.17804225869194479], [0.44387615914706902, -0.46254001770783448]], [[0.33391775245439814, 0.90997515595679168], [-0.099210191102322209, 0.63824730355994697]], [[0.94948895681219558, 0.47237233803777778], [0.10390798726523331, 0.51199456724475523]], [[-0.45550582497404379, 0.15986250058221763], [0.3438598995629607, -0.77259614029062695]], [[0.67624092130153546, 0.43614859456114963], [-0.98236612768868814, 0.55899862257148825]], [[-0.74765636708258953, 0.093812196029846584], [-0.20196712295659558, -0.58464411474345512]]])
61760          res=generalTensorProduct(arg0,arg1,offset=0)
61761          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
61762          ref=msk_ref*numarray.array([[[0.25292464881576143, 0.28423028356133345], [0.19765369933089225, 0.24655049596646056]], [[0.15811768095580175, 0.34267153312513765], [0.1453084406912088, -0.37055594996123453]], [[0.38674160503487481, 0.13080367032964532], [-0.15398802068364323, -0.030439800218493813]], [[-0.33803326229647818, -0.24964134998006152], [0.093993890332293745, -0.16653270985126706]], [[0.011586186855537013, 0.1144093675318965], [0.052558488218533754, 0.40955968337043563]], [[-0.041642451454361927, 0.12256059730774667], [-0.39847239162244641, -0.35241064338409334]]])+(1.-msk_ref)*numarray.array([[[0.17579966264830565, -0.082024349613063929], [0.20449444716256251, -0.21309291626177682]], [[0.15383643563362226, 0.41922699071430736], [-0.045706291640771765, 0.2940415402018543]], [[0.43743106113959046, 0.21762268175776686], [0.047870573748337301, 0.23587670529577037]], [[-0.20985225256608406, 0.073648906355779184], [0.15841679849988005, -0.35593626134877443]], [[0.31154525986704501, 0.20093434596013007], [-0.45257762565789311, 0.25753154777910819]], [[-0.34444646846524291, 0.043219426790329557], [-0.093046572344377784, -0.26934646650327554]]])
61763          self.failUnless(isinstance(res,Data),"wrong type of result.")
61764          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
61765          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61766       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61767       def test_generalTensorProduct_float_rank0_expandedData_rank4_offset0(self):
61768          arg0=0.784374548175
61769          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
61770          arg1=msk_arg1*numarray.array([[[[-0.90066927489131876, -0.1878533156916542, -0.59694523049679371, 0.72172638004705458], [0.43240312937102132, -0.13129148954521397, -0.56659689512004441, 0.73070004905350916], [-0.69413612468093455, -0.42386294361359211, -0.16373619790315486, 0.29396503282525854]], [[0.63129930928189593, 0.46134620780199342, -0.54540114997909495, -0.99570985746853435], [-0.42410817885551055, -0.3197610798525401, -0.52261060185934016, 0.3800995849889357], [0.23309633169638544, -0.14220779059692501, 0.67437183748558427, 0.66400661133603367]]], [[[0.95301604528523898, 0.44783390626244168, 0.66854797756177331, -0.73974685438936039], [-0.039463004415484448, -0.51600084748783526, -0.016360924329686499, 0.41712475114362069], [0.53457162281142012, 0.61051584302119832, -0.41824942120758601, 0.93056070139777969]], [[0.24214706167067845, 0.44711603020288027, 0.12713667042831944, -0.45911885553102172], [-0.90454927042871036, 0.92137663178187656, 0.043620737006642374, 0.14858975911746897], [0.091386022828089386, 0.52565798890642301, 0.88050542742087501, 0.17773357292037728]]], [[[0.69079441729603985, -0.2366215804326115, -0.75270404082148401, -0.3064845139073471], [0.030604832318570807, 0.8076694815171781, -0.41126928764355308, -0.60305476385054346], [0.87808093962682476, -0.67989393718579905, -0.30799513849552373, -0.013741421259001019]], [[-0.02352341183500406, 0.94502612799375796, -0.34204026680763322, 0.68878510202234078], [0.69059482886993284, 0.53344010160184108, 0.034253916177040766, 0.33325848459854823], [0.13793314057353512, -0.50974887540980696, -0.37881088325214796, 0.94047672177021813]]]])+(1.-msk_arg1)*numarray.array([[[[0.58649064480268387, 0.1553497755096267, 0.91854259329782217, 0.2567973933780654], [-0.22563953102189838, 0.12872158640774867, -0.88923251502378253, -0.046050599461417541], [0.08360342295121681, -0.094708790395032105, -0.55305030205236494, -0.57352186464112576]], [[-0.86421349852991436, -0.57959800013126106, -0.56765879912871453, -0.5793629140992389], [0.44733466091869878, 0.17296098727803111, -0.38704753152222282, -0.063316911212001559], [-0.80300394716403201, 0.18272341166141337, -0.48077928437016659, 0.8426094766450376]]], [[[-0.42353165706394535, -0.99814635688525977, 0.44639643837548326, 0.17533350802389069], [0.3903526484974027, -0.68762456688689766, 0.059015447607134952, -0.56039875901037384], [0.43364147648970786, -0.34938403943126994, 0.70459617381735562, 0.2564937912679659]], [[0.83741112510024718, -0.23562155256082784, -0.20672187238999595, -0.85959771540048013], [-0.47722342901549109, -0.028854042984841843, 0.44566963226943268, -0.25216641587477873], [0.47805932138545626, -0.35957607104467737, -0.13669450407909722, -0.44083080747298431]]], [[[0.25404535302439712, 0.71750765779505032, -0.78968487605459647, -0.25599841278627555], [0.95030212417116089, 0.16916124879325034, -0.96299006099109752, 0.051273810341706305], [-0.099801382561338636, -0.24966458030138017, -0.58025100729329537, 0.1602631091128075]], [[-0.63613006417582807, -0.56605379211879847, 0.7966572261877094, -0.12946642218948567], [0.097043582654898097, -0.010020676619000302, 0.071892565137961162, 0.78315181813034029], [0.068437370712741918, 0.22446399438934228, 0.49297329176941385, 0.9618124192862052]]]])
61771          res=generalTensorProduct(arg0,arg1,offset=0)
61772          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
61773          ref=msk_ref*numarray.array([[[[-0.70646205554816099, -0.14734735961885401, -0.46822864545626175, 0.56610380325552934], [0.33916600922993634, -0.10298170279127589, -0.44442418360725466, 0.57314252082794093], [-0.54446270916869066, -0.33246730488512055, -0.12843050625021182, 0.2305786898016193]], [[0.49517511048130142, 0.36186822329702939, -0.42779878058908577, -0.78100946956547201], [-0.33265966116719697, -0.25081245253334944, -0.409922454704988, 0.29814044023727654], [0.18283482985564831, -0.11154417149645617, 0.52896010532983295, 0.52082988575204547]]], [[[0.74752152992432297, 0.35126951788213651, 0.52439201783345812, -0.58023860467567823], [-0.030953776258031442, -0.40473793160628979, -0.012833092628826445, 0.32718203821096919], [0.4193043751099898, 0.47887308852355231, -0.3280642007842382, 0.7299081297084784]], [[0.18993399208989012, 0.35070643417227221, 0.099722768423712069, -0.360121144865859], [-0.70950542529472427, 0.72270437925309483, 0.034214995880654235, 0.11655002517122616], [0.0716808703653109, 0.41231274754315855, 0.69064604679905806, 0.13940969095498446]]], [[[0.54184155894853014, -0.18559994524033083, -0.59040189192899695, -0.24039865211877043], [0.024005651521856661, 0.63351538463993262, -0.32258916167374729, -0.47302080792017048], [0.68874434028104359, -0.53329149978716728, -0.24158354759758383, -0.010778421091313979]], [[-0.018451165529620405, 0.74125444215886038, -0.26828767973496132, 0.54026550318858091], [0.54168500686698151, 0.41841683867247559, 0.026867900024597442, 0.26139947328253732], [0.10819124481575262, -0.39983404383238241, -0.29712961539475108, 0.7376860037078059]]]])+(1.-msk_ref)*numarray.array([[[[0.46002833452608544, 0.12185240997448181, 0.72048143159765354, 0.20142533940348853], [-0.17698590519576501, 0.10096593617897251, -0.697491352194474, -0.036120918145746382], [0.065576397103260631, -0.074287164674322795, -0.43379858079048028, -0.44985595344647983]], [[-0.67786707243630839, -0.454621919476206, -0.44525711408426072, -0.4544375239760563], [0.35087792254120959, 0.13566619624814175, -0.30359023266006907, -0.049664173623762825], [-0.62985585823968782, 0.14332359346295173, -0.37711103394984424, 0.66092142753159111]]], [[[-0.33220745214742486, -0.7829205976945951, 0.35014200465778711, 0.13752714113621164], [0.30618268229414197, -0.53935520896607625, 0.046290215052203522, -0.43956252339670343], [0.34013733719164019, -0.27404794806852778, 0.55266730548396126, 0.2011872016355542]], [[0.65684397288739027, -0.1848155488302379, -0.16214737525383394, -0.67424656962968366], [-0.37432191151264432, -0.022632376929263051, 0.34957191644674274, -0.19779291851673853], [0.37497756421265882, -0.28204231826028153, -0.10721968987507459, -0.34577646543332957]]], [[[0.19926670899452006, 0.56279474489523684, -0.61940871785611107, -0.20079863936280262], [0.74539279927668478, 0.13268577809095791, -0.75534489398709803, 0.040217871819996656], [-0.078281664353810038, -0.19583054236924541, -0.45513412167388184, 0.12570630379951078]], [[-0.49896423166857456, -0.44399818743603975, 0.62487765184149069, -0.10155016640873719], [0.07611851629823814, -0.0078599636954381283, 0.056390698297244246, 0.61428435349857013], [0.053680531731105444, 0.17606384418074045, 0.38667570299407383, 0.75442118180691087]]]])
61774          self.failUnless(isinstance(res,Data),"wrong type of result.")
61775          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
61776          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61777       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61778       def test_generalTensorProduct_array_rank0_float_rank0_offset0(self):
61779          arg0=numarray.array(0.429129135575)
61780          arg1=-0.799328581784
61781          res=generalTensorProduct(arg0,arg1,offset=0)
61782          ref=numarray.array(-0.34301518334135217)
61783          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61784          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
61785          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61786       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61787       def test_generalTensorProduct_array_rank0_array_rank0_offset0(self):
61788          arg0=numarray.array(0.546867720148)
61789          arg1=numarray.array(-0.945901917593)
61790          res=generalTensorProduct(arg0,arg1,offset=0)
61791          ref=numarray.array(-0.51728322515706049)
61792          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61793          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
61794          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61795       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61796       def test_generalTensorProduct_array_rank1_array_rank1_offset1(self):
61797          arg0=numarray.array([0.84720838597731163, 0.96761384931609951, -0.34350404065584983])
61798          arg1=numarray.array([0.14254722554740384, 0.38587156635226205, -0.9756326729326732])
61799          res=generalTensorProduct(arg0,arg1,offset=1)
61800          ref=numarray.array(0.82927564188954528)
61801          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61802          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
61803          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61804       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61805       def test_generalTensorProduct_array_rank2_array_rank2_offset2(self):
61806          arg0=numarray.array([[-0.75781563843283184, -0.75850235491912232, -0.81113786053232517], [-0.03044399430833189, -0.84899525253564301, 0.6258693367354744]])
61807          arg1=numarray.array([[-0.10841119021549361, 0.48014833287233638, -0.84646955254583744], [0.52283861134408616, 0.42335269030510125, 0.2326408917305347]])
61808          res=generalTensorProduct(arg0,arg1,offset=2)
61809          ref=numarray.array(0.17482663666982518)
61810          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61811          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
61812          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61813       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61814       def test_generalTensorProduct_array_rank3_array_rank3_offset3(self):
61815          arg0=numarray.array([[[-0.8153269130841081, 0.17933782883732352, -0.43004524333572203], [-0.79659523841190438, -0.54615778391768433, 0.73882102683333684], [-0.062560136120825005, 0.28621797203970023, 0.60181889130122102], [-0.23925977312195656, 0.75413230705168921, 0.6894549260050078]], [[0.86389223650701474, 0.34983088476049984, -0.99072388411935641], [0.97773824089764849, -0.40341579722993282, 0.60824758458576778], [0.13314845911006024, 0.73735869125571529, 0.63607675958349441], [0.64514334408370333, -0.55788020254365867, -0.57393752641692264]]])
61816          arg1=numarray.array([[[0.82509682932791151, 0.34085004075489223, 0.86786217768207141], [-0.074344546420591406, -0.94106264423041486, 0.58087776473158814], [-0.66677170138006336, -0.18820701915956106, -0.46260048175481994], [0.64697907742849048, -0.91375703656948848, -0.54702303697544985]], [[-0.28006947957606276, 0.94695171957122404, -0.41268476423978551], [0.1132248264062643, 0.39040983533108164, -0.5070652190578413], [0.60254179777716166, 0.48166498600982544, -0.6592222787118307], [-0.7615692606536244, -0.14705739460559064, -0.78227235493562408]]])
61817          res=generalTensorProduct(arg0,arg1,offset=3)
61818          ref=numarray.array(-1.2953232993207786)
61819          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61820          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
61821          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61822       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61823       def test_generalTensorProduct_array_rank4_array_rank4_offset4(self):
61824          arg0=numarray.array([[[[0.36248549255875262, 0.091838491211693851], [0.7037325270990471, -0.93290932113097402], [0.069265207604657597, 0.84511754541809503]], [[0.19662389575931849, 0.63983092676360642], [-0.53521386731656051, -0.8252813406871593], [0.26226333062458851, 0.46334621698540213]]], [[[-0.30254044787592349, 0.36624814583088572], [-0.17752570771436771, -0.7843303400869146], [-0.72899755849546843, 0.71829546687988821]], [[0.6782946796420346, 0.43148769710793666], [-0.81311833569324543, 0.66649633139730069], [-0.065423058658944599, 0.52043325921384476]]], [[[-0.067084014526594737, 0.85324579597733252], [-0.082612945659737758, -0.64257113348664774], [-0.41051998237559717, -0.38596828641208636]], [[0.090950584098632214, -0.23992873381286217], [-0.52854542430173423, -0.68019908988771016], [0.79703194646529574, 0.84319707625193985]]], [[[-0.25170474336308812, -0.83151570202341762], [0.9207903138368343, 0.52327187743451753], [0.23917637941896719, 0.38391817730861333]], [[-0.57503520340721059, -0.51879943369773929], [0.9870163716709055, -0.1941471308329128], [-0.20307712083518181, 0.41578476595661429]]]])
61825          arg1=numarray.array([[[[0.46468570499331086, -0.62470326452016001], [-0.71751051702010571, 0.61937894335259158], [0.8318048107526439, 0.82369383918361017]], [[-0.28511598434234608, 0.34627941816668772], [-0.66600426356686615, 0.41718600873523037], [0.046768800500033514, -0.17335288109212499]]], [[[0.32233606745140531, 0.43868100492599882], [-0.26115011727326709, -0.96866241078491333], [0.9631940136888999, 0.82348226383267886]], [[-0.349958535801556, -0.54169319708263508], [0.47122891718492199, 0.058655956565393685], [-0.37452501463104682, -0.41919398399202534]]], [[[0.16301940524472114, 0.51922895031291905], [0.1796779907351258, -0.45595423564575688], [0.91962363419968907, 0.96543204461471377]], [[0.09251380274804788, 0.23758617600674947], [0.58387993999262733, -0.10837464916271955], [-0.12932247692954668, -0.51497343906113824]]], [[[-0.1518232443562908, 0.90329953208243507], [-0.2605365503636714, 0.29824149005377532], [0.6769406475314439, 0.36945730938732391]], [[0.72412792885087618, 0.18038060746789197], [-0.32591365871103073, 0.081261268277464049], [0.6193115963045166, 0.4999657987136692]]]])
61826          res=generalTensorProduct(arg0,arg1,offset=4)
61827          ref=numarray.array(-2.4776044528835741)
61828          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61829          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
61830          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61831       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61832       def test_generalTensorProduct_array_rank0_array_rank1_offset0(self):
61833          arg0=numarray.array(0.430018952533)
61834          arg1=numarray.array([0.17405266481347681, 0.12684725858108425])
61835          res=generalTensorProduct(arg0,arg1,offset=0)
61836          ref=numarray.array([0.074845944608683102, 0.054546725266730989])
61837          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61838          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
61839          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61840       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61841       def test_generalTensorProduct_array_rank1_array_rank2_offset1(self):
61842          arg0=numarray.array([-0.2596702139875493, -0.2895735074501018, -0.88211626259666986])
61843          arg1=numarray.array([[-0.95159197241138482, -0.45620300561671234], [0.17942838282450158, 0.46668790449160968], [-0.56794717501757241, 0.81081773034821758]])
61844          res=generalTensorProduct(arg0,arg1,offset=1)
61845          ref=numarray.array([0.69613782433314564, -0.7319136272398028])
61846          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61847          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
61848          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61849       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61850       def test_generalTensorProduct_array_rank2_array_rank3_offset2(self):
61851          arg0=numarray.array([[-0.97489218317706583, -0.045252664981564106, -0.89113304764498258], [-0.3501913135304584, -0.55826461424592799, -0.8654061515474869]])
61852          arg1=numarray.array([[[0.2212209414743862, -0.054349150407258406], [-0.2714427214637134, -0.7744767637879284], [0.021192602734496413, 0.52949723477208965]], [[-0.016772505939617766, -0.86275907314487599], [-0.88314137189927888, -0.11775415644726928], [0.46675795463063086, -0.35554943541255901]]])
61853          res=generalTensorProduct(arg0,arg1,offset=2)
61854          ref=numarray.array([-0.12730353075159806, 0.29174259527508767])
61855          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61856          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
61857          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61858       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61859       def test_generalTensorProduct_array_rank3_array_rank4_offset3(self):
61860          arg0=numarray.array([[[0.50878561502983222, -0.14479198118117953, 0.36673894379996397], [0.34487989411006525, -0.52851371261539493, 0.55304935318837289], [0.59081646267938503, -0.80626315077884403, 0.020388460504169093], [0.45589740066146556, -0.60784017956404757, 0.11066067969213056]], [[0.25411533156671218, 0.61497379354121429, 0.66407113202176649], [-0.17271277418374931, -0.088165136251946219, 0.96981177074973979], [0.84958965929853103, 0.87243005824919195, 0.56545158124645556], [-0.47408488299609086, 0.13974289822365438, -0.35740794171351919]]])
61861          arg1=numarray.array([[[[0.11551790541956874, -0.15413632243003517], [0.25625731218580516, 0.927856687758978], [0.37594143013173831, 0.096294046812871237]], [[-0.1848865607798087, 0.43615288915744865], [-0.812304374439905, -0.99117632000028477], [0.907063259654181, -0.087549928919734787]], [[0.76742345834864034, 0.8563058102374741], [0.089128802167366183, 0.74698696172226686], [0.4615317283307987, 0.15958079697544769]], [[0.9357672352900428, -0.71813075885429223], [0.61171418377630227, -0.41339745776309056], [0.2597444842508625, -0.72639669475449908]]], [[[0.1013387379838655, 0.22473934630570636], [-0.14823547162087158, -0.50588269052448287], [0.55392022443062272, -0.18689656551671097]], [[-0.15185627741409657, 0.10714820021851423], [-0.056191863739971204, 0.34237024415476913], [-0.10863630473038999, -0.99980719636997906]], [[0.82776942923713159, -0.99778393075254601], [-0.54089965762023295, -0.48381357764476496], [0.17563110482978428, -0.52781836872553356]], [[0.3324304601921122, 0.32728086982667914], [0.789467675087689, -0.42774499808857303], [-0.91733053032511402, 0.30800389436676268]]]])
61862          res=generalTensorProduct(arg0,arg1,offset=3)
61863          ref=numarray.array([2.340750975303576, -3.0908910578666107])
61864          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61865          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
61866          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61867       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61868       def test_generalTensorProduct_array_rank0_array_rank2_offset0(self):
61869          arg0=numarray.array(0.563644591)
61870          arg1=numarray.array([[0.24500474080387091, -0.16226262506701583, -0.51786911047006479, -0.74021941654589174, -0.76057283926604691], [0.0044066131645983386, 0.9295484546164996, 0.24351213924959803, -0.23620282130383896, -0.92179962140932048], [0.48070433412714064, 0.96944856929747059, -0.66799958468547249, 0.91640592254796149, -0.036391524613143211], [-0.21129212235996686, -0.53722133447432108, 0.60673583943966247, 0.48039040450883896, -0.46093067578426417]])
61871          res=generalTensorProduct(arg0,arg1,offset=0)
61872          ref=numarray.array([[0.13809559692354159, -0.091458450940539296, -0.29189412296260842, -0.41722067028951781, -0.42869276691407671], [0.0024837636748567347, 0.52393495851731298, 0.13725430013095699, -0.13313444260692819, -0.51956737059352265], [0.2709463978011819, 0.54642444233753551, -0.37651435269843869, 0.51652724140483297, -0.020511886006453831], [-0.11909366188917685, -0.30280189934643437, 0.34198337406621521, 0.27076945306987138, -0.25980108223193088]])
61873          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61874          self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.")
61875          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61876       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61877       def test_generalTensorProduct_array_rank1_array_rank3_offset1(self):
61878          arg0=numarray.array([-0.055353661857031167, -0.58911500691978236, 0.23067676644596946])
61879          arg1=numarray.array([[[-0.89547806204576075, -0.4030293427981857, 0.43945118560188035, -0.2407765205686041, -0.7101213828926265], [-0.92741361662773203, -0.48272025345512382, 0.1639226094990256, 0.7053354652879591, 0.33162548844980599], [-0.19077567305995879, -0.69667359146432539, -0.99293341267288548, 0.51713992356824967, -0.5869751307126696], [-0.50223473208053182, -0.5044191409852683, 0.087329520581260311, -0.92793743087045044, 0.93873910856543641]], [[0.10177648203570122, 0.82862807638003422, 0.98554789045537516, -0.9583551777910877, 0.025683658444351165], [-0.017396067806169313, 0.92214054364746767, 0.62702164606076516, 0.23747634052356892, 0.36278252490414165], [0.74660461948563595, 0.74012638853691692, -0.81960422874870487, -0.30238856772085065, 0.48159866903979798], [-0.55527429450489985, 0.99102565989449287, -0.60107446343982751, -0.23025264311510862, -0.60710517046895118]], [[-0.89222526508707611, 0.25954042635560803, -0.86816945818315516, -0.59801247196502905, -0.63342224404360792], [-0.59187664394248785, -0.10742425820274915, 0.24022981085805384, 0.63002278029827452, -0.14248109796902209], [0.54019491748629744, 0.45137450270730706, 0.10176541504494185, -0.57521007247825784, 0.12259261444948], [0.086167133203624457, 0.86833395220043896, -0.83157977981206677, -0.60852604630694662, 0.11018823423717539]]])
61880          res=generalTensorProduct(arg0,arg1,offset=1)
61881          ref=numarray.array([[-0.21620570216354729, -0.40597813867711757, -0.80519280797671267, 0.43996169597141899, -0.12193860476701268], [-0.074948166017119247, -0.54130677959066154, -0.32304614208220955, -0.03361215908564294, -0.26494439377926826], [-0.30466543666122703, -0.29333451735712057, 0.56127856814101817, 0.016828455156927935, -0.22294651244861929], [0.37479770704340498, -0.35560217363326707, 0.15744184328736791, 0.0466372015547038, 0.33110998508857248]])
61882          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61883          self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.")
61884          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61885       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61886       def test_generalTensorProduct_array_rank2_array_rank4_offset2(self):
61887          arg0=numarray.array([[0.44725799816010214, -0.30781810713277391, -0.42095006385057743], [0.23951656502926255, -0.70741474776970859, 0.82912121602278477]])
61888          arg1=numarray.array([[[[-0.45899871970899264, 0.90138237319513981, -0.88486761864911045, 0.91326764012723216, 0.6330995367560559], [-0.98584312311868993, -0.88769403279970627, 0.88503141460828383, -0.078475848210554755, -0.55207750765863217], [0.85710266168441884, -0.68787977782117626, -0.43109610187579839, -0.29472766265280481, -0.69964136094610918], [0.084963159911480846, 0.78201696882933147, 0.21017306762010968, 0.0029497891099103946, 0.78500120370195914]], [[-0.81658605980180421, 0.15752417192889157, 0.24931502361618008, -0.93542356047097819, -0.50180732714728937], [0.74464188574171075, -0.11442604205622997, 0.64010084942366174, -0.69364846236481048, 0.26510763839198437], [0.79928632529201615, 0.36193749110686002, -0.9058319210578345, -0.50328246480883809, -0.78306328087440868], [0.39903589296138131, 0.78519164256929375, -0.35522033660816765, 0.86724063632987725, -0.66653006236768508]], [[0.25585306743771996, -0.64337901935686181, -0.052803226849122087, 0.498546335129749, 0.79227950816184278], [-0.47713335663907452, 0.78417760075495258, 0.42013084877264628, -0.78791206665497637, 0.59906704860464743], [0.89689992123555196, 0.7286365786968787, -0.83325476268992937, 0.91527342231374575, 0.60628167536899524], [0.63533250205997005, 0.063424137848401063, 0.22852083010701318, 0.56652665099407118, -0.18357308988204046]]], [[[-0.22759605447156139, 0.80481113860278497, -0.24327265123693542, -0.13919308406348718, -0.12171689045768574], [-0.032402323837273483, 0.80198761021642073, 0.5358359846116636, -0.25911827883089167, 0.013134937082985854], [-0.84648187757795701, 0.043551710340560712, -0.68644287344765242, 0.11555625407117409, -0.14712685177866569], [-0.95458011575892376, -0.0081606835963243807, 0.24576319422438453, -0.47490439749357716, 0.75409670953211183]], [[-0.96547293480754437, 0.014018860754857698, -0.905098400556825, -0.16378556114177001, -0.51098386854290467], [-0.28232848587187442, 0.88836702158793401, -0.24312610243309707, 0.82668454674738445, 0.50950352877292415], [0.51035153018748858, -0.13746930893447296, -0.1782379191628285, 0.88283679016516747, 0.030395603440791508], [0.26005611848397492, 0.44503666833548827, 0.73884405329601099, 0.081272914408241803, 0.47378420261473875]], [[0.49535985942088212, 0.31601482732470054, -0.94651465562676829, 0.67346224422081558, 0.39352133698367764], [0.53863779912361065, -0.15732598653992702, -0.17036979805672403, 0.68863209612718057, -0.82620984731646763], [-0.29741264158990655, -0.47266815407684382, -0.2905006272000874, -0.39039145987783463, -0.86932976507925197], [-0.63751143745363303, 0.14708387794956779, -0.17722675840809776, 0.88241605499470266, -0.32485554712278386]]]])
61889          res=generalTensorProduct(arg0,arg1,offset=2)
61890          ref=numarray.array([[0.9775578981158688, 1.0703551711428427, -0.65304353199915166, 1.1274505615804493, 0.76271530590722469], [0.16926730775768839, -1.2587023877046706, 0.18102401009024222, 0.43417776142217956, -1.6230157132814935], [-1.0506066238715461, -1.0100102822578922, 0.15759239355005075, -1.282720224426189, -1.104614815851122], [-1.2934528198236481, -0.11346101366247871, -0.50359830985940413, 0.056276260063267469, 0.2096552880880454]])
61891          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61892          self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.")
61893          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61894       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61895       def test_generalTensorProduct_array_rank0_array_rank3_offset0(self):
61896          arg0=numarray.array(0.484459788449)
61897          arg1=numarray.array([[[-0.75859581736483772, -0.66071378873280318], [-0.78537935758374333, -0.46936266139450566]], [[-0.9835100329443871, -0.78474737120841942], [-0.019768759108839351, -0.29063344595908247]], [[0.15080898367774731, -0.89012122626553913], [-0.72128162006096441, -0.78363527564152391]], [[-0.39496668382498301, 0.16948877599172452], [0.6007037490315128, 0.058101560867611424]], [[-0.61627032371103585, 0.10127408641319069], [-0.99337269549800622, 0.79274912503853723]], [[0.38681173819880388, -0.29508915818850312], [0.0017876145256237042, -0.77116990677230168]]])
61898          res=generalTensorProduct(arg0,arg1,offset=0)
61899          ref=numarray.array([[[-0.36750916919911536, -0.32008926231504869], [-0.38048471742749046, -0.22738733564519642]], [[-0.47647106249803073, -0.38017854544179819], [-0.0095771688557740649, -0.1408002177456367]], [[0.073060888328779827, -0.4312279409708607], [-0.34943194106712439, -0.37963977985872455]], [[-0.19134547609038444, 0.082110496561486626], [0.29101681117652572, 0.028147869886498863]], [[-0.29855819065264816, 0.049063222479133459], [-0.48124912591230418, 0.38405507340956069]], [[0.1873947328575099, -0.14295883114969291], [0.00086602735491260799, -0.37360080989339833]]])
61900          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61901          self.failUnlessEqual(res.shape,(6, 2, 2),"wrong shape of result.")
61902          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61903       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61904       def test_generalTensorProduct_array_rank1_array_rank4_offset1(self):
61905          arg0=numarray.array([-0.041265439380634428, -0.54458056973457958, 0.70617486649744965])
61906          arg1=numarray.array([[[[-0.4170322705848184, -0.74155544497018533], [0.61849739185841446, 0.0092847477829254288]], [[-0.41657759742951406, 0.7090979264053161], [0.86382203605428098, 0.33610524375849771]], [[-0.98176093809152198, -0.52574582602174424], [0.28269388763484748, -0.042771475027286288]], [[-0.42339945356073927, -0.23653986422970918], [0.050943526834795083, 0.40928337145601335]], [[-0.1790836685237005, -0.38066539813790179], [-0.24460605803201951, -0.49402831601340735]], [[-0.76429020976031192, 0.90305364048652725], [-0.038626600456146409, 0.54278133275477125]]], [[[0.1658491458321214, -0.80211857071524895], [0.35040521374731615, 0.71226294440115412]], [[0.75377567117819644, -0.43266857566179429], [0.29333777422524987, 0.95491135959627238]], [[-0.99300199547058132, -0.10794098411486774], [-0.52314096741700356, -0.52337325665206369]], [[-0.90316468829125429, 0.39073466422364289], [-0.22759988867688108, -0.47039532691207286]], [[-0.36854310572321891, -0.8854187838778198], [0.52757626416524461, -0.27777773850411469]], [[0.66568793993691133, -0.11465488314176109], [0.31017566150088172, -0.66331138663872169]]], [[[0.09960176563284473, -0.075231296466667708], [0.25230304074464316, 0.77570554577439488]], [[0.78271851360361433, -0.713061202065157], [-0.89185163150359692, 0.84373582655898627]], [[0.69415653208388006, 0.26029843826331822], [-0.017582406242760973, 0.6602623431358261]], [[0.75365039178655757, 0.72386216222676025], [-0.024108328291647885, 0.017580674971473309]], [[0.66029932923188395, 0.71418533200066525], [0.063878472413904541, -0.55997900024276004]], [[-0.96481934361787158, -0.52789893250496922], [-0.68175538292192428, 0.455996112764677]]]])
61907          res=generalTensorProduct(arg0,arg1,offset=1)
61908          ref=numarray.array([[[-0.0027729388969794933, 0.4142923487578144], [-0.038176371456545483, 0.15951606096895421]], [[0.15943481498088519, -0.2971842372297363], [-0.82519525488929935, 0.061929331862617842]], [[1.0714782852907008, 0.26429391003040115], [0.26081066522279361, 0.75304456201861725]], [[1.0415266698041328, 0.30814768114355118], [0.1048195745159147, 0.2516939277768559]], [[0.6743781714227095, 1.0022299221690529], [-0.23210463432874362, -0.22378444111688439]], [[-1.0123131174497126, -0.34761504186060899], [-0.64876021133715467, 0.66084137671836873]]])
61909          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61910          self.failUnlessEqual(res.shape,(6, 2, 2),"wrong shape of result.")
61911          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61912       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61913       def test_generalTensorProduct_array_rank0_array_rank4_offset0(self):
61914          arg0=numarray.array(-0.973401265831)
61915          arg1=numarray.array([[[[0.29457907415024165, 0.59612672000769606, -0.97060769583117157, 0.34621761283149932], [0.14003651050408683, 0.75675005310813948, -0.59491556001480639, -0.063692721275949937], [0.27215179353355268, 0.69169291689012646, 0.19450308319120313, 0.65046646267289598]], [[0.099753186595325172, 0.92051284383895604, 0.40137756555728887, -0.17524568831164333], [0.38146357238411022, -0.061413244035389392, 0.29554225117261557, 0.96623464403978399], [0.72136374896844679, 0.61756218303544586, -0.40419387511891269, 0.41307714541879959]]], [[[0.7830517807063484, 0.86353049401392545, 0.26936582709991086, -0.29994497467351189], [0.15545490072968282, -0.48233268791808492, 0.39862782016647103, 0.37169686347355113], [0.33658081581419452, 0.59511350313196809, 0.59136325019446279, -0.92660144923781207]], [[0.98818897330454503, -0.62652958861622032, 0.87415763036782979, -0.35689869665194074], [0.86461890456231427, -0.5684511336678657, 0.18767643730743999, 0.19866587632229638], [-0.43293767514707837, 0.40870353851520402, -0.19472418988420936, 0.75672439002930947]]], [[[-0.40216349448253053, -0.15298171315937537, 0.17111822737596372, 0.33854776785494756], [0.83777613798703765, 0.30789202676449867, 0.14632897062032701, 0.71038490896197293], [0.042356956471918172, 0.23916418386304406, 0.91086116710781795, 0.87638578464510575]], [[-0.73560531190415168, -0.37363420558312632, -0.67995148535918126, 0.47199115413336212], [-0.27194112419103589, -0.15001767237490915, 0.66188213671241125, 0.94485387402579413], [0.30443864615145677, 0.31743724195591216, -0.98475066295825453, 0.33545579885065679]]]])
61916          res=generalTensorProduct(arg0,arg1,offset=0)
61917          ref=numarray.array([[[[-0.28674364366502592, -0.58027050385088352, 0.94479075974690052, -0.33700866258300011], [-0.13631171658716612, -0.73662145961277137, 0.57909155918068145, 0.061998575514199752], [-0.26491290032360476, -0.67329476086684936, -0.18932954738625482, -0.63316487814609346]], [[-0.09709987810251694, -0.89602836740608571, -0.39070143038943494, 0.17058437483389324], [-0.37131712422692265, 0.059779729482806271, -0.28768120139782355, -0.94053402559762145], [-0.70217638637013091, -0.60113581069575828, 0.39344282968169014, -0.40208981623631462]]], [[[-0.76222359455039723, -0.84056167595640374, -0.26220103707053649, 0.29196681802669783], [-0.15131999714983008, 0.4695032489708979, -0.3880248247453012, -0.36181019741038623], [-0.32762819216780387, -0.57928423726148903, -0.57563373630493675, 0.90195502360847457]], [[-0.96190439749439971, 0.60986469463929982, -0.85090614393544772, 0.34740564309425959], [-0.84162113616194867, 0.5533310530750909, -0.1826844816416231, -0.19338161548945154], [0.42142208101388579, -0.39783254174010962, 0.18954477292111069, -0.73659647913935311]]], [[[0.39146645460011797, 0.14891259323825651, -0.16656669913443672, -0.32954282577410082], [-0.81549235319918145, -0.29970248859168536, -0.14243680522950233, -0.69148956961047858], [-0.041230315046493111, -0.23280271931360877, -0.88663341305860899, -0.85307503212941382]], [[0.71603914175915095, 0.36369600867219348, 0.66186563655196495, -0.45943678689421974], [0.26470783451892721, 0.14602739218668384, -0.64427690970646612, -0.91972195700157255], [-0.29634096353155581, -0.30899381314163193, 0.95855754185100239, -0.32653309923141544]]]])
61918          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61919          self.failUnlessEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.")
61920          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61921       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61922       def test_generalTensorProduct_array_rank0_Symbol_rank0_offset0(self):
61923          arg0=numarray.array(-0.957462297702)
61924          arg1=Symbol(shape=())
61925          res=generalTensorProduct(arg0,arg1,offset=0)
61926          s1=numarray.array(-0.559707298165)
61927          sub=res.substitute({arg1:s1})
61928          ref=numarray.array(0.53589863574133045)
61929          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61930          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
61931          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61932       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61933       def test_generalTensorProduct_array_rank1_Symbol_rank1_offset1(self):
61934          arg0=numarray.array([-0.36386467030272707, 0.79053000390700823, 0.49949697175291008])
61935          arg1=Symbol(shape=(3,))
61936          res=generalTensorProduct(arg0,arg1,offset=1)
61937          s1=numarray.array([-0.41668251834151615, -0.84458361932879855, -0.81891948201294307])
61938          sub=res.substitute({arg1:s1})
61939          ref=numarray.array(-0.92510044610547126)
61940          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61941          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
61942          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61943       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61944       def test_generalTensorProduct_array_rank2_Symbol_rank2_offset2(self):
61945          arg0=numarray.array([[0.24921109239870542, 0.070069423064783365, 0.18377777086430602], [-0.62079299114141939, 0.69372333437842615, 0.18995102366798089]])
61946          arg1=Symbol(shape=(2, 3))
61947          res=generalTensorProduct(arg0,arg1,offset=2)
61948          s1=numarray.array([[0.21185241787837517, -0.47522346439650831, 0.15044667792382516], [-0.96445248594758759, 0.24322056182988483, 0.43116514893080304]])
61949          sub=res.substitute({arg1:s1})
61950          ref=numarray.array(0.89649947772901273)
61951          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61952          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
61953          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61954       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61955       def test_generalTensorProduct_array_rank3_Symbol_rank3_offset3(self):
61956          arg0=numarray.array([[[0.89951661489407675, 0.57634448615134071, -0.53622729711472106], [-0.43350107796423099, -0.080051592191078047, -0.15553247466126097], [0.72180063867107735, -0.82980647180863376, -0.59717174549223451], [-0.83995910214212777, -0.8011097028059524, 0.48642967841411688]], [[0.032209410767552127, -0.29174761516294923, 0.60698244153542502], [-0.16082619446803559, 0.90130271430612341, 0.61908893637597195], [0.5316196866201981, -0.7645309286542088, 0.86841619625011068], [-0.046878997260848765, -0.21160695253715578, 0.58711713241006014]]])
61957          arg1=Symbol(shape=(2, 4, 3))
61958          res=generalTensorProduct(arg0,arg1,offset=3)
61959          s1=numarray.array([[[0.91690796541437947, 0.93895712717412416, 0.4960289759729275], [0.57518708286608367, -0.3607057205398787, 0.7394114541246426], [-0.31410764644321443, -0.29420028545817356, 0.75700165987390822], [-0.33725518282725941, 0.069572583101098928, 0.6692500078886463]], [[-0.10731293521792296, 0.80789326974389519, -0.51130078623618203], [0.56766444048947928, -0.43024591812978841, 0.63463592438763272], [-0.46509124824695425, 0.87273573225039591, -0.19057357437390876], [-0.42004672769206963, -0.80433128985257563, -0.92474583620338513]]])
61960          sub=res.substitute({arg1:s1})
61961          ref=numarray.array(-1.185796687546163)
61962          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61963          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
61964          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61965       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61966       def test_generalTensorProduct_array_rank4_Symbol_rank4_offset4(self):
61967          arg0=numarray.array([[[[0.5070106039208957, -0.80093573762737025], [0.96275336071758555, 0.075439570813181422], [0.49472379237646691, -0.43458105274270808]], [[0.72718767173515753, 0.80846558074432373], [-0.64809196852926876, -0.43919101455912912], [-0.893415135600508, -0.53830852436619581]]], [[[-0.7144096015445689, 0.46424273455446419], [0.87470571392874574, 0.73127223646986539], [0.44580582735968366, 0.09358399253891192]], [[-0.47531949689131281, 0.80987197534344246], [0.22102468059979441, 0.011807204402863203], [-0.25714838425275377, -0.63922489846208608]]], [[[-0.33241159141299415, 0.77011505826981685], [0.99202765676214599, -0.16610877114467915], [0.92115394272001705, -0.91405724352793505]], [[0.97188471308071089, 0.30319183123524751], [0.37241323053622089, 0.73658498120101434], [0.65837281703545369, 0.29231746666974989]]], [[[0.098894799684311918, -0.070761173565578872], [-0.91516821529268766, 0.44476922635848548], [-0.89095186965196538, -0.94200176632887711]], [[0.72634719623762956, -0.97327084224425731], [-0.96179619381454295, 0.52766972623475761], [-0.9488934329813703, -0.70402900917681022]]]])
61968          arg1=Symbol(shape=(4, 2, 3, 2))
61969          res=generalTensorProduct(arg0,arg1,offset=4)
61970          s1=numarray.array([[[[-0.11820066798291351, -0.51258557543222039], [-0.098364895518923579, -0.75261766421768717], [-0.063909470910654687, -0.73607442780090548]], [[-0.38847542547631408, 0.67314170861984213], [-0.089021817061877506, -0.36081485475815711], [0.85601942110178308, -0.079874643934933598]]], [[[-0.22567418092861158, 0.44842015216882913], [0.47159266399869981, -0.032362209916325435], [-0.23592039935287534, -0.92821348171903462]], [[-0.99825597347382367, -0.014365429430939214], [0.24509461408578925, 0.79747699887960977], [-0.44637938871932281, 0.35195013915421569]]], [[[-0.85809446703075554, 0.020878136895004173], [-0.67634718571481112, -0.60950223946435922], [0.50291952025652686, -0.10535591431772939]], [[0.97430474404201473, 0.18572127273504013], [0.47253795512498886, 0.63623230687133225], [-0.51874893042992887, 0.77155986057556136]]], [[[-0.30687039741377387, 0.32128067060991428], [0.50377807631485538, -0.6559782356049495], [-0.5583444443570067, 0.95056487885272278]], [[-0.56413370947964347, -0.3141119685197773], [-0.26123657655870547, 0.91755715991922915], [-0.5567270925980643, -0.59222723358438967]]]])
61971          sub=res.substitute({arg1:s1})
61972          ref=numarray.array(3.4217241320311644)
61973          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61974          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
61975          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61976       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61977       def test_generalTensorProduct_array_rank0_Symbol_rank1_offset0(self):
61978          arg0=numarray.array(0.108487093181)
61979          arg1=Symbol(shape=(2,))
61980          res=generalTensorProduct(arg0,arg1,offset=0)
61981          s1=numarray.array([0.84138252420927007, -0.92070896817838488])
61982          sub=res.substitute({arg1:s1})
61983          ref=numarray.array([0.091279144304962714, -0.099885039623576935])
61984          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61985          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
61986          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61987       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61988       def test_generalTensorProduct_array_rank1_Symbol_rank2_offset1(self):
61989          arg0=numarray.array([-0.88164918266823733, 0.51849070402116149, 0.21407376222612973])
61990          arg1=Symbol(shape=(3, 2))
61991          res=generalTensorProduct(arg0,arg1,offset=1)
61992          s1=numarray.array([[-0.66753189134297752, 0.63604973587224611], [0.24368306203710977, 0.90997330527638165], [-0.98449387680117129, -0.47340125794576626]])
61993          sub=res.substitute({arg1:s1})
61994          ref=numarray.array([0.5041220407057575, -0.19030281840593222])
61995          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61996          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
61997          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61998       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61999       def test_generalTensorProduct_array_rank2_Symbol_rank3_offset2(self):
62000          arg0=numarray.array([[-0.48368367521376232, 0.30609630853711667, -0.26702652782848735], [0.41384989253050808, -0.50719047280485663, 0.23578081638741089]])
62001          arg1=Symbol(shape=(2, 3, 2))
62002          res=generalTensorProduct(arg0,arg1,offset=2)
62003          s1=numarray.array([[[0.94427607440082362, 0.73859626063120443], [0.68317458423465416, -0.99520231028946493], [-0.20997916005756068, 0.88242044704976808]], [[0.76525228434960391, 0.78715761878550694], [0.40871097191938799, 0.19907179685124388], [0.68637205898056397, -0.78263837970114158]]])
62004          sub=res.substitute({arg1:s1})
62005          ref=numarray.array([0.079694931224933291, -0.85723771425921702])
62006          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62007          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62008          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62009       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62010       def test_generalTensorProduct_array_rank3_Symbol_rank4_offset3(self):
62011          arg0=numarray.array([[[-0.019572223955578893, -0.9250431623941755, 0.44113863083036331], [0.16475833916322835, 0.18179350359368796, 0.61858296572780058], [-0.2720849224062758, -0.76724652269718852, 0.79207356062815881], [-0.23899953264169271, 0.017892682882899358, -0.37426572707749517]], [[0.41051117825823735, -0.032439543670818693, 0.6211335817861523], [0.77419812491244255, -0.36484297441721059, 0.32162185231108009], [0.89581390224822743, 0.86956478253874758, -0.10849549467724673], [-0.42880379570159, -0.49982493514413084, -0.052879122591514394]]])
62012          arg1=Symbol(shape=(2, 4, 3, 2))
62013          res=generalTensorProduct(arg0,arg1,offset=3)
62014          s1=numarray.array([[[[0.87391667386784877, -0.6471677646729681], [-0.34183333619232692, 0.2618328015568907], [0.268334890441561, -0.28080804553410532]], [[-0.99864903808059657, -0.33782866020730462], [-0.88664715155393736, 0.11667158103125796], [0.59964444832918185, -0.62609715880501171]], [[0.22723251258215482, -0.4424072035615052], [0.77129609805160704, 0.8371606647229084], [-0.93328965088392013, 0.24195753531013242]], [[0.10584444738563992, 0.95898293264234202], [-0.54401506237790409, -0.34627867521321964], [-0.7302680224080853, -0.2290542842136678]]], [[[-0.6898420381456476, -0.16576591511921568], [-0.16678612923474789, 0.43246154039245743], [-0.58526569874414802, -0.36747268410116618]], [[-0.58344182130098132, -0.36469539378659577], [-0.68872653593994215, 0.092812389150101371], [-0.86846350365516822, 0.62743490904714494]], [[-0.25855664260307276, -0.9492244487968462], [-0.92969704766912842, 0.36333565697076509], [-0.073467842205704237, 0.73319138103443526]], [[0.40778032771627637, -0.34401855672469117], [0.2543827332672941, 0.43552413714033089], [0.30669085716473932, -0.069296006825886325]]]])
62015          sub=res.substitute({arg1:s1})
62016          ref=numarray.array([-3.1632114345394542, -2.3602881471017327])
62017          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62018          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62019          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62020       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62021       def test_generalTensorProduct_array_rank0_Symbol_rank2_offset0(self):
62022          arg0=numarray.array(0.455040090646)
62023          arg1=Symbol(shape=(4, 5))
62024          res=generalTensorProduct(arg0,arg1,offset=0)
62025          s1=numarray.array([[0.18689217676364223, 0.43741941176715082, 0.14945398547643274, -0.26067257495533847, -0.60874095714372567], [0.55554155897958468, -0.55346823947274082, 0.31980465520665247, 0.70796260301073999, 0.24071914382063953], [-0.44601774141459916, 0.13052963266249162, -0.43045278573316748, 0.31729655731190576, -0.77333782351433955], [-0.72070257520136849, -0.77044763579497211, -0.04139231794665621, -0.091555910165080245, 0.47241932906674289]])
62026          sub=res.substitute({arg1:s1})
62027          ref=numarray.array([[0.085043433055538617, 0.19904336878080359, 0.06800755509858801, -0.11861647213657918, -0.27700154031855706], [0.25279368135563862, -0.25185023785930649, 0.14552393929421814, 0.3221513670479193, 0.10953686102434891], [-0.20295595348298187, 0.059396215878717115, -0.19587327463880366, 0.14438265420084379, -0.35189971331187342], [-0.32794856514836923, -0.35058456203006877, -0.018835164110490639, -0.041661609660686626, 0.2149697343214092]])
62028          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62029          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62030          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62031       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62032       def test_generalTensorProduct_array_rank1_Symbol_rank3_offset1(self):
62033          arg0=numarray.array([0.69261168472180512, 0.25365734042241272, 0.84943826521908639])
62034          arg1=Symbol(shape=(3, 4, 5))
62035          res=generalTensorProduct(arg0,arg1,offset=1)
62036          s1=numarray.array([[[0.68885706909213917, -0.65202153072428182, 0.6261285538208996, 0.34721912808941968, -0.089315251083961655], [0.80381675905121908, -0.57216740190522941, 0.82470959561442947, 0.27246398430511132, -0.9972757144407598], [-0.22169304397082157, 0.37234701973945517, -0.66935271898725701, 0.93278354992490553, -0.52458317948156341], [0.50398300848981581, -0.77543421503402299, -0.18608364241577902, -0.26294305822629416, -0.54765425234742993]], [[0.7093795777051215, 0.2705953748419847, 0.49310825191934216, 0.43517647000100101, 0.10419151917614733], [0.27389239246670538, -0.2303115997373768, -0.329250102164383, 0.89127380373365095, -0.91200365016766849], [0.23890238241051676, -0.98515286709664185, -0.29358318884600765, 0.71671700644000724, 0.57486481575414028], [0.83986326924122401, 0.59444101381262837, 0.85187919309651039, 0.21375159163354041, 0.98681298894840097]], [[0.92019060411747078, 0.21872878646329008, 0.36924088100677022, -0.66670264741451568, 0.63721942293971989], [0.4618475495949228, 0.72805243234044648, -0.46132130777896729, -0.42828611469801903, -0.11860992183089802], [-0.13459197354298946, 0.29963478116170505, -0.23995949401169159, 0.07645975667540994, -0.85338422976148531], [-0.42775379707854544, 0.85155800233404433, -0.015298622995842281, -0.13410285391723598, 0.60928767765959324]]])
62037          sub=res.substitute({arg1:s1})
62038          ref=numarray.array([[1.4386949026195341, -0.19716262682995825, 0.87239181364688412, -0.21544900896824143, 0.50584671831000161], [1.0185186768527195, 0.16372553908151177, 0.095822825787557353, 0.050987267552316029, -1.0228130393058292], [-0.20727542225167622, 0.26252188917493779, -0.74190182156243534, 0.89280515875279409, -0.94241097914475347], [0.19875156044422004, 0.33705548077213021, 0.074206469631460034, -0.24180986989158129, 0.38855289183805991]])
62039          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62040          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62041          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62042       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62043       def test_generalTensorProduct_array_rank2_Symbol_rank4_offset2(self):
62044          arg0=numarray.array([[0.3039031119878608, -0.46902944817620895, -0.44578563165877094], [-0.80408081597354619, 0.25386737228506684, 0.67140851967585236]])
62045          arg1=Symbol(shape=(2, 3, 4, 5))
62046          res=generalTensorProduct(arg0,arg1,offset=2)
62047          s1=numarray.array([[[[-0.7263198493755374, 0.41904505539463011, 0.62028771669774407, 0.3399262059509971, 0.77016983399369865], [0.61404312962626517, 0.89616485410854163, -0.68019137772344873, 0.16692385359091166, 0.8493678342931037], [-0.44709754369522159, -0.97629085323232334, 0.89129750684206099, 0.90458110464850172, 0.88105135078018559], [0.7773611433790939, 0.46510160723654459, 0.17770531005480272, -0.64727757502491245, 0.65450344044478048]], [[-0.55275453692537346, 0.04580544549354526, 0.88315714627967568, -0.19976922382794315, -0.93320819590088133], [-0.59604629038500878, 0.26722391030409054, -0.51704885626719332, 0.89797871613171276, -0.82316582800822435], [-0.42709666311894368, -0.19737072428338598, -0.53187264500240472, 0.3941846918094376, -0.23130808509598322], [-0.4703798656484568, -0.80834752615263628, 0.79231878041242454, 0.31063362607484923, 0.81711403637294655]], [[0.52648144284381293, 0.72207380343518701, -0.78353420303272348, -0.076693518541859795, -0.47001685584179387], [-0.76843681971154343, -0.9895347885157586, 0.88163402522052969, -0.12693131163753169, 0.33380827597641671], [-0.3222421039510619, 0.75106816768685447, 0.84282915735514985, 0.59382684882384917, -0.19922655262290134], [-0.52714059312842299, -0.98166350594347263, -0.30681161042064753, 0.73300771282988264, 0.95340535851031061]]], [[[-0.052278161619904395, 0.63409984871791414, -0.51065188116020144, 0.66473745611932111, 0.43562785427842066], [-0.12208923066493016, 0.3732032006981516, 0.10885065610075229, 0.40488446751220653, -0.14025724107980087], [0.91619382187166654, -0.38057512677947702, -0.85375638984117419, -0.44377333923125728, 0.65135742691899678], [-0.086367612992696907, 0.74519488858450966, -0.68393350024952237, -0.45417846856628397, -0.95934406298597197]], [[0.51957119310746447, -0.32270541491288429, 0.81484723489763278, 0.096250871173069852, -0.95029164011783007], [-0.38276064312286895, -0.55473818935587738, -0.91309027789119468, -0.87640582593842975, 0.62339088180769453], [-0.9466807402305879, -0.87893287805822551, 0.3081486631688175, 0.80360638114146465, 0.12486797541643435], [0.8909434794049067, -0.46117744168311603, 0.50373971600741707, -0.35581016383564457, -0.53680159160692842]], [[-0.31832036380648088, 0.45836580426357942, 0.90480600953309942, -0.22878050845203379, -0.98953245101753917], [0.32769362994007945, 0.75323594687200446, -0.98573717113446935, -0.96261733160912311, 0.6601996860915138], [0.54893410536584719, -0.37750642947621627, 0.43557336829842952, -0.23466449436952375, 0.24491067970190938], [0.35792431433305527, -0.14927724289874322, 0.49926138099833861, 0.90623067822960146, -0.0040842419516855522]]]])
62048          sub=res.substitute({arg1:s1})
62049          ref=numarray.array([[-0.23595553353137594, -0.50006632635561277, 1.3485319191584209, -0.43248171363355531, -0.37462266478061279], [1.0297464382360819, 0.65294536705185269, -1.3383818062720076, -1.5082257829228833, 1.2097080648270018], [-0.40036871552609365, -0.70952079882714991, 1.2017765873272452, 0.22858463563347567, 0.13744789582420677], [1.2277976364526209, 0.14159527400356242, 0.83218579365567358, 0.21414830656459077, 0.023012229433182374]])
62050          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62051          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62052          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62053       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62054       def test_generalTensorProduct_array_rank0_Symbol_rank3_offset0(self):
62055          arg0=numarray.array(0.890045711116)
62056          arg1=Symbol(shape=(6, 2, 2))
62057          res=generalTensorProduct(arg0,arg1,offset=0)
62058          s1=numarray.array([[[0.49254859843576848, -0.87591437650742887], [0.65951944732768886, 0.62391289331539457]], [[0.56006360504326724, 0.25580615479271751], [0.81538317307965458, -0.42091246260962034]], [[-0.041061181788684786, -0.41035548527018695], [0.71939662130420423, 0.37291912317303932]], [[0.86828122599620094, 0.76141592812588854], [-0.38080320814229718, 0.63409187587724269]], [[0.42738473899131413, -0.32958638811270657], [0.76318734863948845, -0.83807304191658871]], [[-0.79738808556006968, -0.81656788454722151], [0.60156187537550854, -0.98408669269014215]]])
62059          sub=res.substitute({arg1:s1})
62060          ref=numarray.array([[[0.4383907675541347, -0.77960383411560596], [0.58700245549184782, 0.555310994805572]], [[0.49848220962113232, 0.22767917095042836], [0.72572829611600298, -0.37463133210112182]], [[-0.03654632874438847, -0.36523513969780647], [0.64029587738341409, 0.3319150661734408]], [[0.77280998124078182, 0.67769498120413696], [-0.33893226218640576, 0.56437075457827324]], [[0.38039195393580816, -0.29334695118204968], [0.67927162643485017, -0.74592331656010913]], [[-0.70971184564803269, -0.72678274347662131], [0.53541756714909139, -0.87588214019555377]]])
62061          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62062          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
62063          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62064       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62065       def test_generalTensorProduct_array_rank1_Symbol_rank4_offset1(self):
62066          arg0=numarray.array([0.67072802523959729, 0.59461710689684333, -0.16300700133972379])
62067          arg1=Symbol(shape=(3, 6, 2, 2))
62068          res=generalTensorProduct(arg0,arg1,offset=1)
62069          s1=numarray.array([[[[0.49821714413461771, 0.80260117129412767], [-0.2685890917723317, -0.71656715065610177]], [[0.67394122903184828, -0.14517418062465337], [-0.81135731591198779, -0.38467070393599778]], [[-0.13181904535409261, -0.14043244159422108], [0.65318246231755639, 0.85055397524611576]], [[0.25868965591758908, 0.51066328218361678], [0.84809238904361317, 0.76705402769879205]], [[-0.12740704486405785, -0.70236977382568555], [-0.168964587730285, -0.98844892460350597]], [[-0.49806733863097352, 0.78279804813564513], [0.41669567229466309, -0.30208857559768898]]], [[[-0.71869152579169149, -0.87885492135497922], [0.33985067924909851, -0.20039734809753118]], [[0.52573356595897236, -0.38845082770242856], [0.084116831936275283, 0.73565996928047461]], [[-0.13412399355825033, 0.10177238322584614], [0.98289441645331066, 0.5382233798734064]], [[-0.57089446816259537, -0.53034613162130273], [-0.52586582175554319, -0.52164496435518548]], [[-0.47574911626276029, -0.75126572539751479], [-0.14923656277625552, 0.32918282612656014]], [[-0.8546900413028411, -0.20575588644458942], [-0.35993460099361729, 0.14811324060177355]]], [[[0.99919179315869955, -0.91703684167820243], [0.38520927955450524, 0.77081562040274343]], [[0.24281899809330842, -0.10449645566089116], [0.9525423503592465, 0.35634470582752775]], [[-0.70607945128034144, -0.65904715761561561], [-0.081889162310331498, 0.95174225620630648]], [[-0.98301995159609001, -0.63795520002123141], [-0.7611225240219055, -0.81512912067127719]], [[-0.39858370564805412, -0.44448601105154517], [-0.4704990616544924, -0.64947765146816039]], [[0.14267517123892426, -0.27951838491077852], [-0.4038009311306261, -0.71137402893167945]]]])
62070          sub=res.substitute({arg1:s1})
62071          ref=numarray.array([[[-0.25605333255767082, 0.16522835363896238], [-0.040861013001742261, -0.72542970413435581]], [[0.72506024491765741, -0.31131824493834132], [-0.64945385519922505, 0.12133989903462757]], [[-0.053071254933571066, 0.073752926750072278], [1.0359021241583499, 0.73538656594858898]], [[-0.0057140803719399891, 0.13115445652734165], [0.38021882006867547, 0.33717736738361359]], [[-0.30337210408361037, -0.84536021173374554], [-0.12537325629155027, -0.36137325113502028]], [[-0.86553809395862225, 0.44826207280638397], [0.13128857321098306, 0.0014103401487729206]]])
62072          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62073          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
62074          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62075       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62076       def test_generalTensorProduct_array_rank0_Symbol_rank4_offset0(self):
62077          arg0=numarray.array(-0.400251875744)
62078          arg1=Symbol(shape=(3, 2, 3, 4))
62079          res=generalTensorProduct(arg0,arg1,offset=0)
62080          s1=numarray.array([[[[-0.22197379460122835, -0.10398529612468255, 0.059085870828096798, -0.017020343031995955], [0.14794601501598792, -0.37637653830071294, -0.080078380627205181, 0.75906007920591634], [-0.84380727698036684, -0.18871835732459563, 0.55510187324873805, 0.45065510434797451]], [[0.38813306746694654, -0.92749223673246739, -0.69012284027771775, 0.91009148738457446], [0.34231741346424971, 0.71945900893965464, 0.63636166211955958, -0.26713803142744941], [-0.47881479842994445, 0.46198399733436202, 0.52143954006095505, -0.087831548652862912]]], [[[-0.049482141878419705, 0.020405158789798872, -0.83890927247519254, 0.49583829636983268], [-0.25613180995076035, -0.79931270295807133, -0.43883411017454255, 0.73382185566986968], [-0.67910496127373299, -0.82638174316309976, -0.46368660790294269, -0.059914211794997341]], [[0.75389399630623366, 0.27288699324460652, -0.90093152494903528, 0.34740945300647708], [-0.030591423029421971, 0.015320153615452359, 0.79899710335876839, 0.054552176701410771], [-0.031661857391701576, -0.7171520089613348, -0.18398512942605239, 0.21148092032953492]]], [[[0.13482430473744555, -0.72854703723588199, -0.69388277527948605, -0.66260185041589281], [-0.83733354172273988, -0.59474295465065108, -0.90619106544835804, -0.71436982067592547], [-0.27260558132720769, -0.50066883889989855, -0.46238560157498787, 0.56476116340530247]], [[0.43038927632611834, 0.025885145824974698, 0.60281390710033378, -0.17385516645046395], [0.16214980639303644, 0.97610905254347702, 0.57091119642593968, -0.400630520972733], [0.34644307872452762, 0.98092242059827872, 0.24847789255006858, -0.72936194577577429]]]])
62081          sub=res.substitute({arg1:s1})
62082          ref=numarray.array([[[[0.088845427655083728, 0.041620309823666088, -0.023649230628894458, 0.0068124242243572343], [-0.059215670018951637, 0.15064541544077292, 0.032051522052555147, -0.30381522050431342], [0.33773544537755779, 0.075534876506435228, -0.22218056599663724, -0.1803755508287401]], [[-0.1553509882917932, 0.3712305074898703, 0.2762229613147118, -0.36426582492403053], [-0.13701318683879041, -0.28796481784878497, -0.2547049489147189, 0.10692249816131044], [0.19164652120541675, -0.1849099614966411, -0.20870715399631842, 0.035154742097780564]]], [[[0.019805320102652329, -0.0081672030804646138, 0.33577500988696074, -0.19846020818757565], [0.10251723737041529, 0.319926408664718, 0.17564417573766886, -0.29371357419357247], [0.27181303457665001, 0.3307608427813617, 0.18559143457037655, 0.023980775654651731]], [[-0.30174748613346808, -0.10922353091220637, 0.36059953277746432, -0.13905128521692789], [0.012244274449194518, -0.0061319202212661095, -0.31980008933311305, -0.021834611050640274], [0.012672717810557418, 0.28704143678012184, 0.073640393161720982, -0.084645635045895853]]], [[[-0.053963680866999944, 0.29160231822116156, 0.27772788235184387, 0.26520763350019361], [0.33514432069762456, 0.23804698318426079, 0.36270467372786813, 0.28592786070021464], [0.10911089526441087, 0.20039364189609415, 0.18507070434725822, -0.22604671500015461]], [[-0.17226411514949336, -0.010360578170344779, -0.24127739704128434, 0.069585856479527697], [-0.0649007641602872, -0.39068947921091185, -0.22850827725255021, 0.16035311749950365], [-0.13866449209790715, -0.39261603880349089, -0.099453742574001233, 0.29192848689281303]]]])
62083          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62084          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
62085          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62086       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62087       def test_generalTensorProduct_array_rank0_constData_rank0_offset0(self):
62088          arg0=numarray.array(0.276030930635)
62089          arg1=Data(0.525251086603,self.functionspace)
62090          res=generalTensorProduct(arg0,arg1,offset=0)
62091          ref=Data(0.14498554625225879,self.functionspace)
62092          self.failUnless(isinstance(res,Data),"wrong type of result.")
62093          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62094          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62095       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62096       def test_generalTensorProduct_array_rank1_constData_rank1_offset1(self):
62097          arg0=numarray.array([0.65548645255509275, 0.37351981102482612, 0.66146316938990646])
62098          arg1=Data(numarray.array([0.35738251475002025, 0.75375267320042005, -0.61347308966363956]),self.functionspace)
62099          res=generalTensorProduct(arg0,arg1,offset=1)
62100          ref=Data(0.11001109862765807,self.functionspace)
62101          self.failUnless(isinstance(res,Data),"wrong type of result.")
62102          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62103          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62104       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62105       def test_generalTensorProduct_array_rank2_constData_rank2_offset2(self):
62106          arg0=numarray.array([[-0.088883398927412705, 0.36597586224843726, 0.74959282604165689], [-0.718337701269115, 0.33607066789476403, 0.59912096183685004]])
62107          arg1=Data(numarray.array([[0.87315550347073834, -0.79911382372503281, 0.79698915770889056], [0.15146867556573818, -0.66249741709046073, 0.63805916366214133]]),self.functionspace)
62108          res=generalTensorProduct(arg0,arg1,offset=2)
62109          ref=Data(0.27817496562025817,self.functionspace)
62110          self.failUnless(isinstance(res,Data),"wrong type of result.")
62111          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62112          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62113       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62114       def test_generalTensorProduct_array_rank3_constData_rank3_offset3(self):
62115          arg0=numarray.array([[[0.20153302766859094, -0.35116008004588184, 0.61696012433723024], [-0.05050693882863988, 0.17570848078988477, 0.013076273091135571], [0.54811545087018798, -0.42637441096587958, -0.91509586562792244], [-0.41703211918250305, -0.87458651401154675, -0.62989316067326073]], [[-0.71145712499219438, 0.51640319295618808, -0.12182181241786361], [0.49157866232808334, -0.58888312538001397, -0.98499655751430581], [-0.26482063804407496, -0.1466661401594116, 0.92787635744693953], [0.95426503021711473, 0.067265994082578828, 0.93571655790151809]]])
62116          arg1=Data(numarray.array([[[0.083191577418960216, -0.13267380908779791, -0.31670651125183591], [0.9166435728700093, 0.24487144548334538, -0.74832471275995438], [0.45797771718162483, -0.31279505052245482, 0.56265825341334263], [0.049587341838397192, 0.54572386172700593, -0.591555012574563]], [[0.44597368905115276, 0.49570325682287963, 0.52033626676325362], [0.68429154349511578, 0.52206119042946031, 0.28696799887961721], [-0.63491171842396965, 0.004967136652360038, -0.27973878578647238], [0.42734667668017412, 0.24291755554837136, -0.029733817555185338]]]),self.functionspace)
62117          res=generalTensorProduct(arg0,arg1,offset=3)
62118          ref=Data(-0.47517867398842628,self.functionspace)
62119          self.failUnless(isinstance(res,Data),"wrong type of result.")
62120          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62121          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62122       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62123       def test_generalTensorProduct_array_rank4_constData_rank4_offset4(self):
62124          arg0=numarray.array([[[[0.19606611084966263, -0.57209293064277844], [-0.91377015519165106, -0.47965416825477725], [0.51485687228874144, 0.67502333423066507]], [[-0.76214296278296612, 0.42849950905965351], [-0.49718152947669325, 0.54073334578167409], [0.17217128360555489, -0.66245225909123451]]], [[[-0.28535614441819601, 0.85992886810876312], [-0.3213074749318201, -0.42641881450285668], [-0.92216566064416483, -0.34139385499820341]], [[-0.52182995244734465, -0.90889392707604855], [-0.14249809236581235, 0.69591411936717362], [-0.16624564353948501, 0.35208457246133285]]], [[[0.1216281235985992, -0.81813485876810765], [-0.52879636746006531, -0.58187557546012547], [0.17248644658489098, -0.73232107870650198]], [[-0.1812890888821197, -0.76142628835072901], [0.479650948229281, -0.39383250923388169], [-0.33843160474005596, 0.0072349045599295891]]], [[[0.52484917029162292, 0.78567887353182542], [0.73580273137643371, -0.031129059645950585], [0.093085161075552314, 0.95974042816664906]], [[-0.0042247192709699011, -0.50307277029470732], [0.444377708951877, -0.64356695364233896], [-0.13286936695674534, -0.05066623610144938]]]])
62125          arg1=Data(numarray.array([[[[-0.84558794158576056, 0.61527033930440034], [0.3300136532175415, 0.5046018054928294], [0.42254055880201125, -0.71873864169112323]], [[-0.41746039598975671, -0.58155491346085508], [-0.4813844311354738, 0.18592613876929676], [0.53196416475296071, -0.26252843037889284]]], [[[-0.92314660674941784, -0.79235729537482924], [-0.86399177081949974, 0.25356797810273535], [-0.18129818928386343, 0.15861633373894635]], [[-0.44908184547489838, -0.08178109500798203], [-0.10699307061693131, 0.78887274022102449], [-0.23064213944708545, 0.87519484904768596]]], [[[-0.12010238048508115, -0.61521787096104763], [-0.16162015905453231, -0.41322167296921308], [0.96103403207348626, -0.81427566071653334]], [[-0.099513083940893976, 0.16603620159907706], [-0.40862285561102119, 0.34826516787038209], [-0.42677499726753076, -0.58137530337764143]]], [[[0.70399993629948465, 0.34036547607039669], [-0.50794955273895703, 0.41846445655739406], [0.128196254038766, -0.38060413423278394]], [[-0.44402887336181052, -0.025572509319359948], [0.16890980895514462, 0.72622285390064367], [0.72494568508485191, 0.70969468805643099]]]]),self.functionspace)
62126          res=generalTensorProduct(arg0,arg1,offset=4)
62127          ref=Data(1.0916478580238695,self.functionspace)
62128          self.failUnless(isinstance(res,Data),"wrong type of result.")
62129          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62130          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62131       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62132       def test_generalTensorProduct_array_rank0_constData_rank1_offset0(self):
62133          arg0=numarray.array(-0.259974017677)
62134          arg1=Data(numarray.array([-0.044411300170266399, -0.8714302585888849]),self.functionspace)
62135          res=generalTensorProduct(arg0,arg1,offset=0)
62136          ref=Data(numarray.array([0.011545784135536585, 0.22654922545091835]),self.functionspace)
62137          self.failUnless(isinstance(res,Data),"wrong type of result.")
62138          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62139          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62140       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62141       def test_generalTensorProduct_array_rank1_constData_rank2_offset1(self):
62142          arg0=numarray.array([0.25002746419177746, 0.56003262174718937, -0.38411653061655926])
62143          arg1=Data(numarray.array([[-0.25220197912710396, -0.51956798157298234], [-0.92297279746096805, -0.36259445263568946], [-0.45338691929511876, -0.038077564179096912]]),self.functionspace)
62144          res=generalTensorProduct(arg0,arg1,offset=1)
62145          ref=Data(numarray.array([-0.40579888640212991, -0.31834476500168113]),self.functionspace)
62146          self.failUnless(isinstance(res,Data),"wrong type of result.")
62147          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62148          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62149       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62150       def test_generalTensorProduct_array_rank2_constData_rank3_offset2(self):
62151          arg0=numarray.array([[0.80780440839221423, -0.29207184993427804, 0.47539604196932705], [-0.32342927832232093, 0.36904363909067373, 0.17617657281137911]])
62152          arg1=Data(numarray.array([[[0.74769328224227594, -0.32948341167934925], [0.75317506354554919, 0.78253366336224439], [-0.74366133755081543, 0.35163398761741416]], [[-0.57198519061406028, 0.37619672855306896], [0.82869637346523017, 0.53243348061751039], [-0.83147507703100421, -0.14754680843174905]]]),self.functionspace)
62153          res=generalTensorProduct(arg0,arg1,offset=2)
62154          ref=Data(numarray.array([0.37481049227597868, -0.27872493940663351]),self.functionspace)
62155          self.failUnless(isinstance(res,Data),"wrong type of result.")
62156          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62157          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62158       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62159       def test_generalTensorProduct_array_rank3_constData_rank4_offset3(self):
62160          arg0=numarray.array([[[-0.24110012719903873, -0.18767619263315161, -0.0023263200028647013], [-0.16745303525596622, -0.081208880408232043, 0.76180141657215583], [0.22392874424529996, -0.90664253147371476, 0.95586755866967299], [-0.77004766332563279, -0.72194418968870044, -0.41632757437658507]], [[0.38522645465910199, -0.13216896105274212, -0.55066562058746626], [0.74643262667383459, -0.73519018574612116, -0.1666972069940782], [-0.12167653683237334, 0.63633427501506423, 0.36224201095372277], [0.94315180298726076, -0.52860157184070178, 0.63695906002259473]]])
62161          arg1=Data(numarray.array([[[[-0.10386758710448762, 0.49459681435541136], [-0.57247650577650155, -0.91506181599997216], [0.24131754746756551, 0.32019397726294696]], [[0.14650617363916774, 0.75743908141412408], [-0.52744783814012308, 0.50178758777395371], [-0.7781074949616511, 0.63112146572169614]], [[-0.46518782328154473, -0.20056089250458453], [-0.76360408062036988, -0.64617573279573759], [-0.49403710427308201, 0.69635162430467124]], [[0.68717921862273146, -0.57062955669372273], [-0.44852558485973271, -0.44895330232946962], [-0.16040098753067511, 0.236634091121674]]], [[[-0.91168574887596909, 0.47032605755320178], [-0.88021956487570652, -0.1344789731642575], [0.41736033090124636, -0.29049394722160526]], [[-0.19043893518805333, 0.45666179206782131], [-0.52033102345351812, 0.40490536270689215], [0.36478983733555137, 0.021961012917905309]], [[-0.87459991171516593, 0.22055198755113836], [-0.95421798597476437, 0.64566339556818741], [-0.25283035488290162, 0.45839489280139634]], [[0.75599636361661271, -0.66524871378964723], [-0.58073190678603837, -0.25496267982118814], [-0.41126607738373178, -0.069735987982464609]]]]),self.functionspace)
62162          res=generalTensorProduct(arg0,arg1,offset=3)
62163          ref=Data(numarray.array([-0.58464390506716768, 2.647960905222289]),self.functionspace)
62164          self.failUnless(isinstance(res,Data),"wrong type of result.")
62165          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62166          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62167       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62168       def test_generalTensorProduct_array_rank0_constData_rank2_offset0(self):
62169          arg0=numarray.array(-0.544185299417)
62170          arg1=Data(numarray.array([[-0.98078244900179024, 0.8612932216239495, -0.40578309224856213, 0.47011167948573584, 0.71368417960651587], [0.36095971146134653, -0.082453576134518425, -0.21455791741457064, 0.31298648068387958, 0.98312794572841744], [-0.088915225329776471, -0.97810755656232362, 0.96698295910836785, -0.31739213445418368, -0.90954767450916862], [0.27052720601589275, -0.50384275667463885, 0.72541118412285566, 0.078921147029740846, -0.46753049705881922]]),self.functionspace)
62171          res=generalTensorProduct(arg0,arg1,offset=0)
62172          ref=Data(numarray.array([[0.53372739067249519, -0.46870310969483769, 0.22082119355344024, -0.2558278650601426, -0.38837643896799667], [-0.19642896865888917, 0.044870024016724741, 0.11675926453043051, -0.17032264170427608, -0.53500377551095524], [0.048386358518770684, 0.53227175352941702, -0.52621791113304806, 0.17272013372039449, 0.49496247358636042], [-0.14721692860606994, 0.27418382139982711, -0.39475810243197978, -0.042947728026673772, 0.25442322352830232]]),self.functionspace)
62173          self.failUnless(isinstance(res,Data),"wrong type of result.")
62174          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62175          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62176       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62177       def test_generalTensorProduct_array_rank1_constData_rank3_offset1(self):
62178          arg0=numarray.array([0.80321090298129461, 0.75733336332953161, -0.43955933605807429])
62179          arg1=Data(numarray.array([[[0.78879034368954803, -0.96360675680855756, -0.84472039581731684, 0.09269639329379209, -0.88687967608738894], [0.79891982880015688, 0.82615559491626334, 0.43870962789013146, -0.25776922865703966, 0.67159680941934141], [0.15766345982285435, 0.94565467500035094, -0.8168137099869337, -0.65770921213262823, -0.45484089804148842], [0.30783009097762659, -0.74026449285791296, 0.50469441556734496, -0.62387506102580259, 0.55606803499423529]], [[-0.69476518669236187, 0.096269932704859063, 0.840466296413374, 0.28100748815042675, 0.89485512724460081], [-0.49494734703497656, 0.32846002879809877, -0.47440701189166701, 0.72065242250436712, -0.16056243259888681], [-0.15293388856941381, -0.18054680962975578, -0.53864585972941614, -0.49240229154519533, -0.66400626488214631], [-0.94437636064801156, -0.69962040250207069, 0.059472100896275526, -0.7258679313156231, 0.67604426321411459]], [[0.064574213796787738, -0.5203881815066389, -0.49359998905171554, -0.25143418573699838, 0.78064423023386498], [0.14841764339904073, -0.83705000950241049, -0.306281157712468, 0.73238623711186346, -0.19822909711796322], [0.6673079453890467, -0.24900668833512962, 0.54201352219333332, 0.96799468027414459, -0.87287769856111841], [-0.47388722998885946, -0.94423009160263582, -0.22079035169225558, -0.7919366924753577, -0.56314753453910193]]]),self.functionspace)
62180          res=generalTensorProduct(arg0,arg1,offset=1)
62181          ref=Data(numarray.array([[0.079011950112823109, -0.47232953777667286, 0.17499101860255675, 0.39779134362721968, -0.37778724179624451], [0.20162261730742118, 1.2802640661490039, 0.12772084079238172, 0.016803859893432249, 0.50496804294514286], [-0.28250636368735516, 0.7322792374388043, -1.3022552621083121, -1.3266829927123065, -0.48452572464437749], [-0.25965368393920485, -0.70938923208333882, 0.54746672385139006, -0.7027240861258599, 1.2061675405110834]]),self.functionspace)
62182          self.failUnless(isinstance(res,Data),"wrong type of result.")
62183          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62184          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62185       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62186       def test_generalTensorProduct_array_rank2_constData_rank4_offset2(self):
62187          arg0=numarray.array([[-0.11565043696176636, -0.25516973814347077, -0.54480447818461442], [0.68830407667880444, -0.30647666874713475, -0.013222647666291332]])
62188          arg1=Data(numarray.array([[[[-0.33446284196041032, -0.92363008646930722, 0.88230430807039961, 0.051649702155052601, -0.23592181457866568], [0.5104971278349808, 0.43729394737044691, 0.74147148905349103, 0.679887233437517, -0.37964722697630826], [-0.64163119845483507, 0.95243799257993, -0.16694744160255892, 0.39604762563365425, -0.88007651506299212], [-0.0037020293161897921, -0.1880764388967513, -0.94277606167241479, -0.21767848564536085, 0.86977286446058022]], [[-0.73501155027385368, -0.3663203593692046, 0.82214899285811827, 0.27689196615328382, 0.54518051623971897], [0.019286576294491153, -0.25146027753347844, 0.83568832160044115, 0.3106642413049252, 0.47505190873515324], [-0.39292161117350854, -0.43719499734442269, 0.99190052560446107, 0.85336334151266713, 0.63343006213304576], [0.50340344988815167, -0.84122407791744069, 0.86751806824640409, 0.90579274672227883, -0.9621102266168795]], [[0.62326775177626104, 0.12008759026684923, 0.069631861735134581, 0.97900205683156449, -0.89083965983886837], [-0.69668647900055825, -0.74950149073381267, 0.2675896848146746, -0.51872180189847761, -0.94953751629793781], [0.28091433991839621, -0.27113159959604527, -0.011931951002468466, 0.53630770624257829, 0.35087185995834824], [-0.44314547583921393, 0.94373890147914818, -0.73493654942927988, 0.31550405206769172, 0.26665247900793876]]], [[[0.59710385642002928, -0.12803887338848163, -0.26402126307209817, -0.29285538855288817, -0.9064713920873344], [-0.52544425912004522, 0.94038667193528358, -0.26726556609141006, 0.95974674726009668, 0.55320788782618457], [0.12637911941808322, 0.30456684761940678, 0.35529275308681108, 0.65517009603341125, -0.40606428176396325], [0.62521639928593564, -0.18755646596338837, 0.11061943165104826, 0.28533153784040355, 0.57006195458453957]], [[0.26493418753075915, 0.87833071304902588, -0.28298919539362388, -0.50222990586325378, -0.040632910187410776], [0.85031249695503019, -0.54277990316861335, -0.39245923661963866, 0.93823378468563878, 0.45872698390685795], [0.40659927131778484, -0.67382992392399799, 0.72293711733828392, -0.00022653513814963055, -0.96594616937093059], [-0.78774281559253456, -0.28763697021436418, 0.62067361646158936, 0.70164775941175339, 0.48050239096492908]], [[0.60489714316840892, -0.67682837903376747, 0.36440483682611147, 0.42290277667298759, 0.38434238375069252], [-0.53933850671613781, -0.59922409185675152, -0.074875557481751454, -0.77479980947992466, -0.29673585949412118], [-0.30083987286477942, -0.93721644162017936, 0.39522845320463862, -0.37890757332334468, 0.95180902376140253], [-0.93407456650595577, 0.59397835129938792, -0.63282679890401039, -0.43212635295645985, -0.30920570180851015]]]]),self.functionspace)
62189          res=generalTensorProduct(arg0,arg1,offset=2)
62190          ref=Data(numarray.array([[0.20846894590466161, -0.21350025001741069, -0.44957789465373454, -0.66323616957152021, -0.24305261213454371], [-0.29953753690788193, 1.2434682712086529, -0.5074682566220704, 0.50799633064472838, 0.68410954788752487], [-0.012224784713239064, 0.57766300862504949, -0.20953474812807624, -0.099702584310622941, -0.24704868185486306], [0.79751718381823189, -0.32654295589095927, 0.1823502976995823, -0.39077425918854786, 0.24884005131956072]]),self.functionspace)
62191          self.failUnless(isinstance(res,Data),"wrong type of result.")
62192          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62193          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62194       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62195       def test_generalTensorProduct_array_rank0_constData_rank3_offset0(self):
62196          arg0=numarray.array(0.729161045519)
62197          arg1=Data(numarray.array([[[0.78719542466743553, 0.85234295949470962], [0.032104578750040469, -0.096502278551340526]], [[0.50764567626009982, -0.96185965444300359], [-0.70501450359437245, -0.10132955328153126]], [[-0.098014097359040653, -0.62284231841207283], [0.1461389597728926, 0.26782573714588076]], [[0.14730407961037217, -0.98677718952359195], [0.87529773002735833, -0.95658399969991681]], [[0.016469832836842668, 0.18102407337026372], [-0.96921997530625692, 0.36289790352438445]], [[0.84420760731995115, -0.82125974198117713], [0.65036851244544325, 0.36285009148825909]]]),self.functionspace)
62198          res=generalTensorProduct(arg0,arg1,offset=0)
62199          ref=Data(numarray.array([[[0.57399223887856909, 0.62149528348623362], [0.023409408207338351, -0.070365702323496607]], [[0.37015545205520034, -0.70135059127655719], [-0.5140691125471899, -0.073885563012771702]], [[-0.071468061705955072, -0.45415235608705329], [0.10655883669911503, 0.1952880945142855]], [[0.10740839669796699, -0.71951948720768455], [0.63823300796747695, -0.69750378934828883]], [[0.012009160530841397, 0.13199570260283602], [-0.70671745053256507, 0.26461101475062643]], [[0.61556330158881856, -0.59883061210596045], [0.47422338450759466, 0.26457615207637686]]]),self.functionspace)
62200          self.failUnless(isinstance(res,Data),"wrong type of result.")
62201          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
62202          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62203       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62204       def test_generalTensorProduct_array_rank1_constData_rank4_offset1(self):
62205          arg0=numarray.array([0.094563644000015712, -0.40340577007888978, 0.37726109420617804])
62206          arg1=Data(numarray.array([[[[0.52449117797578659, -0.03086789820496838], [0.72570865973216425, -0.13543779489257046]], [[-0.89695118409168506, 0.79734696922266357], [0.22829213541540572, 0.90054010866700551]], [[-0.71596739611373761, -0.53162155555951718], [0.49237680321488253, -0.06317598151523085]], [[0.071880420235407305, 0.71774717019061041], [0.75001622324878681, 0.97946643306530001]], [[0.28594511097352382, 0.73873074829495167], [0.8977634773163321, 0.68508955799222271]], [[0.27209850366205202, 0.33717685000667652], [0.0082416426035361035, 0.3967960145540661]]], [[[-0.16146967042462879, 0.68172064478711825], [0.15474410825306673, -0.098125172279253325]], [[-0.37227015838659416, -0.79802890461166176], [-0.88581970642908892, -0.25082943693023929]], [[-0.89724165678961332, 0.2649908483519805], [-0.34656675884808252, -0.61942744507352399]], [[0.54869740807191691, -0.29205289135149659], [0.50705660033365318, -0.16284580162474138]], [[0.12910234770898432, -0.034040965132912548], [-0.87819921235137355, -0.98840803021110291]], [[0.21126303819558889, -0.93376861633183461], [0.18709519470671587, -0.46152886596377307]]], [[[0.13783755981776658, 0.068615740197387698], [0.26784700445533405, 0.68335128305684067]], [[0.96758007764405951, 0.75300911337638987], [-0.7056423401530143, -0.8805732619896891]], [[0.2247290198120071, 0.79305270266743566], [0.44992426858646883, 0.81832617635379923]], [[0.90106460974855263, -0.69437719254417174], [0.030768346999636709, 0.50095539564394653]], [[0.26969627168110932, -0.34462639139242168], [-0.96896154396936418, -0.96178212370333616]], [[0.40550249449244569, 0.96839729629400972], [-0.79417057858038054, 0.73121170834781246]]]]),self.functionspace)
62207          res=generalTensorProduct(arg0,arg1,offset=1)
62208          ref=Data(numarray.array([[[0.16673634241684321, -0.25204297339927473], [0.10724924317230783, 0.28457862204028717]], [[0.43038727628759221, 0.68141054181174454], [0.11272151568017424, -0.14586163593991391]], [[0.37902949145651482, 0.14201702160552981], [0.3561068968467791, 0.55262908317131842]], [[0.12538619465037187, -0.076272890027687806], [-0.1220175909456483, 0.3473058318040193]], [[0.07670529023885185, -0.046424736261731325], [0.073614923084848072, 0.10067109127331092]], [[0.093486212196292551, 0.77391094298210361], [-0.37430558280317422, 0.4995636138363328]]]),self.functionspace)
62209          self.failUnless(isinstance(res,Data),"wrong type of result.")
62210          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
62211          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62212       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62213       def test_generalTensorProduct_array_rank0_constData_rank4_offset0(self):
62214          arg0=numarray.array(0.170303473899)
62215          arg1=Data(numarray.array([[[[0.16299614924257644, -0.30845749390788568, -0.29566630182680487, -0.80474190718593475], [0.2691016779449793, 0.43343326414717098, 0.86610946466404282, 0.81037943192221773], [-0.48333691021318304, -0.93480833528417273, 0.64644802086374153, 0.42800956590349348]], [[0.27107237158946917, -0.71924977764247067, 0.72958046337734372, -0.72403719104310249], [0.51262790161186866, -0.22953137082167485, 0.051206987484119448, 0.76489736035255773], [-0.32139134156416738, -0.88271154058596157, -0.96827294084859949, 0.46828011189819208]]], [[[0.87325381066079522, 0.63526408153623026, 0.29502896569193537, -0.41121828371592239], [0.87735333166929808, 0.44805437770807965, 0.42715426653695743, -0.45014923033183574], [0.11122058746477959, 0.088540294825875998, 0.39149149869779998, -0.046853466676531896]], [[-0.40441908731245513, -0.3433187459279825, 0.30970231829985795, -0.80645845620245682], [0.38256980770787696, 0.34446182387752167, 0.37387781617472959, -0.97420202442236437], [-0.59495769997476544, 0.73108455992733701, -0.20589021086236658, -0.46280286594007647]]], [[[0.87429316932515166, -0.018918611841412858, -0.55004861432449981, -0.27876119151367029], [0.50604470531747281, 0.72284043538395015, 0.80737913912957571, 0.13914446576183637], [0.44080224562244452, 0.77483530802879219, -0.1424378513885598, 0.66516119595599488]], [[0.063231228478993318, 0.097353731085751738, -0.91350557376842412, 0.86784298996285969], [0.78632995224149438, 0.84541641731413542, -0.79676254907989241, 0.66234153400905438], [0.65361805846747334, 0.62813428609632793, 0.093673501161051886, 0.88227414180589481]]]]),self.functionspace)
62216          res=generalTensorProduct(arg0,arg1,offset=0)
62217          ref=Data(numarray.array([[[[0.027758810448241404, -0.052531382762826505, -0.050352998316103507, -0.13705034238622077], [0.045828950586196737, 0.073815190587834312, 0.14750145060946576, 0.13801043243300376], [-0.082313954873123998, -0.15920110692904169, 0.11009234364850912, 0.072891515935553777]], [[0.046164566559844904, -0.12249073573390838, 0.12425008740232059, -0.12330604886702869], [0.087302312462278611, -0.039089989819830466, 0.0087207278564703922, 0.13026467764454797], [-0.054734061949577334, -0.15032884181291067, -0.16490024550933788, 0.0797497298142779]]], [[[0.14871815755145223, 0.10818767992915346, 0.050244457758293594, -0.07003190224778473], [0.14941632022052398, 0.076305217019535188, 0.072745855482208702, -0.076661977698668199], [0.018941252414387832, 0.015078719788926784, 0.06667236223033117, -0.0079793081392447607]], [[-0.068873975480549715, -0.058468375086332659, 0.05274338068117413, -0.13734267664685312], [0.065152967261689995, 0.058663045232077021, 0.063672690908490537, -0.16590998903899012], [-0.10132336312891989, 0.12450624026986459, -0.035063818151748055, -0.078816935800209167]]], [[[0.14889516394261959, -0.0032219053179475821, -0.093675189833032413, -0.047473999303123536], [0.086181171263981116, 0.12310223722086623, 0.13749947214770136, 0.02369678589312162], [0.075070153732173975, 0.13195714465724148, -0.024257660906243084, 0.11327926237440823]], [[0.010768497868901401, 0.016579678600974861, -0.15557317263925852, 0.14779667598994684], [0.13391472249790271, 0.14397735276021106, -0.13569142998127415, 0.11279906414962222], [0.11131342596041423, 0.10697345099754574, 0.015952922660049822, 0.15025435128118594]]]]),self.functionspace)
62218          self.failUnless(isinstance(res,Data),"wrong type of result.")
62219          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
62220          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62221       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62222       def test_generalTensorProduct_array_rank0_expandedData_rank0_offset0(self):
62223          arg0=numarray.array(-0.501038685672)
62224          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62225          arg1=msk_arg1*(-0.37497860758)+(1.-msk_arg1)*(0.886271009021)
62226          res=generalTensorProduct(arg0,arg1,offset=0)
62227          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62228          ref=msk_ref*numarray.array(0.18787878869669156)+(1.-msk_ref)*numarray.array(-0.44405606150884158)
62229          self.failUnless(isinstance(res,Data),"wrong type of result.")
62230          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62231          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62232       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62233       def test_generalTensorProduct_array_rank1_expandedData_rank1_offset1(self):
62234          arg0=numarray.array([0.44038262808839268, -0.80364141181592696, -0.35078298317395173])
62235          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62236          arg1=msk_arg1*numarray.array([0.71915786866679077, -0.24226928051609842, -0.52239122903446766])+(1.-msk_arg1)*numarray.array([0.80851332796867226, 0.23987618213601136, 0.93431506683977128])
62237          res=generalTensorProduct(arg0,arg1,offset=1)
62238          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62239          ref=msk_ref*numarray.array(0.69464821255213227)+(1.-msk_ref)*numarray.array(-0.16446103582788724)
62240          self.failUnless(isinstance(res,Data),"wrong type of result.")
62241          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62242          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62243       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62244       def test_generalTensorProduct_array_rank2_expandedData_rank2_offset2(self):
62245          arg0=numarray.array([[-0.70824728644205526, -0.12630675377204637, 0.4347607103368023], [-0.89056712613274125, 0.010820129422368874, -0.90039689321841987]])
62246          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62247          arg1=msk_arg1*numarray.array([[0.93739717147838908, -0.77123682199279786, -0.86427598943106121], [-0.91576441578160006, 0.13385047078992351, 0.76249883166202981]])+(1.-msk_arg1)*numarray.array([[-0.39496786944253803, 0.66327871398525273, 0.18532728600071824], [0.6362315985772391, -0.77080221962759832, 0.94099837319284996]])
62248          res=generalTensorProduct(arg0,arg1,offset=2)
62249          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62250          ref=msk_ref*numarray.array(-0.8118034424514643)+(1.-msk_ref)*numarray.array(-1.1456877747602543)
62251          self.failUnless(isinstance(res,Data),"wrong type of result.")
62252          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62253          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62254       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62255       def test_generalTensorProduct_array_rank3_expandedData_rank3_offset3(self):
62256          arg0=numarray.array([[[0.63350363851439639, 0.012863304921566288, -0.46484188959811634], [-0.44497572695987198, 0.7313619267681537, -0.7824611232916332], [-0.93700843427874925, -0.44281317878576698, -0.053511743398166445], [-0.21279837170704141, -0.71697082293404168, 0.91122771589265805]], [[-0.15825541058242831, 0.44839519324233112, 0.93358871086947182], [-0.37114035164923109, 0.78805681132652072, -0.8138475994924752], [0.52088536280998121, -0.77960719617666063, 0.54954337829857813], [-0.46568975258154666, -0.54470171069547657, 0.58430452780377817]]])
62257          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62258          arg1=msk_arg1*numarray.array([[[-0.40379817428308384, 0.60389726258914656, 0.43953608931572186], [0.4838417639649768, 0.97973014911472811, 0.38509984207315728], [-0.33557566738890166, 0.74565707877513576, -0.42293605603757567], [0.93428852170931109, 0.20392914562930908, -0.19015381696316624]], [[-0.28771663480511722, -0.11363849155085948, 0.15885662403426482], [-0.61281402347548886, -0.19979936417795652, 0.18520201905341604], [-0.26478689551969237, -0.26876353904713635, -0.42756925441662252], [-0.10336812618250768, -0.62661268118795377, -0.50758733772388442]]])+(1.-msk_arg1)*numarray.array([[[-0.67885234584521226, -0.2383304710343972, -0.95102911225053433], [-0.77162854554669535, -0.18252965123420073, -0.057560358501999254], [-0.28069888586616965, -0.60672292004101647, -0.37769655089940013], [-0.59269449422648113, -0.27619032325379833, 0.013919747588113873]], [[-0.038406445356485186, -0.62545888435942398, -0.34531503961876164], [0.83724853491667051, 0.61060148536269532, 0.33308338973850815], [0.42834232810198802, -0.24493617999638184, 0.75888014236571077], [-0.84795287270528363, 0.62773712077388999, 0.27063716628400281]]])
62259          res=generalTensorProduct(arg0,arg1,offset=3)
62260          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62261          ref=msk_ref*numarray.array(-0.77220523654832762)+(1.-msk_ref)*numarray.array(1.497391405841505)
62262          self.failUnless(isinstance(res,Data),"wrong type of result.")
62263          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62264          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62265       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62266       def test_generalTensorProduct_array_rank4_expandedData_rank4_offset4(self):
62267          arg0=numarray.array([[[[0.66692221453488321, 0.70236643546384081], [0.78031380564159125, 0.51817208183024732], [-0.73155397777526199, 0.41333534504253611]], [[-0.050532058185003947, 0.61603390263605085], [0.1468977566735139, 0.92574095795931521], [-0.2111592868010268, 0.96299120541748384]]], [[[-0.37394494763727648, -0.014102034485046877], [-0.10581395189470788, 0.80096492843200551], [0.89288408725661816, -0.34044229611468313]], [[0.47426149830902542, 0.39436501306897065], [-0.14167997130606569, -0.62207238623596672], [-0.37185543809384591, -0.060608338166359799]]], [[[0.26383584038706931, 0.050438879214178556], [0.75974254183593204, 0.64834976706573566], [-0.87058844559025128, -0.51116367530358953]], [[-0.23990103772999727, -0.15064442054769689], [0.21915152648611569, 0.91076111295643902], [-0.86736114625524463, 0.15192583520059211]]], [[[-0.19437893616374713, -0.34856783741186081], [0.64470469827147725, -0.28657566195229722], [0.040736307101837843, -0.81189918724736865]], [[-0.43138598569616682, 0.6569786694570392], [-0.88548264551389533, 0.22424181301194968], [0.49028931081399829, 0.12533075955312345]]]])
62268          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62269          arg1=msk_arg1*numarray.array([[[[-0.46340779133960219, 0.36431041531567199], [0.26951798090514512, -0.39609372305210022], [0.28526948474899316, -0.75551992572189408]], [[-0.54305547329011117, 0.26118735978137364], [0.94607798188040948, -0.50746815991997085], [0.668461028276504, 0.17534199507844028]]], [[[0.69954540197006621, -0.58989378545627336], [-0.77491029045897619, -0.76545382519911498], [-0.25250868270646687, -0.46481158423696556]], [[-0.76607140109887029, 0.55118334352692822], [-0.626460377392007, -0.9811309325713633], [0.3686601252945938, 0.074166702980152044]]], [[[0.60599601425914873, -0.55895950980763032], [-0.73036937902853416, 0.44910078910514262], [0.72914971761458025, 0.29351120043732104]], [[0.26115112507488458, -0.1804659513394633], [-0.46578546574459878, -0.54589922469878194], [-0.2109275840716307, 0.20216313022050536]]], [[[-0.93791559744495201, -0.27942365974895433], [0.98190776398441426, -0.10901959474963396], [0.24203914236980006, 0.083994807064014632]], [[-0.18910747704590225, 0.77000442816012948], [-0.58626375608555215, 0.82046002639811633], [0.38046723009345196, -0.29851908605949395]]]])+(1.-msk_arg1)*numarray.array([[[[-0.063843541440743001, 0.82579210086531196], [-0.75392928943450777, 0.96515854653631816], [0.04513414472199373, -0.58391601323413722]], [[0.51050537414761421, -0.39055883895901622], [-0.035983227726216871, -0.67985051461074297], [-0.46202605176115275, -0.32058592584661327]]], [[[-0.94295560179225624, -0.95635626340976576], [-0.56137374534821216, -0.95428648114901637], [0.90744174531924093, 0.12944161238629848]], [[-0.89864854245762937, -0.57163922613177331], [-0.59408436108929119, -0.69495540700078506], [-0.43417863882441132, -0.47493704913215007]]], [[[-0.52757591056894726, 0.46829257906798505], [0.77931221581068466, 0.83301505980319068], [-0.96930280734831697, 0.10868224224462741]], [[-0.62766844886146278, -0.40104067060462034], [-0.51320226272568847, -0.37356414336340404], [0.97201855282411853, 0.94271809432690068]]], [[[-0.032280060413461653, -0.36020188198684688], [-0.41169336168295434, 0.61931290291263963], [-0.57962639671584393, 0.78323224929846846]], [[-0.66356437187182316, 0.1114302921832302], [0.22662244560360123, -0.36488034809040859], [0.12382732557364684, 0.81246926773550343]]]])
62270          res=generalTensorProduct(arg0,arg1,offset=4)
62271          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62272          ref=msk_ref*numarray.array(-0.13645802998092274)+(1.-msk_ref)*numarray.array(-0.3226720375795763)
62273          self.failUnless(isinstance(res,Data),"wrong type of result.")
62274          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62275          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62276       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62277       def test_generalTensorProduct_array_rank0_expandedData_rank1_offset0(self):
62278          arg0=numarray.array(-0.874708255678)
62279          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62280          arg1=msk_arg1*numarray.array([0.14654086700981339, 0.29310796739100886])+(1.-msk_arg1)*numarray.array([-0.9215158534245409, -0.30896457872014915])
62281          res=generalTensorProduct(arg0,arg1,offset=0)
62282          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62283          ref=msk_ref*numarray.array([-0.1281805061677056, -0.25638395888193338])+(1.-msk_ref)*numarray.array([0.80605752472866621, 0.27025386771861076])
62284          self.failUnless(isinstance(res,Data),"wrong type of result.")
62285          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62286          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62287       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62288       def test_generalTensorProduct_array_rank1_expandedData_rank2_offset1(self):
62289          arg0=numarray.array([0.2892485283016033, -0.20014935288134739, 0.087006388727603357])
62290          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62291          arg1=msk_arg1*numarray.array([[0.98893987430714647, -0.88028128897717206], [0.88844404657015219, -0.28295984513968886], [0.45513009395447646, -0.70192724421712316]])+(1.-msk_arg1)*numarray.array([[0.084565234308185522, 0.82592053483818861], [-0.1001636044559262, 0.73723539179415098], [-0.40814274945400886, 0.97632878400553325]])
62292          res=generalTensorProduct(arg0,arg1,offset=1)
62293          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62294          ref=msk_ref*numarray.array([0.1478271281060469, -0.25905799210082081])+(1.-msk_ref)*numarray.array([0.0089970234678914754, 0.17628595431432692])
62295          self.failUnless(isinstance(res,Data),"wrong type of result.")
62296          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62297          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62298       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62299       def test_generalTensorProduct_array_rank2_expandedData_rank3_offset2(self):
62300          arg0=numarray.array([[-0.3779633899829653, -0.88393082872430706, -0.31590593488209229], [-0.027735783300006034, 0.18453001551873927, -0.38062223999076217]])
62301          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62302          arg1=msk_arg1*numarray.array([[[0.65241925838380443, -0.93810039747206297], [0.20699238934346043, -0.28729202466167036], [-0.73017695169441343, 0.40255584953621404]], [[0.59613475429153584, 0.11806038179459866], [0.26628809400784981, 0.78577158973314765], [-0.30370944851659898, 0.69330371535762203]]])+(1.-msk_arg1)*numarray.array([[[0.83772175836918339, 0.60287463850061318], [-0.18527744936965096, 0.54931735571376561], [-0.37167308309872249, 0.73168804739011128]], [[-0.46383496026335846, -0.39094945287159288], [-0.4114599857806287, -0.83457293926382259], [0.49096479229265522, 0.81391664509909445]]])
62303          res=generalTensorProduct(arg0,arg1,offset=2)
62304          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62305          ref=msk_ref*numarray.array([-0.050687863928685628, 0.35918123517652517])+(1.-msk_ref)*numarray.array([-0.2853759841192921, -1.3975229289751401])
62306          self.failUnless(isinstance(res,Data),"wrong type of result.")
62307          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62308          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62309       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62310       def test_generalTensorProduct_array_rank3_expandedData_rank4_offset3(self):
62311          arg0=numarray.array([[[-0.43001183753684313, -0.67833462383068355, -0.84552602616504191], [-0.58683473152759102, -0.60386885707976745, -0.61327103323861998], [0.61468312546560844, -0.75492434588748036, -0.78818981309419578], [-0.54034954365244792, 0.52022532947355415, -0.57477303982479921]], [[-0.65648081838552241, 0.80790367863986634, -0.03074902541822655], [-0.88980529844214606, 0.091391289713685708, 0.34903087642085073], [-0.54438954610923873, -0.64383004912714759, 0.30601151055436326], [0.38803860206514162, 0.80139910770437583, -0.77980376439441423]]])
62312          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62313          arg1=msk_arg1*numarray.array([[[[-0.52631928814506224, 0.52114146151519081], [0.92539527175661851, -0.28115407372136247], [0.13068516078127912, -0.21000051854384694]], [[0.88002789810803805, 0.28365158093793186], [0.81529253278395974, 0.44416599290101022], [-0.19322585923808755, -0.0086189852172304793]], [[0.59776010693329362, 0.39550010260117485], [-0.22191964410150256, 0.91173026317810102], [0.80754985806063218, -0.32152153998509747]], [[0.26670484968560548, -0.27662395810407614], [0.18357345701842753, -0.84421981535555868], [0.085582139456202189, 0.13902170637390454]]], [[[-0.13696484377814966, -0.76083195907288292], [0.69804413089398709, -0.4149668879314421], [0.72484293975385339, 0.51710470976854084]], [[0.53872850448765086, 0.58001248605062394], [-0.97359855532336947, 0.34719604209795807], [-0.022826739261370799, 0.81616552372115692]], [[0.5906989436878114, 0.75409887638106921], [0.22312151836905403, -0.012909715589096038], [-0.37827158040829789, 0.36754054624002785]], [[-0.050944348130106398, 0.15249839291881218], [-0.39456849710011177, 0.74654477024305721], [0.11126598640053387, -0.22730210487646541]]]])+(1.-msk_arg1)*numarray.array([[[[-0.95312417667446159, 0.95479440417988259], [0.6437071563109682, 0.42987924404781164], [-0.1499709638358957, 0.43023213230326296]], [[0.93140872857267154, -0.89037057424834876], [-0.11728818817059539, -0.83920015046545027], [-0.10646147420581453, 0.011809961683704628]], [[0.65330829646027699, 0.7347028036831309], [-0.51628909010371493, 0.78489332676857981], [-0.58510280417275307, -0.32208582652772799]], [[0.69176337155418688, -0.41703379415680497], [0.44919833195877223, 0.28016566960863321], [-0.62420723416190027, -0.23459325986858892]]], [[[0.0657887446833334, -0.5078899406539823], [-0.14155361249305343, -0.87099688187411051], [-0.9516783982658148, 0.051991011281497634]], [[-0.3214501297041279, 0.94726305461156812], [0.78684050949034612, -0.51127235557511885], [-0.51139598833539557, 0.6176469440750012]], [[0.54197304987078243, -0.72835240064770468], [-0.63469061263345949, -0.68225774302319264], [-0.72040690925145934, 0.30787449549031676]], [[-0.90305329024928471, 0.11589149416066991], [-0.98976197368375352, 0.2721992361129435], [-0.54406110828611021, 0.5184134839815393]]]])
62314          res=generalTensorProduct(arg0,arg1,offset=3)
62315          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62316          ref=msk_ref*numarray.array([-2.5499534018495988, -0.3528016548882395])+(1.-msk_ref)*numarray.array([0.38566076603801253, 0.3178879452215792])
62317          self.failUnless(isinstance(res,Data),"wrong type of result.")
62318          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62319          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62320       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62321       def test_generalTensorProduct_array_rank0_expandedData_rank2_offset0(self):
62322          arg0=numarray.array(0.246720077242)
62323          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62324          arg1=msk_arg1*numarray.array([[-0.90606308924596823, -0.41069377717229494, 0.52409905991619588, 0.82402330879009367, -0.029874051064125773], [0.075536381703545041, -0.85747704312966011, 0.14046776773330616, 0.74443505055412396, -0.81767919596405192], [-0.79611289784131944, -0.19503473823432049, 0.44762448588483883, -0.45671928577572496, -0.61527798064175143], [0.97183668249216892, 0.47513629707242799, -0.82237067477448278, 0.92125554787705632, -0.99368761422211782]])+(1.-msk_arg1)*numarray.array([[0.71563952655324181, -0.36819307717015937, -0.60098500904966734, 0.24922312481795217, 0.32024626460365546], [0.52397777755136032, 0.012686857024190701, 0.99978450698005839, -0.41594934988402432, -0.21161406541893024], [-0.47691438338475045, 0.58504726934022555, 0.87044255777491752, -0.32328077177959025, 0.17285650560197818], [-0.34784494744696026, 0.61632440573505276, 0.6052446913779741, 0.78601098711335626, -0.49589140523425912]])
62325          res=generalTensorProduct(arg0,arg1,offset=0)
62326          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62327          ref=msk_ref*numarray.array([[-0.22354395536474614, -0.10132640042669194, 0.12930576054489998, 0.20330309439376909, -0.0073705281860678056], [0.0186363419284678, -0.21155680231405496, 0.034656218505150244, 0.18366707317424708, -0.20173787438729712], [-0.196417035648636, -0.048118985682013747, 0.11043794773284669, -0.1126818174644252, -0.15180143090913673], [0.23977162137092217, 0.11722566391411163, -0.2028953564017851, 0.22729223993170167, -0.24516268493514137]])+(1.-msk_ref)*numarray.array([[0.17656263926853016, -0.090840624439332746, -0.14827506785392228, 0.061488348605538076, 0.079011183139424845], [0.12927583775047968, 0.0031301023449645197, 0.24666691078731567, -0.10262305573207993, -0.05220943856561841], [-0.11766435350643048, 0.14434290748174847, 0.21475565508881309, -0.079759856984262398, 0.042647170413874738], [-0.085820332302298075, 0.15205960498898383, 0.14932601700698783, 0.19392469145354274, -0.12234636580296136]])
62328          self.failUnless(isinstance(res,Data),"wrong type of result.")
62329          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62330          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62331       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62332       def test_generalTensorProduct_array_rank1_expandedData_rank3_offset1(self):
62333          arg0=numarray.array([-0.45898756380933037, 0.88983535078897669, -0.93601582386512105])
62334          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62335          arg1=msk_arg1*numarray.array([[[0.85242562280855316, 0.81174138665070905, -0.34012550800122687, 0.34758312551507897, 0.26793731579633984], [-0.22156781629023947, -0.33053084124743548, -0.9232944731653745, 0.1068871638491351, -0.49779757627283239], [-0.78537035377840958, -0.21886959538687889, 0.52247528432916046, -0.52722844717407402, -0.96038601029480741], [0.029908729932515365, -0.61732773958940257, -0.19929118801933221, -0.27953522474954773, 0.90108371942625731]], [[0.084225678094832279, -0.023714294740967423, 0.21836023456079601, 0.94385311099605307, 0.11021975958514818], [-0.10698176723360175, 0.58192355928131878, 0.71031788640458982, -0.048329163621356308, -0.061722169078396005], [0.38733073278731878, -0.52072790429793914, 0.41516080090406215, 0.33751425915179234, -0.23451160480295163], [-0.31754221530628568, -0.62142882926223897, 0.26735178472188759, 0.605302787951701, 0.45754720795975157]], [[0.36684565227343136, -0.96975721436593609, 0.22078755039429643, -0.79362315968720742, 0.3667120169226652], [-0.94967278938118627, -0.68731033549091536, -0.0051219726794407006, -0.4970685936575685, -0.97365752935427241], [0.93857640099798578, -0.79974261569970606, 0.4713594604980047, 0.28733078923508604, 0.698123283943757], [-0.67384865621491841, -0.79939314063274058, 0.35458508209965145, 0.95301187439504198, -0.97831639629936129]]])+(1.-msk_arg1)*numarray.array([[[0.72714071831087601, -0.069880915555535772, 0.63661806717395186, 0.91652507007398865, 0.43388651012901036], [-0.43994170474778538, 0.50193110150742548, 0.012195024468751647, -0.81011667336280713, 0.35867188021786234], [0.63456002432073988, 0.12686757195357812, -0.31753861162141606, -0.2713929291157926, 0.0062677001459554571], [0.28240715099030056, 0.96490579712169278, -0.80554150665350055, 0.39297250550849117, -0.92586690440310981]], [[0.24093560956733051, 0.73574827125879128, -0.29589772664313663, 0.68855053836914593, -0.50420649671382933], [-0.41570011382358185, -0.11849406919389804, 0.70934019905166501, 0.14959503558013476, 0.55658836091190578], [0.21647538656634957, -0.36103768109385581, -0.087766955544852587, -0.35080045403584581, 0.69133554630830929], [0.24625237634091124, 0.8186658776186384, -0.88284083282306636, -0.81056468701951134, -0.6613670526779627]], [[0.5843108954601135, -0.26934257233015146, 0.42756771750303102, -0.68148742930164796, 0.88067974610692179], [0.077404089928057696, 0.50384458646633989, -0.91409329566927866, 0.92145702282272657, 0.19650029237078437], [0.074281284173659312, -0.31617866194376565, 0.87744747244144938, 0.54492479150563344, 0.51327357845032595], [0.60913616523699399, -0.14723265662421592, -0.30131458551603196, 0.91534161518928614, -0.16136397835280158]]])
62336          res=generalTensorProduct(arg0,arg1,offset=1)
62337          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62338          ref=msk_ref*numarray.array([[-0.65967910957264797, 0.51402707867231801, 0.14375739334418389, 1.4231813677681031, -0.3681507080377549], [0.89540947219819222, 1.3128590500190129, 1.0606408940146683, 0.3731991920079154, 1.0849191833313432], [-0.17338655939051062, 0.38566806830619932, -0.31158481475318872, 0.27337725432032672, -0.42132592172218375], [0.33444498147167767, 0.47862104411059431, -0.0025260017320665185, -0.22511118430788257, 0.90927508681257729]])+(1.-msk_ref)*numarray.array([[-0.66627976839463887, 0.93887820197710825, -0.95571018247106188, 0.82990601835371725, -1.4721394552408742], [-0.2404283383314556, -0.80742685080986487, 1.481204409515817, -0.35754992510386352, 0.14671868381582179], [-0.16815616551488571, -0.083546498633702226, -0.75365658472707486, -0.69764689336965802, 0.131865820540083], [-0.48065839010178329, 0.42341017365332678, -0.13381422847539171, -1.7584128416179854, -0.012507151316245857]])
62339          self.failUnless(isinstance(res,Data),"wrong type of result.")
62340          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62341          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62342       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62343       def test_generalTensorProduct_array_rank2_expandedData_rank4_offset2(self):
62344          arg0=numarray.array([[-0.15567837122009331, -0.99458185572550151, -0.33226843547045659], [0.92930130927476728, -0.37142212420915421, -0.96245710875878232]])
62345          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62346          arg1=msk_arg1*numarray.array([[[[-0.35127871779755471, -0.97956450989628086, -0.60744994194165369, -0.038418047339281669, -0.10029756097954978], [-0.6369298408416797, 0.44643445887674393, 0.21964290198361081, 0.92953218811876437, 0.97103733264071934], [-0.0084197182499485823, -0.043538373006895004, 0.6786658762552189, 0.90131480922601503, 0.54793303378730029], [-0.47112100116818256, -0.37272322946487479, -0.18755038677313451, 0.42443008032841334, 0.48097249500434125]], [[0.34855610480392829, 0.33060143769110972, 0.23547431013984288, 0.53782333559518292, -0.079353483176874073], [0.23698099293470309, -0.1667415355358739, -0.20272943860278869, -0.96054949810501178, -0.40383757079019023], [0.020374036923875849, -0.060923575007736153, 0.11376424710596056, -0.58646147084217004, 0.23177634402632163], [0.59762081954918722, 0.86850410144418344, -0.15526430031954841, 0.60439399241076419, 0.2833946544584125]], [[0.85295491254935207, -0.43042679554314067, -0.49819931812536455, 0.094055101122851203, -0.36880858083543644], [0.85797239083026411, -0.76918517380349716, -0.90024063221013351, -0.22339105759424061, -0.046532099466895849], [0.7614283619803015, 0.80185876338157525, 0.82994826285351597, 0.75516258598893016, -0.97670968888752507], [0.75955635097176355, -0.90881364204951831, 0.32602819230807079, 0.083173009841529977, 0.501732633561361]]], [[[0.2650940311750436, -0.0059478044912930628, -0.41191591020874063, -0.12014053171499217, 0.20117563104180558], [-0.85257783450818647, 0.51007282849774804, 0.14245159715060685, -0.63328211292436287, -0.8697637267495868], [-0.0026202687159828653, -0.73209555573520801, -0.76351605990178295, -0.29674919348051088, 0.39078919825820035], [-0.58449899116503756, -0.94379815050822558, 0.81377078572032402, -0.70125898657220076, 0.7117592064496423]], [[-0.93085731079390865, -0.48006211845588509, 0.51975508101155743, 0.8443893547227741, -0.093203952092502762], [-0.73419105384658745, 0.44366335500045739, -0.54432407567258778, 0.034936359584416099, 0.6516213147001535], [0.58736121590976542, 0.83114917192559545, 0.28065847836369651, 0.022859303816783472, 0.859996216145823], [-0.73778138930524029, -0.15574464335337601, 0.75031664084905025, 0.54855170139855747, -0.32672276272079714]], [[-0.16299372657036959, 0.72747842680200403, 0.57758779444496366, -0.1864924392052687, 0.082207658998947553], [0.25507613542080221, 0.8765126238226757, 0.051137225946723097, -0.26589640779286383, -0.3912484901216835], [0.33466537029520227, 0.089808154574321897, -0.58495623444226363, 0.13068829255844583, 0.02863071040379106], [0.88114852531025889, 0.031716523229728733, -0.35560578463881942, -0.037972535794119189, 0.1953933902403584]]]])+(1.-msk_arg1)*numarray.array([[[[-0.5400576969613653, 0.54390449059242485, 0.64252932691754272, -0.67716585248690264, 0.62032550673818077], [0.38686651228491309, 0.70562149983910283, -0.3797375428798222, 0.42131084317286249, -0.23401239469472968], [-0.81222205619556331, -0.31477452773598213, 0.65523992331279235, 0.84485811902262431, 0.85372296262510772], [-0.8153916842378639, 0.90033465417130198, -0.42657592639282749, 0.97028575035532749, -0.27057293549112438]], [[0.052779171139729408, 0.36233793941474812, 0.86944888051629454, -0.17889593274284032, -0.29398276355410724], [0.78490974759228194, -0.79157704322053202, -0.080138009805514665, 0.45356570526421947, -0.034120451956423548], [-0.53448585528819592, -0.77887668081327566, -0.33583358701952992, -0.92924300429544981, 0.55815450679709055], [-0.67832365077414014, 0.58981723503723815, -0.47808607678761939, -0.36774208196354441, 0.56454027091525583]], [[0.30531597496592267, -0.5137220047053348, 0.5399701460049755, 0.62699661456074529, -0.33008771690995675], [0.4038318412213413, 0.71665310930417392, 0.17155433840257439, 0.49938460899411519, 0.76594724141017734], [0.093659296418102445, 0.69852696787255919, 0.97343788252166186, -0.73352088248911596, 0.24457026362353562], [-0.05159937476167098, 0.0089173339495294268, 0.63630412968308092, 0.19929173696907432, -0.6899602289422393]]], [[[-0.041410357421850952, -0.38889962330894945, 0.76265307793920667, -0.6172823784055359, 0.75349588051567595], [0.43340267750760852, 0.90213377312990706, -0.30519183664875094, -0.45301089881026768, -0.25485997032818175], [0.1028116379592845, 0.46583104682036325, 0.23805065016850846, 0.12116867505618378, -0.73215373850345622], [-0.61450129597264058, -0.21160824510167164, 0.2740254445277146, -0.73326188821149674, -0.65848204769696772]], [[0.05465618403094008, 0.73479651092063558, -0.11624751259705235, -0.96407216617836444, -0.71692326121970029], [-0.39937135886439812, 0.95816590731535523, -0.77458905285943214, -0.28840726524892157, 0.41894583661925133], [-0.95805087709319592, 0.39999600705773086, -0.91177445190169304, 0.22938168173475115, -0.95555272902848776], [0.10882185573061198, -0.39229951167354637, -0.3916511170457424, -0.76865359478173878, -0.97727821625370059]], [[0.40999321198896133, -0.88135565882772182, 0.63565529375876584, -0.37317089007892901, 0.555290126540674], [-0.29038581494590576, 0.42164379201880831, -0.44899645286707468, 0.43518447818908657, 0.57581862344993118], [0.742256366774243, 0.20714822805684063, 0.51816577049514523, -0.4792865629173042, -0.68267272302722626], [-0.20661401354081876, -0.044969253011393873, -0.72969509807854416, -0.58480750239810297, -0.94644086867131372]]]])
62347          res=generalTensorProduct(arg0,arg1,offset=2)
62348          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62349          ref=msk_ref*numarray.array([[0.17357662755437517, -0.56068434011508095, -1.1058417604311526, -0.80596068079916849, 0.35953058702351004], [-1.1867246763814974, -0.18246697340244233, 0.75189599198649326, 0.53929069680721775, -0.40779809418743429], [-0.81464652432281048, -1.2745419377179736, -0.74535102121815788, -0.21798971586117438, 0.024891393064954859], [-1.8906310830059134, -1.3535550326000345, 0.89510108868401261, -1.5137078435385907, 0.071286954422171256]])+(1.-msk_ref)*numarray.array([[-0.52324886143927274, -0.060412889488976718, -1.0040605900159618, 0.21861292691146322, 0.73755932643826372], [-0.1444833899391284, 0.51597296627785161, 0.51804280694792126, -1.4153361263447299, -1.1307820248483642], [0.36390967761232795, 0.67652048804950649, -0.030273718808280836, 1.5251054682606959, -0.43773431244205419], [0.40611351058859685, -0.73740522531452113, 1.43290093380566, 0.31540459956650063, 0.37185611346040481]])
62350          self.failUnless(isinstance(res,Data),"wrong type of result.")
62351          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62352          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62353       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62354       def test_generalTensorProduct_array_rank0_expandedData_rank3_offset0(self):
62355          arg0=numarray.array(0.397935405161)
62356          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62357          arg1=msk_arg1*numarray.array([[[0.64855136176452, 0.2042764526055143], [0.57156517001528928, 0.113069690854112]], [[-0.46322457785304105, -0.58741275123160652], [-0.34660809943833559, -0.070136876600527254]], [[0.93904108736278591, 0.0978246757865604], [0.90358035912154144, 0.58162970040061435]], [[-0.0044565980623507695, 0.37244165415216379], [0.63865927635948805, 0.87488924597310436]], [[0.12941567762514139, 0.18188069069073864], [-0.041115943834846069, -0.96717599327038872]], [[-0.39484846078645952, -0.22972143995780026], [0.80257758473262064, 0.11524735232116123]]])+(1.-msk_arg1)*numarray.array([[[-0.11353099149817547, 0.14689562504283704], [-0.52872914834391271, 0.91405375689433854]], [[-0.091757433519643827, 0.28429622420916467], [-0.84808463946975055, 0.070875029823600944]], [[0.44839088032488283, -0.84297869442304929], [0.23290100156517934, 0.82996096337244207]], [[0.39393350042807462, -0.74292813703585603], [0.9539033621723203, 0.86285011420744029]], [[0.50084397874038711, 0.61907542037323404], [0.41962142966880744, 0.41222973493565696]], [[-0.081781889957842857, 0.64626820347226288], [0.80126051994452197, -0.11848439795557497]]])
62358          res=generalTensorProduct(arg0,arg1,offset=0)
62359          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62360          ref=msk_ref*numarray.array([[[0.25808154891149304, 0.081288832932430458], [0.22744601750595925, 0.044994433241461913]], [[-0.18433346006849058, -0.23375233115809657], [-0.13792763448208387, -0.02790994640675901]], [[0.37367769556255143, 0.038927901993869966], [0.35956661630256714, 0.23145105048259895]], [[-0.0017734381555813534, 0.14820772054388037], [0.25414513789795429, 0.34814940656732324]], [[0.051499080109948102, 0.072376766340984555], [-0.016361489768497058, -0.38487357074406042]], [[-0.15712418222026339, -0.091414294283779299], [0.31937403635372524, 0.045861001839655677]]])+(1.-msk_ref)*numarray.array([[[-0.045178001100158342, 0.058454970067802078], [-0.21040004786667396, 0.36373435208869764]], [[-0.03651353148417448, 0.11313153316642105], [-0.33748290461822955, 0.02820368370865375]], [[0.17843060663258697, -0.33545106830734062], [0.092679554420246113, 0.33027085222744007]], [[0.15676008709934322, -0.29563740921688236], [0.37959192091049787, 0.34335860979036686]], [[0.19930355160251134, 0.24635202823144933], [0.16698222362950177, 0.16404080659103898]], [[-0.032543909515207844, 0.25717299939141702], [0.31884992964364989, -0.047149136905710806]]])
62361          self.failUnless(isinstance(res,Data),"wrong type of result.")
62362          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
62363          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62364       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62365       def test_generalTensorProduct_array_rank1_expandedData_rank4_offset1(self):
62366          arg0=numarray.array([0.58094125486846315, -0.70531568726399341, 0.33962817234815112])
62367          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62368          arg1=msk_arg1*numarray.array([[[[0.80357271142620523, 0.35558076743542011], [-0.43626897980642543, -0.85549536630258305]], [[-0.26754631653407501, 0.51743370193875693], [0.51753892488071562, 0.572824830754044]], [[0.97802273451540866, -0.74073345776348076], [0.41953325134180197, 0.7159440736068543]], [[-0.49036398122427816, 0.16694033660312968], [-0.89027232449679583, 0.91717194477620434]], [[0.25437986062316043, -0.00032194374216909516], [-0.62727316519705067, 0.96501042929144187]], [[-0.30576117185470064, 0.71147194680507875], [-0.8685379364364334, -0.9799141708690291]]], [[[-0.5383524028113742, 0.93935638517202324], [-0.40058327869371579, 0.169001438718964]], [[0.89779941446224787, -0.59221892360934625], [-0.97768845916725589, -0.081232361131200026]], [[0.49596054779976373, 0.28221056664423583], [0.083800757378065027, 0.28310349410868851]], [[-0.7560893507215658, -0.10090400663602206], [0.25474857558133479, -0.19606517118931222]], [[-0.69278299536328758, -0.35485094837221354], [-0.5456964771558821, 0.20984835862543139]], [[-0.8549814931696289, 0.33794492467712778], [0.36372574439646055, -0.22652827274814791]]], [[[-0.93422963907949774, 0.39846342895261011], [-0.070648900709936679, 0.46837319791630705]], [[0.032549671152720672, 0.96148955261804536], [-0.70687807605514852, 0.81748535012338919]], [[-0.64116199224960324, -0.02727827115942083], [-0.43022179668698768, -0.10802839892530125]], [[-0.67840300363556549, -0.56043397572882103], [-0.87204383998131041, 0.38368378844084194]], [[-0.89762178008906024, -0.51113241729478442], [0.22367035129835267, 0.6899640311800832]], [[0.48373441406902007, -0.10496738262185956], [0.40700201672702718, 0.21849992849304889]]]])+(1.-msk_arg1)*numarray.array([[[[-0.6252940686336419, -0.93451677888993334], [-0.14336387160241482, 0.66170242429170933]], [[-0.075909979796753957, 0.1029834249310142], [0.0019371382625155142, -0.35648770504344762]], [[-0.64392168474876854, 0.86879994937514926], [0.71800682712291364, -0.54147309355287843]], [[-0.26550760514699556, -0.34165457051337755], [-0.9361129944281994, -0.66826907994971707]], [[0.2993232633527716, 0.69894974758462025], [0.15523651580784414, 0.83774155108624115]], [[0.66048860953118727, 0.36808214664022665], [-0.79256479641945399, -0.47391112872752794]]], [[[0.020578229008302973, -0.12657871373282181], [-0.24339439264094431, 0.1049992497018053]], [[-0.66158434727238991, 0.39006901220476586], [0.010907168410064561, 0.87973022625247665]], [[-0.13464073186116621, 0.71767880499566128], [0.72032828223356082, 0.7876183104671588]], [[0.66001431464881066, 0.48557099561277561], [0.69659179969725282, 0.78918487272905424]], [[0.91896245160112944, -0.85352109578245883], [-0.74121612227355405, 0.86130125487461084]], [[0.74853381218847259, 0.9715538622996307], [-0.50918578502972944, -0.58292738572585412]]], [[[-0.85450489940620789, 0.91158194984001839], [0.678538801711281, 0.028877641832678824]], [[0.086414830881134996, 0.7798651220646573], [0.26810304672424934, 0.64519421687674172]], [[0.1071921599369059, -0.20721273450354616], [-0.6286256537829138, -0.90842770005264128]], [[-0.34685350204025611, 0.59014494374069204], [-0.84383192775778637, -0.94621546980649129]], [[-0.47166175955858858, -0.89620995115135282], [0.60116289046449523, 0.19581635274526943]], [[-0.42171845838347832, 0.41656989319770021], [-0.2106968213483944, 0.13888209876526769]]]])
62369          res=generalTensorProduct(arg0,arg1,offset=1)
62370          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62371          ref=msk_ref*numarray.array([[[0.52924622945907696, -0.32064185102964965], [0.0050966649028711536, -0.45711918434747367]], [[-0.77760591857525996, 1.0448488207193125], [0.75016301092751858, 0.66771309000119361]], [[0.00060832444521816131, -0.63863463362070383], [0.038502742197060208, 0.17955462533400071]], [[0.018004241202196819, -0.022187459476025323], [-0.99304474361382078, 0.80142068532213695]], [[0.33155282531160718, 0.076499941412134731], [0.096444178707782061, 0.64693625336426197]], [[0.58969241553777563, 0.13931566845859278], [-0.62288164099583243, -0.33528989233766221]]])+(1.-msk_ref)*numarray.array([[[-0.66798720587737304, -0.1440224861847651], [0.31883478894274869, 0.32016027946925457]], [[0.4518754907352947, 0.049569692771371465], [0.084487714309758447, -0.60845981116184855]], [[-0.24271097387915697, -0.071843669067361907], [-0.30443803217179921, -1.1786112478742805]], [[-0.7375639922223034, -0.34053222674852002], [-1.3217328770211167, -1.266210979440948]], [[-0.63445902226276885, 0.70367241396816671], [0.81714650875932926, -0.054305908580975726]], [[-0.28747502780293577, -0.32993920445600089], [-0.17285544183730611, 0.18300157724465718]]])
62372          self.failUnless(isinstance(res,Data),"wrong type of result.")
62373          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
62374          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62375       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62376       def test_generalTensorProduct_array_rank0_expandedData_rank4_offset0(self):
62377          arg0=numarray.array(0.230590279322)
62378          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62379          arg1=msk_arg1*numarray.array([[[[-0.066312470382497768, -0.89062977701329626, 0.71362735820116852, -0.8510953245363897], [0.28293774090969026, 0.25097979621619571, 0.066933085142837356, -0.56967672184500784], [0.1986033484055707, 0.76155575799023101, 0.55852074431443355, -0.71500202987886063]], [[-0.62331344986469928, -0.20106746777405515, 0.55102394367851693, -0.98232334137965815], [-0.67658601924861972, 0.92317739758478545, 0.93351836962236034, -0.20589570828355885], [0.90470062450224575, 0.66723967147848429, -0.033936107455468267, 0.55318521774224605]]], [[[0.60894484824072981, 0.13287283422764329, -0.13321078710786471, -0.82165783919443536], [0.13368845696530918, -0.59334064706858936, 0.11519758697474081, -0.35471586137804523], [0.58688784183441478, 0.56827715360873454, 0.94988912711576612, 0.024453360032851146]], [[-0.45298593929664333, -0.88380857939677937, 0.41042957905037114, -0.5833823328762251], [-0.67171125068743298, 0.39935136685719619, -0.53134853308929642, 0.93408659260593163], [0.1951446842154847, -0.84017953630497177, -0.44662380908267529, -0.65508078680812609]]], [[[0.21054665031300557, -0.16075862406915165, -0.11940924337577585, 0.71458184133956326], [-0.11249420009883448, -0.72194668061515088, 0.43551686843447701, -0.65726238063840325], [0.57020742614208064, -0.78711907270448789, 0.43212511342249726, 0.0013358666819349718]], [[-0.67954467636278171, 0.15950351051049738, -0.89383827696316875, -0.8840920624626798], [-0.95076218521268774, -0.67804964568320436, -0.81092815217985925, -0.54797049686525989], [0.61486303043574275, -0.14290653565480405, 0.69133390362967218, 0.024550324593437756]]]])+(1.-msk_arg1)*numarray.array([[[[0.63494465698856972, -0.48488631109074665, -0.94806337724031264, -0.41820750929885575], [-0.44235661868574261, -0.51810596353317306, 0.51911006914000302, -0.98759912447853693], [0.72870517333516971, -0.91489474875045085, 0.89603074496374435, 0.86497307424604974]], [[-0.035096579189960231, 0.14285616178492155, 0.70734963342151569, -0.62420641584175662], [0.95768549343851794, -0.93878301478876325, -0.50688263601359429, -0.43973229011588288], [-0.42389449784277122, -0.51673090989498061, 0.5661720369298191, -0.16556170575614515]]], [[[0.48334167705674269, -0.60079239828936437, -0.75011328001800304, -0.24713665339883883], [0.82345167794282959, 0.86168709898201046, -0.39365753159365813, 0.56891341758443326], [-0.17891976579371804, -0.28997290343372595, -0.7460995910027961, 0.14226008593460104]], [[-0.16544575140619178, 0.79101784387278862, 0.3373194453076529, 0.67183289286145609], [0.7156256283509812, -0.75593140722953955, -0.15867260258076077, 0.20469527257985543], [0.30181817583862958, 0.058883413713779031, 0.62227232187781278, -0.79758012149488478]]], [[[-0.38962504256609698, -0.047658553830109751, 0.55656226850951573, -0.028622882565748409], [0.64843964854655312, -0.5511453419056811, 0.37189718058596233, 0.50932018272054336], [0.18260360814565457, 0.35757469805554387, 0.37342919652878703, -0.082727729105125158]], [[-0.83731026720650648, 0.61874667386645266, -0.68483960244566688, 0.99026183453543593], [0.196325542135388, 0.92663897567289788, -0.34059772678603073, 0.53975735224831722], [-0.79781723482887945, 0.9180424353548009, 0.87670650811699713, -0.52528550909828664]]]])
62380          res=generalTensorProduct(arg0,arg1,offset=0)
62381          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62382          ref=msk_ref*numarray.array([[[[-0.015291011068021282, -0.20537056905384243, 0.1645555318593129, -0.19625430861435661], [0.065242692707055364, 0.057873501313630595, 0.015434118798959243, -0.13136191441338946], [0.045796001583092889, 0.17560735495412155, 0.1287894544385062, -0.16487251778544776]], [[-0.1437300225093596, -0.046364203556554073, 0.12706076508585004, -0.22651421367309676], [-0.1560141591637898, 0.21287573397268333, 0.21526026160328704, -0.047477548884273545], [0.20861516970661428, 0.15385898222083524, -0.0078253364972523422, 0.12755913387589637]]], [[[0.14041676264742425, 0.030639183958836566, -0.030717112607884445, -0.18946631064682284], [0.030827258633736185, -0.13681858554054621, 0.026563443757707229, -0.081794029555049885], [0.13533063137918849, 0.13103918758285724, 0.21903519914640157, 0.0056387071203326195]], [[-0.10445415427127822, -0.20379766719014034, 0.094641071275169547, -0.13452229508935432], [-0.15489008491963643, 0.092086543231158738, -0.12252380666230983, 0.21539128829978585], [0.044998467241420523, -0.19373723395705592, -0.10298710888815742, -0.15105526160845531]]], [[[0.048550010905953338, -0.037069376027500059, -0.02753461078362951, 0.16477562639280335], [-0.025940069022876999, -0.16647388673852154, 0.10042595634167831, -0.15155831593914573], [0.13148428966548878, -0.18150200683447412, 0.099643850606074641, 0.00030803787132412233]], [[-0.15669639673416197, 0.03677995904142934, -0.20611041795348764, -0.20386303562948935], [-0.2192365178568349, -0.15635165719216351, -0.18699214912109585, -0.12635666993228672], [0.14178143793284981, -0.032952857973557494, 0.15941487794262285, 0.005661066205442605]]]])+(1.-msk_ref)*numarray.array([[[[0.14641206580890304, -0.11181006991375099, -0.21861419897264894, -0.096434586383713383], [-0.10200313626260925, -0.11947019884942447, 0.11970173584177202, -0.22773075797150866], [0.16803232946262528, -0.21096583566444943, 0.20661597976214455, 0.19945438279626568]], [[-0.008092929998653943, 0.032941242248830764, 0.16310794954886715, -0.14393593178343414], [0.22083296543446027, -0.21647423760273826, -0.11688220862176434, -0.10139799160465301], [-0.097745950660554942, -0.11915312484691117, 0.13055376813986105, -0.038176919975309496]]], [[[0.1114538923204, -0.1385368869359816, -0.17296883076237154, -0.056987309937902554], [0.1898799524248734, 0.19869666884228621, -0.090773600167326968, 0.13118590387073603], [-0.04125715877057131, -0.066864932798547272, -0.17204331309124399, 0.032803792952008359]], [[-0.038150182029365161, 0.18240102556718452, 0.077782585114179195, 0.15491813442252175], [0.16501631353131871, -0.17431043434120974, -0.036588359749820644, 0.047200740080048667], [0.069596337471037259, 0.013577942815683664, 0.14348994851605365, -0.1839142229970511]]], [[[-0.089843747396099391, -0.010989599239759867, 0.12833784895560513, -0.0066001584858320977], [0.14952387968170427, -0.12708875833696101, 0.085755874750321148, 0.11744428319777975], [0.042106617007481972, 0.082453249503049802, 0.086109142734502611, -0.019076210162012171]], [[-0.1930756083941913, 0.14267696835632362, -0.15791735521860295, 0.22834475302728208], [0.045270761599010431, 0.21367394023091554, -0.078538524955973951, 0.12446279862095527], [-0.18396889902696786, 0.21169166159776412, 0.20215999858997175, -0.12112573226668788]]]])
62383          self.failUnless(isinstance(res,Data),"wrong type of result.")
62384          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
62385          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62386       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62387       def test_generalTensorProduct_array_rank1_float_rank0_offset0(self):
62388          arg0=numarray.array([-0.27625195823531112, -0.75078696241622422])
62389          arg1=0.427691913345
62390          res=generalTensorProduct(arg0,arg1,offset=0)
62391          ref=numarray.array([-0.11815072858291316, -0.32110551247013941])
62392          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62393          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
62394          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62395       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62396       def test_generalTensorProduct_array_rank1_array_rank0_offset0(self):
62397          arg0=numarray.array([0.53938078068318251, -0.49824063116272055])
62398          arg1=numarray.array(-0.832775572875)
62399          res=generalTensorProduct(arg0,arg1,offset=0)
62400          ref=numarray.array([-0.44918313863132658, 0.41492262704625121])
62401          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62402          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
62403          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62404       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62405       def test_generalTensorProduct_array_rank2_array_rank1_offset1(self):
62406          arg0=numarray.array([[0.88539183799797438, -0.40982751242758342, 0.59340415310638051], [0.2778157681814577, -0.15842581033003245, 0.36342429966143941]])
62407          arg1=numarray.array([0.20672442496420129, -0.34180190599784144, -0.54398285808314895])
62408          res=generalTensorProduct(arg0,arg1,offset=1)
62409          ref=numarray.array([0.00031025625101116505, -0.08611504037333928])
62410          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62411          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
62412          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62413       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62414       def test_generalTensorProduct_array_rank3_array_rank2_offset2(self):
62415          arg0=numarray.array([[[0.41240187517243743, 0.80149388213518225, 0.6745878855975842], [-0.98079352271344677, -0.31453045490141163, -0.23603500511791431]], [[0.35323881651995603, 0.18772913395415314, 0.59815792024827741], [-0.79788231528322928, -0.74692529231152172, 0.30335981519358346]]])
62416          arg1=numarray.array([[-0.88221591813325406, 0.93087345105456332, 0.10605621958128308], [-0.33744894794646707, -0.50807432404282804, -0.69305432358433916]])
62417          res=generalTensorProduct(arg0,arg1,offset=2)
62418          ref=numarray.array([1.1081637895104819, 0.36505080704249099])
62419          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62420          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
62421          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62422       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62423       def test_generalTensorProduct_array_rank4_array_rank3_offset3(self):
62424          arg0=numarray.array([[[[-0.57169923177964632, 0.30353363141778189, 0.26377102110166706], [0.56413783485466262, -0.76690392370295712, -0.9667075191575647], [-0.66186644532876637, -0.11993329259543017, 0.61828017839465632], [-0.49127889096237021, 0.23976236080820978, 0.42256666962081479]], [[-0.090544527580306511, 0.13413440802242604, -0.1457797722237657], [-0.031536035831397191, 0.58066610576011146, 0.62949072806729101], [-0.22234525084722767, 0.73703517301187871, 0.89236045129088493], [0.78402134351733999, 0.86083626405088864, 0.10499665521946655]]], [[[-0.56604889463766028, -0.56565123509415005, 0.50932781624734358], [0.25808680279858298, 0.017644158605391924, 0.8888513859936682], [-0.64207509069485647, 0.031789934675000353, -0.44571603689781503], [-0.52036437236378696, 0.020123607670690546, -0.74895536700886289]], [[0.01446271912075181, -0.51124159183720974, -0.59399690628094826], [0.99231918980516998, 0.91169617539924164, -0.014796197189341775], [0.41444067023573261, -0.18067184403240177, 0.60913632480383262], [-0.4307741668346976, -0.68664281942059002, -0.48116283104473023]]]])
62425          arg1=numarray.array([[[0.35362784529244751, 0.72816504699497409, -0.17615592910788802], [0.16239863539338728, -0.39673750318313439, -0.014115918626133039], [-0.37396256237417758, 0.071779395090337816, 0.10643531664487171], [0.77871767983666884, 0.58389496873888214, -0.85725801390774103]], [[0.71358517268545563, -0.82189444544790136, -0.88778623487270658], [-0.75100881454701196, 0.46903068813805393, -0.011983138755741196], [-0.024651679718989739, 0.36703157575218559, -0.16848622192977247], [0.44186275788820839, 0.85182694343056875, -0.41831469678362354]]])
62426          res=generalTensorProduct(arg0,arg1,offset=3)
62427          ref=numarray.array([1.4862950482934913, -0.348605050085871])
62428          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62429          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
62430          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62431       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62432       def test_generalTensorProduct_array_rank1_array_rank1_offset0(self):
62433          arg0=numarray.array([-0.86119269783132357, 0.70989525090873573])
62434          arg1=numarray.array([-0.94133810017909458, 0.23299903772206854])
62435          res=generalTensorProduct(arg0,arg1,offset=0)
62436          ref=numarray.array([[0.81067349806464717, -0.20065706988797052], [-0.66825144681659099, 0.16540491034520183]])
62437          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62438          self.failUnlessEqual(res.shape,(2, 2),"wrong shape of result.")
62439          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62440       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62441       def test_generalTensorProduct_array_rank2_array_rank2_offset1(self):
62442          arg0=numarray.array([[-0.55121571333120323, 0.96947139195929588, -0.29668652541182272], [-0.48483467722216389, -0.68798570197690379, 0.086192052612611647]])
62443          arg1=numarray.array([[-0.039211707293509868, 0.727938931848223], [0.37579996279226902, 0.30903452193668368], [0.57623481940432675, -0.35460484107182633]])
62444          res=generalTensorProduct(arg0,arg1,offset=1)
62445          ref=numarray.array([[0.21498031584282018, 0.0035552287569717012], [-0.18986694388423817, -0.59610548868813584]])
62446          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62447          self.failUnlessEqual(res.shape,(2, 2),"wrong shape of result.")
62448          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62449       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62450       def test_generalTensorProduct_array_rank3_array_rank3_offset2(self):
62451          arg0=numarray.array([[[-0.1167849162299901, -0.12587612894959044, -0.93701822746438213], [0.80741578523027324, 0.84714030734228074, 0.29496940505371971]], [[0.90392589500660381, -0.6397391043368359, -0.17587324514101499], [0.82339662710377781, 0.067099746735601595, 0.31459211686975563]]])
62452          arg1=numarray.array([[[-0.8027362920122334, 0.65782392850876259], [0.30355767269824918, 0.68172162124158708], [0.22426878281267215, -0.73047874315358796]], [[0.90693084036385807, 0.12367868713529018], [-0.27543085519071697, -0.83829683025419111], [0.94140892842895818, -0.22220054899303565]]])
62453          res=generalTensorProduct(arg0,arg1,offset=2)
62454          ref=numarray.array([[0.62202141735356897, -0.15400176785301534], [0.065187568504999405, 0.26265633877401284]])
62455          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62456          self.failUnlessEqual(res.shape,(2, 2),"wrong shape of result.")
62457          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62458       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62459       def test_generalTensorProduct_array_rank4_array_rank4_offset3(self):
62460          arg0=numarray.array([[[[0.14718802616207727, -0.72418403744145765, 0.029787271532923709], [-0.4194914416843798, 0.033539699792270783, -0.41345755052795585], [0.29793467417858288, -0.024086341810864775, 0.20107547406029402], [-0.32926862780565025, -0.087885591522340212, -0.96049633447200877]], [[0.48755603515508228, 0.58360455947452583, 0.96051393888586056], [-0.09339097647682526, -0.7289505467954871, 0.50694871812914433], [-0.23153994242379516, -0.69178924344132864, -0.35010591080392217], [0.76117083899516769, 0.91906409624905328, -0.068145540073345945]]], [[[0.28888775893902707, 0.56072260710203503, 0.3004380109898086], [-0.77690231820952871, -0.19105902948192943, 0.061097601125626344], [0.49902935768302692, -0.2575791504356848, 0.34552364335407915], [-0.76979488857722389, -0.089599824812399254, 0.18209335158166828]], [[-0.0022515113036907231, 0.95159538282261225, -0.53265411615683833], [-0.77182961005442197, 0.25080041087390881, -0.8898487749784727], [-0.78690292782915039, -0.11261393265289898, -0.95298748093132546], [0.52841967991646666, -0.41384006986314237, 0.30463914538153691]]]])
62461          arg1=numarray.array([[[[-0.14609311274113113, -0.073722987046462407], [-0.78742135171642258, -0.48291552383766301], [0.81207326183018891, 0.42985929476124451]], [[0.85045298915616385, 0.23020552261700811], [0.88744870021567324, -0.75314953189505118], [0.13110082004798085, 0.10264629590578944]], [[0.56749603335850285, 0.97712891214284459], [0.21204273490462522, 0.13016206253703966], [-0.28810992515358103, 0.22154260349347887]], [[-0.47127258934981042, -0.92833308834208794], [-0.53100947916267249, 0.86920042049278767], [-0.63104371922734082, 0.7329136152644169]]], [[[-0.61161254251146913, 0.54367778091596342], [0.5116880975065683, -0.48461481818601149], [0.080267075199626836, -0.35821005714133203]], [[-0.52631555752873749, 0.9354736941695847], [0.077835296819701805, -0.19328874304048815], [0.95185455107436723, -0.31423264712043197]], [[-0.56560635419659167, -0.60637112174268637], [-0.085211102592329002, 0.79595540543851939], [0.20174594705332338, -0.52497571340199878]], [[0.60148618323817704, 0.3731951934078912], [0.92174719978809905, 0.38607719889902881], [-0.73169489496198992, 0.7088746633475238]]]])
62462          res=generalTensorProduct(arg0,arg1,offset=3)
62463          ref=numarray.array([[3.1323213977016477, -0.058175766091763288], [-0.6373593664946231, 1.4879611045290597]])
62464          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62465          self.failUnlessEqual(res.shape,(2, 2),"wrong shape of result.")
62466          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62467       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62468       def test_generalTensorProduct_array_rank1_array_rank2_offset0(self):
62469          arg0=numarray.array([-0.2829757697975257, -0.9280442578646535])
62470          arg1=numarray.array([[0.45705394095659591, 0.64164022405665966, 0.56271284330506521, 0.037291411324969603, -0.033294294288899628], [-0.86552957408790854, -0.38831505443909253, -0.27081057004302544, -0.58214120847120077, 0.26580142569351506], [-0.9404040393213684, -0.51017277509298808, 0.2411135895592369, 0.4822196083653203, 0.81444259978873679], [-0.16124737486506158, -0.54199546950110533, 0.69075909128233892, -0.52795776423665997, 0.47484827191606827]])
62471          res=generalTensorProduct(arg0,arg1,offset=0)
62472          ref=numarray.array([[[-0.12933519078118558, -0.18156863633549014, -0.15923410000920529, -0.010552565826519441, 0.0094214785562667363], [0.24492389751005048, 0.1098837514538703, 0.076632829527231883, 0.16473185659799994, -0.075215363048902251], [0.26611155694766686, 0.14436653376167824, -0.06822930361416972, -0.13645646488863789, -0.23046752163111595], [0.045629100030271, 0.15337158520884664, -0.19546808560025919, 0.14939925475544943, -0.13437055528247421]], [[-0.42416628543917922, -0.59547052555077273, -0.52222242305595834, -0.034608080147806954, 0.030898578634469227], [0.80324975124432274, 0.36037355651460018, 0.25132419449748333, 0.5402528057880881, -0.24667548684710502], [0.87273656876492178, 0.47346291444392291, -0.22376408228358466, -0.44752113857317755, -0.75583877809429723], [0.14964470033926966, 0.50299578325915772, -0.64105500823238071, 0.4899681714948928, -0.44068021210866076]]])
62473          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62474          self.failUnlessEqual(res.shape,(2, 4, 5),"wrong shape of result.")
62475          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62476       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62477       def test_generalTensorProduct_array_rank2_array_rank3_offset1(self):
62478          arg0=numarray.array([[0.88719262810266786, -0.85937267417991481, 0.73515009090045735], [-0.23577510922465361, 0.6157923906886702, -0.93175714362701467]])
62479          arg1=numarray.array([[[0.11853687352620845, 0.54474769893396746, -0.53408456582157404, -0.52080414425198729, 0.66924101532374536], [-0.7007414023151477, -0.66438231939808712, -0.14904956236780054, -0.22947865919670796, 0.99846052869418722], [0.33888881644046331, -0.00031577792383874481, 0.87596962843829895, 0.71952174391961088, 0.16633546339573657], [0.52175818312352318, -0.46494510236282216, -0.9610286498729097, 0.74410717847739982, 0.23958643790713152]], [[-0.13232126826929247, -0.59982716495887822, -0.78356723297672159, -0.27983244591080836, -0.79720067865560185], [0.49259242892666433, -0.41266595101286963, -0.32380592655236651, 0.31683917808299467, -0.71950642541440679], [-0.10069242888550201, -0.4370528481118563, -0.65981149099369074, -0.91018898826121619, -0.9931329895944192], [-0.56133196761047066, 0.80424266626351737, 0.47938410014283361, 0.1268699672527942, 0.49718987423226135]], [[0.98288504853562686, -0.68950422210454088, 0.97574404646092594, 0.66361095476121168, -0.17518517341335893], [-0.05203293377551188, 0.15818470879819646, -0.70472708899718461, -0.64661206715994402, 0.86275555828532147], [-0.73383007291520341, 0.83314154990625688, -0.43955888677422705, -0.73076003813304724, 0.7599995212761459], [-0.58020266746887739, 0.31973218337920595, 0.85968617253301116, -0.66097830149569581, -0.78009107511971387]]])
62480          res=generalTensorProduct(arg0,arg1,offset=1)
62481          ref=numarray.array([[[0.94144635528991671, 0.49188212591017311, 0.91685870327397678, 0.26628041361424026, 1.1500507781342357], [-1.0832650952626968, -0.11851175109475108, -0.3720458914743241, -0.95123162645031867, 2.1384058085053144], [-0.15228326323567903, 0.98779520514021946, 1.0210360066939999, 0.88332762335627546, 1.5597566671512508], [0.51875732409708197, -0.86858889441017495, -0.63258876177827517, 0.065219561804482629, -0.78819609507446242]], [[-1.0252406397665506, 0.14464353238082384, -1.2657473784597557, -0.66785028455191275, -0.48547044846810294], [0.51703410786218496, -0.24486147104229458, 0.49237945069691097, 0.85169792360410035, -1.4823573766674358], [0.5418442334281578, -1.0453449563992463, -0.20327659746875576, -0.049241885014419506, -1.3589164830863569], [0.071926433245943444, 0.30695625053426601, -0.27923101655810034, 0.51855486336189893, 0.97653265463585537]]])
62482          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62483          self.failUnlessEqual(res.shape,(2, 4, 5),"wrong shape of result.")
62484          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62485       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62486       def test_generalTensorProduct_array_rank3_array_rank4_offset2(self):
62487          arg0=numarray.array([[[-0.72636443734631384, -0.10129037220852277, -0.76103264008177463], [-0.62211664895623797, 0.74055294283976392, 0.22378684113861991]], [[-0.49449308446778195, -0.4800922502304803, -0.8142076213634839], [-0.59421856346920943, 0.25373138063886547, 0.76836625176738882]]])
62488          arg1=numarray.array([[[[-0.28606000983853774, 0.832293463867112, -0.38210008231366821, -0.80872241224790686, -0.39386402809701671], [0.30915525779939879, -0.80432806932912326, 0.71662557187266707, -0.18927788789830635, -0.56917166246185658], [0.91439609030448343, -0.81399455811778654, 0.80159942642177273, -0.015384705908555452, -0.32681502176368071], [-0.70482385685773052, -0.35840875893840796, 0.034817809865170579, 0.95873063151322313, -0.45393884246224037]], [[0.068381781039508871, -0.032444353356714917, 0.88047026038742282, 0.22437347832417087, 0.74799582435792367], [-0.36498208826738421, -0.82439193967280011, -0.57587169823019679, -0.20792327665099952, 0.60649948098650142], [0.72884784989216556, -0.49664028336757737, 0.46297465888271927, -0.48328890206807484, -0.95834051384511065], [-0.18321846831087374, 0.52746329346511023, -0.21258913004052338, 0.1809080486285688, 0.018078632568951702]], [[-0.34336791527801358, 0.48326169169677491, -0.5666636980183799, -0.40668718209236299, -0.14926019819729652], [0.49782511192504875, -0.93537622095049033, -0.30683351992535224, -0.91873643616826173, 0.086549161284091625], [0.68097091087599293, -0.25587578765688312, 0.87844892869387525, -0.63531327186546838, 0.386605125189879], [0.44733965756998928, 0.618511744553087, -0.91401605492061178, 0.40652578475023349, 0.81411805308364493]]], [[[0.67850191422639705, -0.22623127604774629, 0.73517777781004767, -0.2199460295329263, -0.47532216530712423], [-0.39117756210063814, -0.44873732822108625, -0.39516810539570035, -0.29173394873203273, 0.36245659725894019], [0.21962464991068931, -0.98737107742219066, -0.894818366933674, -0.42809625337109503, -0.53142888685762801], [-0.18578339421834866, 0.18355841816478269, 0.271135090145038, 0.97382421304952382, 0.71306276049109618]], [[-0.10029831084213314, 0.52632836745412548, 0.40666636090434349, 0.046623171281902298, 0.67834313251900324], [-0.3268832248099538, -0.70725487874989201, -0.18859846728163676, -0.40278228695924856, 0.25019540844372523], [-0.010096473713268717, -0.82595056670808864, 0.14958822238207259, -0.3532399500190746, -0.62779542812365352], [0.16216320785059857, -0.15616923957404261, 0.014607249734463812, 0.52325164343339559, 0.6357234988098468]], [[0.98409545719298719, -0.83481648471335879, 0.97778669770809423, -0.87561525778350857, -0.75916117663142257], [0.12180598143746568, 0.39015872113454875, -0.058869046220418886, 0.45713098128261231, -0.57234648655361631], [0.11102136377660909, -0.50158013728182493, -0.62414895107162982, -0.016758991639415077, 0.45023237632991209], [0.040805237233795033, 0.19005641883988966, -0.63160760683823813, -0.81837258747001695, -0.70118744722329862]]]])
62489          res=generalTensorProduct(arg0,arg1,offset=2)
62490          ref=numarray.array([[[0.18601566042244522, -0.62534467332599475, 0.68221775223882553, 0.84961038763323604, 0.95208048445738391], [-0.5379090567407564, 1.2223097756787735, -0.1356913582606423, 0.84324460511297528, 0.11783580954184175], [-1.3755151660203135, 0.72664423322593952, -0.76989341925204946, 0.54460403285559389, 0.0066894453864743686], [0.43487822903103707, -0.45111341500763735, 0.39263318149902787, -1.4255691984654943, -0.42141440184002543]], [[0.71571638318121789, -1.1629303980766468, 0.64524683551769635, 0.093048036895923114, -0.17156680338673058], [-0.13988702271998471, 1.9420893851102949, 0.31366122645442046, 1.3638604095421463, -0.67186097308278425], [-1.4042902200484617, 0.84103124297567078, -1.243797810704689, 0.90878543199006789, 0.80935965497641593], [0.25516013461902143, -0.58226328124053195, 0.18633091000231633, -1.9666435521494512, -1.2482518152866606]]])
62491          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62492          self.failUnlessEqual(res.shape,(2, 4, 5),"wrong shape of result.")
62493          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62494       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62495       def test_generalTensorProduct_array_rank1_array_rank3_offset0(self):
62496          arg0=numarray.array([-0.10853748989477352, 0.27834309849207006])
62497          arg1=numarray.array([[[-0.36996470997559849, 0.62604099130254198], [-0.72837431218177939, 0.15795724318798321]], [[-0.81627257263074759, -0.75179644840510051], [0.19004534005575913, -0.7187506521753273]], [[-0.5509004522495915, 0.22283216225380054], [-0.77273613271687114, -0.16415059713725833]], [[-0.50917795307069347, 0.20972370103547666], [-0.70561560257966605, -0.8506773758558186]], [[-0.74448550124953772, -0.054835132199751779], [-0.33766244205511864, 0.50694644628308283]], [[0.26345238610895128, -0.33914884332376483], [0.66325736581644645, 0.93041865540431035]]])
62498          res=generalTensorProduct(arg0,arg1,offset=0)
62499          ref=numarray.array([[[[0.04015504097039934, -0.067948917767213651], [0.079055919548042489, -0.01714428268632201]], [[0.088596176103290555, 0.081598099421695214], [-0.020627044175850755, 0.078011391647341458]], [[0.059793352269066201, -0.024185643558852409], [0.083870840196083776, 0.017816493778006214]], [[0.055264896936051855, -0.022762884081832552], [0.076585746334585036, 0.092330387085663365]], [[0.080804587568677103, 0.0059516676070091286], [0.03664903389240199, -0.055022694790641452]], [[-0.02859446069505427, 0.036810364155077255], [-0.071988289639936656, -0.1009853054088541]]], [[[-0.10297712370732814, 0.17425418930219663], [-0.2027379629147068, 0.043966308498208671]], [[-0.22720383708013558, -0.20925735288440936], [0.05289780880509911, -0.20005928356967673]], [[-0.153339338839834, 0.062023794485410538], [-0.21508576949719338, -0.045690185826508009]], [[-0.14172616914154665, 0.058375144773439136], [-0.19640323316637334, -0.23678017661281181]], [[-0.20722240120021823, -0.015262980602701192], [-0.093986010366020792, 0.14110504462797702]], [[0.073330153454694694, -0.094399739900738314], [0.1846131102990381, 0.25897561144006137]]]])
62500          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62501          self.failUnlessEqual(res.shape,(2, 6, 2, 2),"wrong shape of result.")
62502          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62503       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62504       def test_generalTensorProduct_array_rank2_array_rank4_offset1(self):
62505          arg0=numarray.array([[0.0078035188859546523, -0.85228540660692742, -0.67849544792883698], [0.15092314754829839, 0.49233214806070325, 0.093137282528565013]])
62506          arg1=numarray.array([[[[0.12017388805777252, -0.9430103459798842], [-0.11371451892203477, 0.33651740736939484]], [[-0.31085031016254461, 0.45867044866512363], [-0.27603052372300985, -0.45076616037594608]], [[-0.53981957899116306, -0.070306842819090054], [-0.93860389517573894, 0.93558901853748089]], [[0.74802844573897365, 0.21899443386586781], [0.10732264201234232, -0.88588929307979591]], [[-0.88513743469563178, 0.84934293267765337], [-0.45868453965338651, -0.46782169518892003]], [[-0.28151973413459364, 0.83937657538757215], [0.8744249127243684, 0.41248182962656021]]], [[[-0.78059611961578512, -0.27495714631707369], [-0.28073381516961171, 0.63439512465272574]], [[-0.70273359478204123, -0.20009279507917022], [0.79041542048899904, 0.40387131731046799]], [[0.35335763910871743, -0.60224707362059449], [0.3215895116059011, -0.2773709016734498]], [[0.8915661743100054, 0.30571625591704499], [-0.26765471155147158, 0.88603898280079973]], [[0.28706896949318694, 0.54508954862981263], [0.11544939039138713, 0.93434253933909317]], [[0.92040563974618106, -0.59609466028016689], [0.87108811986402657, -0.23697208153249405]]], [[[-0.19400020083227232, 0.62402764134768107], [0.97615688977960691, -0.75384608289350585]], [[0.43789672240272903, 0.067928551485255895], [-0.66393561207634377, -0.66258699148069744]], [[0.76171005082854171, -0.27870818368788752], [-0.48965968030894991, -0.17532778704823038]], [[-0.91655276916487183, 0.36645953003278242], [-0.86949795886079762, 0.45242880832025656]], [[-0.60608808008351045, -0.65272896582654027], [0.96491445117502761, 0.082306837257531962]], [[0.074935959463451995, 0.8831193228565084], [0.77611002584106381, -0.85829091056151174]]]])
62507          res=generalTensorProduct(arg0,arg1,offset=1)
62508          ref=numarray.array([[[[0.79785671356956356, -0.19641674983234755], [-0.42394004576570354, -0.026578551138012774]], [[0.29939292848589227, 0.12802619975460902], [-0.22533624693317911, 0.10183106544004572]], [[-0.8221908535339113, 0.70183998517555579], [0.050821403241918972, 0.36265916369699608]], [[-0.13215470362029469, -0.50748969925739873], [0.81890610599920599, -1.0690420355125436]], [[0.15965612330354495, -0.015070371930739235], [-0.75666524686313408, -0.85582198089708916]], [[-0.83748884685860336, -0.084599569664572716], [-1.2621792207330758, 0.78753313242569789]]], [[[-0.3842441944150069, -0.21957209331898697], [-0.064459835337776841, 0.29291020515899158]], [[-0.35210833670680258, -0.022961447121428859], [0.28565036768724084, 0.069096233634080129]], [[0.1634416597353755, -0.33307464827850231], [-0.028933771106071385, -0.01168612597854285]], [[0.46647626300884848, 0.2176963150112573], [-0.19656022519343067, 0.34466226492148422]], [[-0.048703842016871397, 0.33575721500520422], [0.077482841762442745, 0.39706758184370278]], [[0.41763677295896673, -0.08454387592812411], [0.63312042407583446, -0.13435480092625432]]]])
62509          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62510          self.failUnlessEqual(res.shape,(2, 6, 2, 2),"wrong shape of result.")
62511          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62512       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62513       def test_generalTensorProduct_array_rank1_Symbol_rank0_offset0(self):
62514          arg0=numarray.array([-0.36050666921258179, -0.043413969575951894])
62515          arg1=Symbol(shape=())
62516          res=generalTensorProduct(arg0,arg1,offset=0)
62517          s1=numarray.array(-0.0160703058462)
62518          sub=res.substitute({arg1:s1})
62519          ref=numarray.array([0.0057934524338569549, 0.00069767576908508482])
62520          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62521          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62522          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62523       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62524       def test_generalTensorProduct_array_rank2_Symbol_rank1_offset1(self):
62525          arg0=numarray.array([[0.77607716220803979, -0.99594136800213739, -0.96448610306306004], [0.48337776457661419, -0.90884666590234664, 0.90716223281288966]])
62526          arg1=Symbol(shape=(3,))
62527          res=generalTensorProduct(arg0,arg1,offset=1)
62528          s1=numarray.array([-0.28627301517467196, 0.95051276753062108, -0.26521491840056299])
62529          sub=res.substitute({arg1:s1})
62530          ref=numarray.array([-0.91302883210909636, -1.2428413273531005])
62531          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62532          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62533          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62534       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62535       def test_generalTensorProduct_array_rank3_Symbol_rank2_offset2(self):
62536          arg0=numarray.array([[[-0.3881169801829274, 0.05361978882711238, 0.5448622547455988], [0.34926995995569254, 0.086923411592937372, -0.19794789502097365]], [[0.44952854021527178, 0.77905611042987455, 0.79819507062100992], [0.70478139709467924, -0.44768631083572896, 0.5091822530048038]]])
62537          arg1=Symbol(shape=(2, 3))
62538          res=generalTensorProduct(arg0,arg1,offset=2)
62539          s1=numarray.array([[0.08210650131697439, 0.85672069216400626, 0.1044751096001153], [0.33964493465944301, 0.97118542067270508, 0.24346151848231123]])
62540          sub=res.substitute({arg1:s1})
62541          ref=numarray.array([0.22584862671430195, 0.71628952127448364])
62542          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62543          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62544          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62545       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62546       def test_generalTensorProduct_array_rank4_Symbol_rank3_offset3(self):
62547          arg0=numarray.array([[[[0.73192744062979243, -0.86582803721633539, -0.87971118172580276], [0.54750427933408163, -0.54141522183025526, -0.84534683573538461], [0.03819877816900874, 0.77759426741854232, 0.83410456877607375], [0.70712858470186957, -0.69734276344252133, 0.66822470002225121]], [[0.71328917527041313, 0.64023236437544351, -0.14705496155296638], [0.90935149665240966, -0.45890279060498673, 0.86259228397823429], [0.11140118901071294, 0.7028227149084274, -0.26309487192456693], [0.84744107056898921, -0.59558372704546914, 0.59828814507495576]]], [[[0.23023526314517118, 0.67616478193830432, -0.11411485977424118], [-0.88110485368181979, -0.17740215780947932, 0.32358390013819904], [0.2881550640356163, -0.67419791717423561, 0.69520283987235088], [0.48861990708641101, 0.41270780164177623, 0.051761663475380137]], [[0.50873730837208297, -0.36858725740218801, -0.70655675098741777], [0.81852223427954285, -0.31038441654285576, 0.33325073548517214], [0.73395871732042783, -0.58514627141120101, 0.12206787241674699], [-0.84356956318849985, -0.67320547235325523, -0.41902422734050537]]]])
62548          arg1=Symbol(shape=(2, 4, 3))
62549          res=generalTensorProduct(arg0,arg1,offset=3)
62550          s1=numarray.array([[[-0.33524944467286422, 0.9420911586348315, 0.6105407835372203], [-0.60096237501766936, -0.67245625834347367, -0.11149464195140535], [-0.013777203995165133, -0.27260636597032439, -0.84347872128715706], [-0.60576434452169958, 0.74700267642542539, 0.13311803236228914]], [[0.80285236710981978, 0.69086199290892214, 0.93976213654597962], [0.60002393599705561, 0.97726566807739612, 0.18819884215916871], [0.30122524991759403, -0.10033862900821822, -0.086243008718718261], [-0.14417860339664124, 0.50737153763203358, -0.74136467010984619]]])
62551          sub=res.substitute({arg1:s1})
62552          ref=numarray.array([-2.9911419496760034, 0.81581298487748888])
62553          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62554          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62555          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62556       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62557       def test_generalTensorProduct_array_rank1_Symbol_rank1_offset0(self):
62558          arg0=numarray.array([0.15159051577085525, 0.075625057793151873])
62559          arg1=Symbol(shape=(2,))
62560          res=generalTensorProduct(arg0,arg1,offset=0)
62561          s1=numarray.array([-0.52448466453461906, 0.63688849231133648])
62562          sub=res.substitute({arg1:s1})
62563          ref=numarray.array([[-0.079506900810706896, 0.09654625503799788], [-0.039664183067052439, 0.048164729038838186]])
62564          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62565          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62566          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62567       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62568       def test_generalTensorProduct_array_rank2_Symbol_rank2_offset1(self):
62569          arg0=numarray.array([[0.24388178473861255, 0.15637170047183457, 0.28365657045737191], [-0.44590736256655195, 0.81338818922856326, 0.53028641533895837]])
62570          arg1=Symbol(shape=(3, 2))
62571          res=generalTensorProduct(arg0,arg1,offset=1)
62572          s1=numarray.array([[-0.025834489874195121, 0.03199833701523791], [0.36562987923660306, -0.053737830634191575], [0.93443335628854807, 0.13250150309657216]])
62573          sub=res.substitute({arg1:s1})
62574          ref=numarray.array([[0.31593176562698988, 0.036985657532828349], [0.80443612952257926, 0.012285736286508434]])
62575          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62576          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62577          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62578       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62579       def test_generalTensorProduct_array_rank3_Symbol_rank3_offset2(self):
62580          arg0=numarray.array([[[0.064078202130272155, -0.99302284160511323, -0.27372380942215546], [0.88391054150784543, 0.6304471642230598, 0.76637926003644274]], [[-0.58153743482590503, 0.79113273313454791, -0.097764019201349805], [0.17489461126850347, 0.11879015893611888, 0.87219750072608382]]])
62581          arg1=Symbol(shape=(2, 3, 2))
62582          res=generalTensorProduct(arg0,arg1,offset=2)
62583          s1=numarray.array([[[0.11028483760072705, 0.033713991610237803], [-0.5807297681894219, 0.039799623183904398], [0.76478362448577597, 0.7244965571945956]], [[-0.77969163746748671, 0.96720764292030714], [0.60814465453198974, 0.14620100114769374], [0.077439052024411925, 0.31696227584510517]]])
62584          sub=res.substitute({arg1:s1})
62585          ref=numarray.array([[0.12797839044236509, 0.95433679191757426], [-0.59491752926979713, 0.40403149084354251]])
62586          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62587          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62588          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62589       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62590       def test_generalTensorProduct_array_rank4_Symbol_rank4_offset3(self):
62591          arg0=numarray.array([[[[-0.42005963492323728, -0.9007456008462682, 0.42161579826074091], [-0.82153892788275407, -0.99529965765589079, 0.033330297420224975], [-0.70096343357085544, -0.068516846758202465, 0.03814510132717186], [0.57049015225187749, 0.61951324369546579, -0.70620466120093894]], [[-0.61257454090493391, 0.5277635448974618, 0.16861908846682683], [-0.15447992986624715, 0.57248646084057819, -0.35360619315136876], [-0.46138000821736824, 0.059921678117514698, -0.79538111200767792], [-0.30128545557052977, -0.11021891016544005, -0.90286877390620757]]], [[[-0.15266779302281108, -0.2142191675670313, 0.33761558983992179], [-0.19601232400027091, 0.85132449076736672, 0.27141423309734325], [0.93096214681939427, 0.59419093255579214, -0.19557355195982074], [-0.057223657932959471, -0.25453747255791881, 0.011678231838159192]], [[-0.93388060767728787, -0.63049353969801381, 0.70285275093593014], [-0.0031868118712472526, 0.60326713359319473, 0.69346584651570042], [-0.76049149745121891, -0.1715451297949131, -0.35328050048268778], [-0.32079283214381094, -0.7278874369059487, -0.97894250777367731]]]])
62592          arg1=Symbol(shape=(2, 4, 3, 2))
62593          res=generalTensorProduct(arg0,arg1,offset=3)
62594          s1=numarray.array([[[[0.35008581452873577, -0.99912196201850034], [0.035547935028381161, -0.20229740970315091], [0.83089724304795087, -0.69746689768166248]], [[-0.78770064942450602, 0.40829784339208963], [0.22674182795919062, -0.44595084634020443], [0.34973059288337049, -0.0008103521557407678]], [[0.30535869540823768, -0.059065103260578677], [-0.41340990729768379, 0.92801324162197529], [-0.95652041369480356, 0.1687591036083631]], [[0.32777445698133412, 0.24086392624204223], [0.69758789069007854, 0.83624319705158601], [-0.50691337111318258, -0.37290605901159135]]], [[[-0.65786437350857496, -0.33383309265474481], [0.16865005904383712, -0.59177263076880648], [-0.77833745021222844, 0.68050282738571766]], [[-0.87009262656589281, 0.086514350285726183], [0.038310262639874137, -0.65069560929077985], [0.48054633727017326, -0.33187776032745586]], [[-0.7334501645319651, 0.84760510285286106], [0.96084381792898288, 0.9922390556084808], [-0.31487263145060984, 0.51810826129150178]], [[-0.037218407224753447, -0.368304876329693], [0.23953018615666011, 0.89096534999027099], [0.44204289964372467, 0.88797831940553906]]]])
62595          sub=res.substitute({arg1:s1})
62596          ref=numarray.array([[1.9385852650867614, -0.47494800748598132], [0.9144289552774485, -2.1243775217119816]])
62597          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62598          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62599          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62600       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62601       def test_generalTensorProduct_array_rank1_Symbol_rank2_offset0(self):
62602          arg0=numarray.array([0.30166435952651804, -0.42256409011527007])
62603          arg1=Symbol(shape=(4, 5))
62604          res=generalTensorProduct(arg0,arg1,offset=0)
62605          s1=numarray.array([[-0.44001636458534943, -0.45114879804009633, 0.83878606589502214, -0.96143602668854244, 0.080872377350810654], [-0.60785779746210467, -0.0449823181821567, -0.65273232868951747, 0.11409184313954901, 0.46297658093504457], [-0.91978923691294723, 0.69979192135998303, -0.18078194954433657, 0.7728287080922327, -0.12621337066155514], [0.68833504194966277, -0.42015248011705331, -0.65923303968353553, 0.62907069422793915, -0.26119502968350017]])
62606          sub=res.substitute({arg1:s1})
62607          ref=numarray.array([[[-0.13273725480382628, -0.13609551321192409, 0.25303186134798961, -0.29003098321671944, 0.024396313916919179], [-0.18336903315460573, -0.013569562204438348, -0.19690607987637596, 0.034417442787892015, 0.13966353376354737], [-0.27746763105272898, 0.21110228175889076, -0.054535471023247593, 0.23313487725034976, -0.038074075624301054], [0.20764614956940394, -0.12674502881798899, -0.19886711269485341, 0.18976820807117334, -0.078793231340982942]], [[0.18593511473683713, 0.19063928135041106, -0.35444087073629699, 0.40626833982168448, -0.034173762550704083], [0.25685887710404637, 0.019007912353918615, 0.27582124256150736, -0.048211115885837645, -0.19563727766749581], [0.38866990199393814, -0.29570693651949786, 0.07639196001846725, -0.32656965984995395, 0.053333238133981366], [-0.29086567069591551, 0.17754135047033673, 0.27856820958779693, -0.26582268552461041, 0.1103716400608392]]])
62608          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62609          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
62610          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62611       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62612       def test_generalTensorProduct_array_rank2_Symbol_rank3_offset1(self):
62613          arg0=numarray.array([[-0.72102873213880825, 0.94977404572871227, -0.67687789450781666], [-0.83767281947448824, -0.82821901004659848, 0.63145092311017903]])
62614          arg1=Symbol(shape=(3, 4, 5))
62615          res=generalTensorProduct(arg0,arg1,offset=1)
62616          s1=numarray.array([[[-0.30242828441914971, -0.32731094472714828, 0.98230310556817613, 0.2099787488995295, 0.079260668211424967], [-0.73794718476139143, -0.56383105576665415, 0.5211608863377406, 0.69849852241861177, 0.0146651968512308], [-0.56597199228220973, -0.48209278883088835, 0.51977413303718878, 0.23992364478232209, 0.61386672439545009], [0.15413549975179341, -0.15994699336384466, -0.70852529564663747, 0.13051758868830832, -0.23782729861494278]], [[0.20431148139689781, 0.048439944501679655, 0.73968742238549323, -0.85772080352828795, -0.6978192142942401], [-0.46523221253903557, -0.018207225874345978, -0.46203628667833585, -0.86997191695419418, 0.26329401159807309], [0.44290712696677104, 0.18933118629564594, 0.04453242243154576, -0.11422298677516807, -0.90314201705479968], [0.81473704734540653, 0.42679708784266923, 0.28909998892473787, 0.80187777330096743, -0.74087324922573727]], [[-0.94013674165037964, 0.81266229817903479, -0.75582956331525075, 0.73115116639598488, -0.80417022948133599], [-0.42514416334057681, -0.039815698039989522, -0.11707779993120626, -0.093488413307347695, 0.12326762912522526], [0.25063378986803819, -0.55644921068977293, 0.30347580434817867, 0.83841022432806778, 0.29308278247394992], [0.86666009452253667, -0.59470758069476748, -0.17322072295475199, -0.75830562515565236, -0.40599179224561865]]])
62617          sub=res.substitute({arg1:s1})
62618          ref=numarray.array([[[1.0484670029905607, -0.2680655477813027, 0.50587147637346619, -1.4609417308449135, -0.17559474569923572], [0.37798632845164598, 0.41619600655740935, -0.73535467167735058, -1.2666340108959169, 0.15605865705618246], [0.65909528990423538, 0.90407276922685975, -0.53789240860470455, -0.84897921704919677, -1.4987776501162411], [0.076056917664334978, 0.92323158972862351, 0.90269603994827785, 1.1807760803830374, -0.25737499817830578]], [[-0.50952891253039923, 0.74721695739454641, -1.9127410722012519, 0.99617326312800591, 0.003758597696460364], [0.73501478699689271, 0.46224386149904867, -0.12782395794228985, 0.076380708271951023, -0.15251228423074592], [0.26553819025440512, -0.10434202977042631, -0.28065318553513996, 0.4230390431450628, 0.41884731103158451], [-0.25664251274988459, -0.59502686349659983, 0.24469389002999442, -1.2522942390934229, 0.55646288083387518]]])
62619          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62620          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
62621          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62622       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62623       def test_generalTensorProduct_array_rank3_Symbol_rank4_offset2(self):
62624          arg0=numarray.array([[[-0.38858753557231474, 0.41498100943681382, -0.28971306152118714], [0.9787844616733623, 0.51900814617439495, 0.91051187071162687]], [[-0.049561078656026769, 0.27607458696591514, -0.38660575841083222], [0.39018619328681381, -0.62427006323061884, 0.31134669138106541]]])
62625          arg1=Symbol(shape=(2, 3, 4, 5))
62626          res=generalTensorProduct(arg0,arg1,offset=2)
62627          s1=numarray.array([[[[0.5093026400610714, -0.83214475895564122, 0.72602261260621259, 0.0054702335931500201, -0.51078198879764458], [-0.11668222722560895, 0.8757201690267693, 0.4957001740409257, 0.35735016661497943, 0.91560902101890518], [0.60856031560715151, 0.41503063459296663, 0.83332473258952833, 0.34886257004723253, 0.53302865479772699], [0.60882330356442615, 0.82868421868866715, 0.57078708604696993, 0.96369095024404983, 0.95720655954869716]], [[0.33019589049297515, -0.22293452449359519, -0.21493054665900169, 0.83560129017168649, 0.34767319542466057], [-0.27535207288636587, 0.4575561291751451, 0.66715681084182932, 0.57676892927807755, -0.082949513506240136], [-0.9678866432382367, 0.27897822693992858, -0.60128585356123243, -0.40282913167735868, 0.42683488272026437], [0.13938862766976667, 0.048824101751917759, 0.6966877198824315, -0.1012728111974599, 0.27536194584482399]], [[-0.90144686591292023, 0.60159495203114055, -0.5878188709089196, 0.87071777587505461, 0.85200313559265584], [0.87004526660512926, -0.36037145392379677, 0.51697490269672741, -0.92764663657328139, -0.16602639357305971], [0.12584549195682371, 0.37100517807161149, 0.86000160490410038, 0.72939843339536536, 0.087172647105981493], [0.24966508692146405, 0.81572792334432354, -0.53729230054451649, 0.98069086437275232, -0.75057802227508996]]], [[[0.4449251606438811, 0.92801169290252239, 0.22441865267098415, 0.86831696841660322, 0.85164460704295775], [-0.35948280925940046, -0.27171710741652544, 0.35988923108486248, -0.39836450417754898, 0.17567380775652719], [0.66261189939895382, 0.88252937703079937, -0.61535552514634739, 0.89658059782272925, 0.74777293915723053], [0.97356214743608183, -0.01408805257582002, -0.48263748142297502, -0.26423156710700169, -0.34626573623508849]], [[0.34223014823132991, -0.14088365767318223, -0.57861449457363645, -0.062250758877663959, -0.60163476302236618], [-0.46120030883029939, 0.89297621972730146, -0.46801484476799304, 0.62850380002260997, 0.93279525472409142], [-0.77614425968051437, -0.8380614554616892, -0.38984415011304674, -0.56233143365452354, -0.39181869970672834], [-0.87445987980262618, 0.54507182675009536, 0.52673282805588229, -0.91977010355816158, 0.2780210197678612]], [[-0.95925250991700795, 0.21180646452213847, 0.098900275263658521, -0.45498961978932129, 0.42722867963499356], [0.57971212220907309, -0.56103724327052551, 0.71849040687742782, -0.95431879543308606, 0.023758851957984772], [0.66152055670947507, 0.42687477863293255, 0.79046388523025923, -0.65568659176245947, 0.85552209907897669], [0.17686333502159002, 0.73751345595140827, -0.061927734152607439, -0.55136192300135312, -0.46832747975195099]]]])
62628          sub=res.substitute({arg1:s1})
62629          ref=numarray.array([[[-0.060027431135903697, 1.0846135312705116, -0.1916148996928882, 0.49568774538320098, 1.0062448005222213], [-0.38437623626047657, -0.35933414101365713, 0.69800463081119912, -0.5633953073491329, 0.33559113491467518], [0.17345874520087096, 0.66452976084490478, -0.90740147770345858, -0.52535220164592311, 1.252259488266048], [0.40902311689069354, 0.40253999051187572, -0.032433352413654679, -1.9386390420246029, -0.66127838088184743]], [[0.075721178436954695, 0.26310740400083577, 0.61150387507316939, 0.12979972919038876, 0.63280809642116254], [-0.078459554636866546, -0.61591601192842182, 0.61604320813119906, -0.34476232020774084, -0.51046548197659614], [0.60300547454079823, 0.91345020044751246, -0.29040867129776926, 0.086243673208763666, 0.8604546774813413], [0.89262120477695739, -0.4591031154761287, -0.16465376443953192, -0.15544042698454189, -0.13572248895520536]]])
62630          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62631          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
62632          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62633       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62634       def test_generalTensorProduct_array_rank1_Symbol_rank3_offset0(self):
62635          arg0=numarray.array([0.83364130451665663, 0.963725923030196])
62636          arg1=Symbol(shape=(6, 2, 2))
62637          res=generalTensorProduct(arg0,arg1,offset=0)
62638          s1=numarray.array([[[0.80026845987009221, 0.42364160174969911], [0.73868037337609604, 0.44974360417778114]], [[0.40079978346080924, 0.87674787535778975], [0.50244342561615629, -0.82575784976592814]], [[0.60888183969789633, 0.03516322857888543], [-0.93083076979954282, 0.10404849571961039]], [[0.8104568529629459, 0.35857154150021997], [0.92959490362311437, -0.38578554223487194]], [[-0.20558665649670216, -0.59952475995708476], [0.021872595587329569, 0.41104326833419202]], [[-0.78164593952859396, 0.657208000754677], [-0.73705175754089369, 0.29616193109480116]]])
62639          sub=res.substitute({arg1:s1})
62640          ref=numarray.array([[[[0.66713684284963937, 0.35316513753014511], [0.61579447008209975, 0.37492484488478833]], [[0.33412325433426254, 0.73089324254547494], [0.41885759277647028, -0.68838585109373773]], [[0.50758905114225605, 0.029313519743519433], [-0.77597897721993458, 0.086739123704691765]], [[0.67563030815849434, 0.29892004761879187], [0.77494870812840877, -0.32160676269234439]], [[-0.17138552851312858, -0.49978860298065958], [0.01823389911858669, 0.34266264642690597]], [[-0.65161234069876472, 0.54787573508791276], [-0.61443678865268514, 0.2468928185860422]]], [[[0.77123946016025802, 0.40827439368021945], [0.711885424656168, 0.43342957006315924]], [[0.38626114126607108, 0.84494465544394914], [0.48421775412238383, -0.79580424596509902]], [[0.58679521297917903, 0.033887714918908129], [-0.89706574280997231, 0.10027423257728492]], [[0.78105827869786282, 0.34556468980465971], [0.89587470653835199, -0.37179152778200664]], [[-0.19812919029497614, -0.57777755266909825], [0.021079187371465382, 0.39613305318071773]], [[-0.75329245455499894, 0.63336838715013088], [-0.71031588535712598, 0.28541893041074257]]]])
62641          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62642          self.failUnlessEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")
62643          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62644       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62645       def test_generalTensorProduct_array_rank2_Symbol_rank4_offset1(self):
62646          arg0=numarray.array([[0.28720169174230659, -0.93521276442752277, 0.88082216045026929], [0.33901224963528165, -0.49844209506510206, -0.91178566313768172]])
62647          arg1=Symbol(shape=(3, 6, 2, 2))
62648          res=generalTensorProduct(arg0,arg1,offset=1)
62649          s1=numarray.array([[[[0.71283865530646917, -0.71196744874915696], [0.30936239533682164, -0.48528034473690318]], [[-0.15527099542639733, -0.39895485720947743], [-0.87979516759253662, 0.62245267992799747]], [[-0.88392085517525953, 0.98407704137207563], [0.76027079156666466, 0.46926045919458592]], [[0.46267468790228983, -0.51568254290028093], [-0.44394427261432545, -0.5697436674189178]], [[0.6796410432395259, -0.38156579747976704], [0.64175885624325901, -0.38747409705115454]], [[-0.94435722714768211, -0.70483900723929138], [-0.83797272239303044, 0.40261485937696873]]], [[[0.50966656923326958, -0.87946250684245042], [0.65664230470156992, -0.94134852855904239]], [[0.51895559036463679, -0.39295571122290918], [0.58843026835848122, -0.87504078048566281]], [[-0.88437840902483944, 0.29365081372475133], [0.87602633419759868, 0.27011782255698757]], [[0.43493738268831672, -0.48255156582155601], [-0.8326643880899236, 0.5627250633868377]], [[-0.90625166644605049, -0.10112991622069156], [0.95548741487591227, 0.60182092154792688]], [[-0.25750968238999228, 0.44986815625440779], [-0.75405344436311306, -0.9972281100513023]]], [[[0.61568498578700326, -0.55714924228816454], [-0.51680087305650213, -0.077256854833225308]], [[0.05225680469667382, -0.1473735475908271], [-0.50239665841132441, -0.99432767517895471]], [[-0.95178342765468682, 0.67755828150951647], [-0.31114011765833505, -0.53693508330475992]], [[0.91646286340001004, 0.53999707062028834], [-0.4932416156325341, 0.22436087363827695]], [[-0.27868042491433109, 0.68859451750762424], [-0.83756810925850078, 0.66212781428026579]], [[-0.24684636851711961, -0.90450588164648082], [0.43194244918219526, -0.045729895234336126]]]])
62650          sub=res.substitute({arg1:s1})
62651          ref=numarray.array([[[[0.27039076593209288, 0.12725690720278376], [-0.98046052324604105, 0.67293827392196026]], [[-0.48389903323385025, 0.123106800488815], [-1.2455082685285057, 0.12129291896304673]], [[-0.26513352329607021, 0.60481095115709183], [-0.87497906283460214, -0.5907895579042507]], [[0.53336276038750619, 0.77882487150845092], [0.21675867258635712, -0.49227697784625968]], [[0.79726428969171792, 0.59152095655316161], [-1.4470183489594575, -0.090896972042011859]], [[-0.24782240292764257, -1.4198622221355186], [0.84499770400257956, 1.0079722211820961]]], [[[-0.57375097944055553, 0.70499613932058491], [0.2487911022818233, 0.3751334440044215]], [[-0.35895508649352198, 0.19498817214329156], [-0.13348168439639235, 1.5537899618957689]], [[1.0089739131597604, -0.43054168222114009], [0.10478580853920033, 0.51401666153963044]], [[-0.89555641310047629, -0.42666027264915019], [0.71426306911057313, -0.67820496989974677]], [[0.93621743432671511, -0.70679868085135755], [0.50499155862254086, -1.0350499945325065]], [[0.033275977366854836, 0.36153321132755756], [-0.30206997161695848, 0.67524770049721794]]]])
62652          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62653          self.failUnlessEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")
62654          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62655       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62656       def test_generalTensorProduct_array_rank1_constData_rank0_offset0(self):
62657          arg0=numarray.array([0.6160768652045161, -0.19852491943844375])
62658          arg1=Data(-0.127743684549,self.functionspace)
62659          res=generalTensorProduct(arg0,arg1,offset=0)
62660          ref=Data(numarray.array([-0.07869992872685018, 0.025360304683933566]),self.functionspace)
62661          self.failUnless(isinstance(res,Data),"wrong type of result.")
62662          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62663          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62664       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62665       def test_generalTensorProduct_array_rank2_constData_rank1_offset1(self):
62666          arg0=numarray.array([[-0.147330786554285, 0.75868746628337624, 0.91276304020295584], [0.86195142670321001, 0.82026307789735986, 0.51850854945729585]])
62667          arg1=Data(numarray.array([-0.032130921017267999, 0.97480750910482583, -0.41846172877515819]),self.functionspace)
62668          res=generalTensorProduct(arg0,arg1,offset=1)
62669          ref=Data(numarray.array([0.36235171329753918, 0.5549273305730611]),self.functionspace)
62670          self.failUnless(isinstance(res,Data),"wrong type of result.")
62671          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62672          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62673       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62674       def test_generalTensorProduct_array_rank3_constData_rank2_offset2(self):
62675          arg0=numarray.array([[[0.41445549411660632, 0.85461494166670349, -0.13442155510723586], [0.29381113957059513, 0.16370379553713321, 0.42037146043234652]], [[-0.76794214531167104, -0.67630130103778274, -0.46769123983501437], [-0.54173391783502134, 0.19605430787210909, -0.11215751913455962]]])
62676          arg1=Data(numarray.array([[-0.8421427135254449, -0.074943382571228456, 0.064562133179139058], [-0.01557261982862479, -0.95681115206026246, 0.64051923923966125]]),self.functionspace)
62677          res=generalTensorProduct(arg0,arg1,offset=2)
62678          ref=Data(numarray.array([-0.31370996966656212, 0.41621626444562154]),self.functionspace)
62679          self.failUnless(isinstance(res,Data),"wrong type of result.")
62680          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62681          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62682       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62683       def test_generalTensorProduct_array_rank4_constData_rank3_offset3(self):
62684          arg0=numarray.array([[[[0.99014107012803954, -0.84433100281306572, 0.52711335788699665], [0.045174970230898559, 0.42611183240792605, -0.47386295037597748], [0.62582408751937213, 0.90583999658225278, -0.92957102946391279], [-0.077735568516046127, -0.34188079263751137, -0.63762529526013512]], [[-0.24322222962612727, 0.16977736844854263, 0.55291098572193609], [-0.050506688321715121, 0.69037545585606375, -0.66099820277843402], [0.39252617737587658, 0.91012561537413394, 0.69641569683067561], [0.48756748434610886, 0.95727033843800546, -0.7590650638915768]]], [[[0.67960698951135723, 0.72963782147672562, -0.70754055734883936], [-0.16884852328678845, -0.74754495889362649, 0.88515452018232721], [-0.94920582773254036, -0.86753587238679786, 0.59840113807493611], [0.03481374302774598, -0.69285626872864192, -0.77389449106759378]], [[0.99162870066230369, 0.21744497416558239, -0.44466958710758808], [-0.72367316239216128, -0.19902897453533974, -0.92522545867758654], [0.30049803366336114, -0.97857344723928374, -0.30348033456497725], [-0.96210274523717443, -0.72175198401328156, 0.16233315282366068]]]])
62685          arg1=Data(numarray.array([[[-0.91067767844918945, -0.073546224498269641, 0.53337941986359061], [0.80413856236434755, -0.69499103854316235, -0.26040422737842195], [-0.076930636508680594, 0.45850375655261599, -0.060929787719397943], [0.5602655996825654, 0.17405201648963153, -0.80714244287081116]], [[-0.00354290311008576, 0.85390352597560293, 0.22067964179500366], [-0.47389997299794695, -0.55369425756313517, -0.14428104384186424], [-0.078158777817060265, 0.30111518171214335, -0.76508624529509728], [-0.54351815184111962, -0.49587993442095768, -0.98713975234704066]]]),self.functionspace)
62686          res=generalTensorProduct(arg0,arg1,offset=3)
62687          ref=Data(numarray.array([-0.13438557714464205, 0.57095048620887479]),self.functionspace)
62688          self.failUnless(isinstance(res,Data),"wrong type of result.")
62689          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62690          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62691       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62692       def test_generalTensorProduct_array_rank1_constData_rank1_offset0(self):
62693          arg0=numarray.array([0.77222220157677213, 0.20023484376496881])
62694          arg1=Data(numarray.array([-0.87513477210940049, 0.78642316309113269]),self.functionspace)
62695          res=generalTensorProduct(arg0,arg1,offset=0)
62696          ref=Data(numarray.array([[-0.67579850039470801, 0.60729342637320338], [-0.1752324743666174, 0.15746931919470553]]),self.functionspace)
62697          self.failUnless(isinstance(res,Data),"wrong type of result.")
62698          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62699          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62700       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62701       def test_generalTensorProduct_array_rank2_constData_rank2_offset1(self):
62702          arg0=numarray.array([[-0.71122442013988474, -0.88620202081667698, 0.81296611964484011], [0.26644445696728636, -0.39083505585295297, 0.66205348878542747]])
62703          arg1=Data(numarray.array([[0.50771144562442871, 0.78794870667652761], [0.044324453513875151, 0.67905968686319507], [0.15625523908072414, 0.72252988978874555]]),self.functionspace)
62704          res=generalTensorProduct(arg0,arg1,offset=1)
62705          ref=Data(numarray.array([[-0.27334698339857488, -0.57480010793031822], [0.22140267633512434, 0.4228976689122268]]),self.functionspace)
62706          self.failUnless(isinstance(res,Data),"wrong type of result.")
62707          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62708          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62709       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62710       def test_generalTensorProduct_array_rank3_constData_rank3_offset2(self):
62711          arg0=numarray.array([[[-0.84838371111624244, 0.87084047489380612, -0.039771170324408578], [0.95565879050893998, 0.12320313337691635, 0.4760987180097318]], [[0.083224667627625593, 0.82146025505728515, -0.49835088106441283], [-0.080333264765126922, 0.37007844604262052, 0.9110665793821211]]])
62712          arg1=Data(numarray.array([[[-0.81787882248186472, 0.42738693357056556], [-0.42740870470139281, -0.073350120156100429], [-0.29451942498412698, 0.81913003167457621]], [[0.88607980420204102, 0.30665199762429629], [0.031080851224067008, -0.27428531225958275], [-0.10742756266296083, -0.21836521336906189]]]),self.functionspace)
62713          res=generalTensorProduct(arg0,arg1,offset=2)
62714          ref=Data(numarray.array([[1.1328567408737318, -0.30374365715880441], [-0.42994593424502503, -0.757985932157905]]),self.functionspace)
62715          self.failUnless(isinstance(res,Data),"wrong type of result.")
62716          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62717          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62718       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62719       def test_generalTensorProduct_array_rank4_constData_rank4_offset3(self):
62720          arg0=numarray.array([[[[-0.75477003948876131, -0.71704296768544484, 0.26397395287596348], [-0.66681018202831033, 0.62666945183195755, 0.48397317513315707], [-0.66596837543542642, -0.9858846650055304, 0.037814269045928883], [-0.70467145693738908, -0.61269453651864181, 0.9016997671137077]], [[-0.23067795640527899, 0.79481050017073929, 0.16960236020331299], [-0.95466693667437141, 0.27523709539187391, -0.26467191052854599], [-0.77862046198395385, 0.55857353382595409, 0.61891714158016686], [0.79133984261254176, -0.55495264348055273, 0.90460853739402403]]], [[[0.36316730610424752, -0.28352374054786456, -0.91141795483724497], [-0.20709324834721632, 0.33112738696559996, -0.21944369465763303], [0.19056586286618882, 0.68855864738445116, 0.41303859220763339], [0.75891118623345832, -0.45156545177727181, 0.80506965702824029]], [[-0.094269189234492456, -0.97663563583654911, -0.41786962042486153], [0.030575017356307743, -0.53291000038335734, -0.78265946492668426], [0.046806092270876398, -0.46492433334052574, -0.28576611164083632], [0.42315871903369895, 0.4867600339631899, -0.97414758323719997]]]])
62721          arg1=Data(numarray.array([[[[0.44517142475667715, -0.50040115364086768], [-0.22212554112510774, -0.5803995103686046], [0.082177849553861426, 0.37348349687245008]], [[0.70361350501525122, 0.62415996096024551], [-0.49399447543611696, 0.77101094981260898], [0.23523535477231516, 0.64679347686153554]], [[-0.27097745351468006, -0.064683314660610503], [0.97398198262275848, 0.92544474303114144], [-0.698341073410923, 0.015590112423079283]], [[0.44286948263071979, -0.033804439989752133], [0.70182305857293303, 0.039351119933986878], [-0.82845571330963752, 0.56027720436538697]]], [[[-0.39356427820168172, 0.15985029162035036], [0.071600188724590508, -0.57265740377435526], [-0.89058895299357244, -0.61988081404304496]], [[0.90500014860027478, 0.6859047607336568], [0.51569006902708825, 0.53144881270932487], [-0.32322075637149061, 0.24555121269886682]], [[-0.18234437903250544, 0.92654610305520158], [0.17972838908310562, -0.9259071199701987], [-0.20662401295364075, 0.96188743517329311]], [[0.41513962750689459, 0.68152670341218657], [-0.93942130571291727, 0.30122191737425519], [-0.84081216373503365, 0.82524563734786383]]]]),self.functionspace)
62722          res=generalTensorProduct(arg0,arg1,offset=3)
62723          ref=Data(numarray.array([[-3.5513232696205592, 0.21335526423937778], [0.32119253058626618, 0.84439863121792413]]),self.functionspace)
62724          self.failUnless(isinstance(res,Data),"wrong type of result.")
62725          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62726          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62727       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62728       def test_generalTensorProduct_array_rank1_constData_rank2_offset0(self):
62729          arg0=numarray.array([-0.37433185500928889, -0.13004333795062428])
62730          arg1=Data(numarray.array([[-0.85997567673353159, 0.45039995741422456, -0.33375460583773275, -0.80440823451266708, 0.34374787886949187], [-0.79048071690140387, 0.79633313914524018, -0.88282402244326974, -0.24028901768287136, -0.12780599883334021], [0.0021555036461409216, 0.66902112185580465, 0.69295542937784704, 0.51058638038249371, -0.054888158922924424], [0.55538751507474338, -0.36616074795143172, -0.99380498662004157, 0.13633111019559263, 0.76146031289640215]]),self.functionspace)
62731          res=generalTensorProduct(arg0,arg1,offset=0)
62732          ref=Data(numarray.array([[[0.32191629033453145, -0.1685990515549714, 0.12493498072113254, 0.30111562660987373, -0.12867578115272524], [0.29590211310677506, -0.29809286118160794, 0.33046915396795123, 0.089947833727589063, 0.047841856624599249], [-0.00080687367833921699, -0.25043591758467887, -0.25939529131776778, -0.19112874691105727, 0.02054638634766295], [-0.20789923876692809, 0.13706563201224811, 0.37201286415896168, -0.051033077374991964, -0.28503885144246377]], [[0.11183410755877547, -0.058571513874964787, 0.043402562999533684, 0.10460793189099579, -0.044702121581635591], [0.10279675101146102, -0.10355781953514598, 0.11480538270151965, 0.031247985932357177, 0.016620318698401155], [-0.00028030888910890672, -0.087001739845600196, -0.090114237087303317, -0.066398357217066634, 0.0071378394003014344], [-0.072224446316422289, 0.047616765890101394, 0.1292377177320457, -0.017728952636349254, -0.09902284080597494]]]),self.functionspace)
62733          self.failUnless(isinstance(res,Data),"wrong type of result.")
62734          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
62735          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62736       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62737       def test_generalTensorProduct_array_rank2_constData_rank3_offset1(self):
62738          arg0=numarray.array([[-0.49270204786421656, -0.42569639943642756, -0.52266174672625332], [0.65559150000470723, 0.81341516784513201, -0.11832324769855895]])
62739          arg1=Data(numarray.array([[[-0.49452884357026927, -0.57554748858249449, 0.96823447285855746, 0.89003155565245162, 0.86364482522644259], [0.30403656813796043, -0.091761858164602472, -0.097088596587888709, 0.4002977300806736, 0.33462079251164223], [-0.27707769749380429, -0.62947492718163645, 0.089687417694205518, 0.94578143992211072, -0.63403898742724119], [-0.85489284199926763, -0.89153283057341315, 0.9212768843091852, 0.98510149290122895, -0.39695573343646462]], [[0.056692245031661592, 0.21686720719295605, 0.72831396359612022, 0.83248444271675326, 0.35906924108125082], [-0.33830496849512626, 0.5053482042762476, 0.53660377691254779, -0.43829780517310546, -0.66884755476134772], [-0.18996006047533909, 0.80247252645390588, -0.28899656763966042, 0.58072230724852436, 0.69764533664927586], [-0.48456800390570565, 0.82638159594991767, 0.19997418762166541, 0.40447183113762319, 0.52599454004824731]], [[0.36572315231671948, 0.73148700704376535, 0.57129839539690463, 0.941002030363006, -0.11206843498549302], [-0.22454091745524085, 0.58269166402042227, 0.35072440074381195, 0.96282317339387191, 0.34674147653816934], [0.21496990741432787, -0.21237284045464233, 0.052946348809965293, -0.17976246089389969, -0.34322716715353851], [-0.95205496452051164, 0.99396516952659719, -0.80014407887239392, 0.28925861708497846, 0.32897167805253291]]]),self.functionspace)
62740          res=generalTensorProduct(arg0,arg1,offset=1)
62741          ref=Data(numarray.array([[[0.02837218776096026, -0.19106643979922686, -1.085687556792335, -1.2847317648475798, -0.51980017311066529], [0.11157471538131944, -0.47446429850827854, -0.36390477330482329, -0.51387655541762078, -0.061370859684548473], [0.10502551545102361, 0.079533080292729014, 0.051162592776307067, -0.61924488574308767, 0.19479891034431704], [1.1250890192379468, -0.43203519028453413, -0.12083859730375363, -0.80872813915653263, -0.20027399092057399]], [[-0.32136812548454868, -0.28747288394749326, 1.1595900338117631, 1.149310178999134, 0.87153087463561485], [-0.04929019237493823, 0.28195363007047519, 0.33133234245010729, -0.20801065828436199, -0.36570377633932627], [-0.36160211539595483, 0.26519355727580929, -0.18254066682056433, 1.1136846840843708, 0.19241648089403643], [-0.84196520946932396, -0.029899208082971779, 0.8613189779318462, 0.94060166880314233, 0.12868613501186707]]]),self.functionspace)
62742          self.failUnless(isinstance(res,Data),"wrong type of result.")
62743          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
62744          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62745       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62746       def test_generalTensorProduct_array_rank3_constData_rank4_offset2(self):
62747          arg0=numarray.array([[[-0.8808240737788644, -0.02060651661006907, -0.81312290754309413], [0.048225222197601614, -0.41963096415707035, -0.89887875986035404]], [[-0.59610660691592376, -0.11996452471366958, 0.035487251666347364], [0.18022346144471091, -0.77786125405584827, -0.79267770442138152]]])
62748          arg1=Data(numarray.array([[[[0.22203243095759606, 0.09974898020502776, 0.34885282169406495, 0.18374267814765366, 0.94190258256383963], [-0.42752889482203038, -0.44377994884145067, 0.76587602300582791, 0.072624281803013835, -0.31655364896038685], [-0.23301909204111193, 0.67254783848259159, -0.64497522743282576, 0.73596580999241423, -0.14212807110643633], [-0.85520160141082724, -0.93118817379440055, 0.7292284482286131, -0.013793521839053469, 0.11069520128229637]], [[-0.2328270334082454, -0.51139257420371464, -0.80591791816387603, 0.85589407446335675, -0.54736631621173371], [0.28498427921497327, 0.4972848041167488, 0.27256206945985761, 0.55967992191525173, 0.26344571203821654], [-0.083173375666576455, 0.54967288635460942, 0.69078927956147074, 0.73917520864778785, -0.51350230037603128], [0.015745427796054035, -0.86276635919125755, 0.64299145604758667, -0.95853883944443874, -0.57373634347923885]], [[0.11450012551851274, -0.30795385683561016, -0.27342745933596424, 0.89096525612534982, 0.18282292404217815], [0.81727300436756334, 0.78195627520571032, 0.50973030393152396, 0.029368608714198441, -0.53723727877938576], [0.92988883961203883, -0.34268958914602887, 0.30054218081460671, -0.21341004753260107, -0.86823317381652565], [0.6045530374394632, 0.76536087215470028, 0.69023773708861413, -0.89551290241995241, 0.2360536246794509]]], [[[-0.029090389354334389, -0.95938892946002707, -0.46529942896988241, 0.49430739535098156, 0.11390298035429547], [0.18656938707742055, -0.28710626331459643, -0.095112754615466866, 0.009258713025689369, -0.40441010973741398], [0.82161288715352354, 0.47387664418064079, -0.035022496375434864, -0.62382398483692092, 0.58957922334661572], [0.19464711826708325, -0.2719568783209716, 0.74082142210272539, -0.37633416009477338, -0.30446302225416577]], [[-0.46582033101295228, 0.75716848635499501, -0.23013871535751762, 0.8761558468388968, 0.6614435340280056], [0.28784036727617357, 0.73938704719498172, 0.2646155394054055, -0.7723996307738672, 0.80780363334810246], [0.098651410264985362, 0.62612839559406996, 0.30773126963660924, -0.11492641339118226, 0.20918700837341797], [0.25703519706236788, 0.10160100130143945, 0.60478266311756257, -0.89622892335005111, 0.60096840217761094]], [[0.42381797359082807, 0.64145049197927673, 0.54393700601748063, 0.11743981931326553, -0.31821819092203008], [0.22360839302687974, -0.76664637694331028, -0.3875129956827561, -0.9134172669877052, 0.60667104771521196], [0.95900015316818643, -0.026750241960494137, 0.89706579297416655, 0.055661617487037907, -0.45520977112483507], [0.81582775689036624, 0.74813972869063283, -0.094993030794892297, 0.63081532031248599, -0.89030099098243376]]]]),self.functionspace)
62749          res=generalTensorProduct(arg0,arg1,offset=2)
62750          ref=Data(numarray.array([[[-0.47076766156290495, -0.7675032570633753, -0.48313993059573346, -1.3533344272641401, -0.95305828291468841], [-0.60662440777048365, 0.10982487647298811, -0.86199248686847785, 1.046238127585625, -0.19356658955840389], [-1.4129507682373896, -0.54091924680499015, -0.62767870990309893, -0.52185004510668132, 1.1915812405724895], [-0.57042149293960165, -0.51257790622691912, -1.3494919389043707, 0.5509739834688252, 0.25578400345886909]], [[-0.079210962086275483, -1.2793804205948272, -0.45698372214645544, -0.86612306433788921, -0.73106077184563789], [-0.11785750796244365, 0.21345277331594797, -0.38695542227004487, 1.2171425462895979, -1.0441074430894224], [-0.506959957108851, -0.85944557773426011, -0.64449895754981679, -0.60211485746012661, 0.41988650864174093], [-0.28218985897481974, -0.035328842199430333, -0.74896416224773987, 0.22071804328269096, 0.1945990923615909]]]),self.functionspace)
62751          self.failUnless(isinstance(res,Data),"wrong type of result.")
62752          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
62753          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62754       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62755       def test_generalTensorProduct_array_rank1_constData_rank3_offset0(self):
62756          arg0=numarray.array([0.67427786450132854, 0.35682159762611643])
62757          arg1=Data(numarray.array([[[-0.13582218728164652, 0.82707300423024854], [0.17242867521024219, -0.52707721317267708]], [[-0.78774983037260249, -0.31288199421675889], [0.67645830804422324, -0.34667877385254475]], [[-0.062193953465745633, 0.78228566994773763], [0.69697996980179067, -0.68966647365025779]], [[-0.44087834425945216, 0.54814811911502836], [0.89236538255994158, -0.89496939446051083]], [[-0.37319488975032611, 0.18081895495596445], [0.1742407827751169, -0.37855867291937617]], [[-0.75718740438909293, 0.41879944447969142], [0.33655386850023139, 0.031170266030608573]]]),self.functionspace)
62758          res=generalTensorProduct(arg0,arg1,offset=0)
62759          ref=Data(numarray.array([[[[-0.091581894392168128, 0.5576770190790703], [0.11626483889955527, -0.35539649772538423]], [[-0.53116227338492217, -0.21096940290139321], [0.45612086337224073, -0.2337578233012329]], [[-0.041936006127777967, 0.52747791096235164], [0.46995816563815185, -0.46502683707105757]], [[-0.29727450847214498, 0.36960414318730117], [0.6017022245074285, -0.60345805209088033]], [[-0.25163705330365865, 0.12192221880906963], [0.11748670291864569, -0.2552537335645339]], [[-0.5105547060587815, 0.28238719507810905], [0.22693082374199697, 0.02101742041505705]]], [[[-0.0484642898589107, 0.29511751072286901], [0.061526275365073352, -0.18807253327659579]], [[-0.28108615300325424, -0.11164305304486923], [0.24137493420379935, -0.12370247394912813]], [[-0.022192145838331699, 0.27913642255076854], [0.24869750633807733, -0.24608789295705491]], [[-0.15731491515741466, 0.19559108759837518], [0.31841524147127892, -0.31934440915787748]], [[-0.13316399678661375, 0.064520108388472011], [0.06217287448144232, -0.13507791046631426]], [[-0.27018081933648841, 0.14943668686417355], [0.12008968904550246, 0.011122224123472817]]]]),self.functionspace)
62760          self.failUnless(isinstance(res,Data),"wrong type of result.")
62761          self.failUnlessEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")
62762          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62763       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62764       def test_generalTensorProduct_array_rank2_constData_rank4_offset1(self):
62765          arg0=numarray.array([[-0.8414171582235519, 0.30176859578095439, 0.58504055830599722], [-0.66736294612972791, 0.85223569442908698, 0.73630544893008509]])
62766          arg1=Data(numarray.array([[[[-0.28034019828513257, -0.5896100289998889], [-0.16353717463781803, 0.96112363665321943]], [[-0.59695150035168876, -0.36176962663960777], [-0.76122161650111875, -0.89825581348212302]], [[0.76336660314480276, -0.37497815649619715], [0.88830517640056827, -0.22883745649257059]], [[-0.97415015960297557, -0.46263470375901328], [0.83321332494480083, 0.41974830446646116]], [[0.97180418324144546, 0.85329517250535147], [-0.098855326106938257, -0.76420766747314439]], [[0.62693999735278916, -0.49125379157290228], [0.88354486302988944, -0.11252037272921989]]], [[[-0.055177967779114656, 0.045296413577760264], [0.13404827545103992, 0.43441318907030269]], [[0.75679499873437162, -0.86531276984360517], [0.91000789360212808, -0.37318314106204764]], [[-0.55802142470438376, -0.98300175029045778], [0.32611582304111697, -0.35510617110835563]], [[0.37438337283306655, 0.63083523785572759], [-0.37451009404171787, 0.10766329608638103]], [[0.40833443878127573, -0.30371969472593818], [-0.4874142989129453, 0.1626240263173595]], [[0.58758202606321608, -0.42992195505338815], [0.91844109279383646, 0.92771940647056339]]], [[[-0.2976886049191243, 0.69995303590978275], [0.40964678862627668, 0.55770159105070216]], [[-0.41007385929936735, 0.25316458905718875], [0.87180747180161844, 0.0190653638213647]], [[0.49686730304596982, 0.68494857715201274], [0.41851397164447279, 0.99309007284037087]], [[-0.53250611153679772, -0.19042793787702639], [0.074612361397939475, -0.91936520079260231]], [[0.51492720975646056, 0.19675972172911882], [0.45201770540247965, -0.69472679480669441]], [[0.78168619089983005, -0.021059754759005234], [0.85870827667201577, 0.76228751016484408]]]]),self.functionspace)
62767          res=generalTensorProduct(arg0,arg1,offset=1)
62768          ref=Data(numarray.array([[[[0.045072167498935223, 0.91927794509710359], [0.41771453052355623, -0.35133561080332032]], [[0.49075235949412721, 0.1913865042369873], [1.4251594635747669, 0.65434691258485111]], [[-0.52001557527158604, 0.41959669498747665], [-0.40417605555142644, 0.66638584239123866]], [[0.62110613088488342, 0.46822697453673567], [-0.77044411568503435, -0.85855995419499687]], [[-0.39321690172987828, -0.69451784751125856], [0.2005409297545071, 0.28564891601609238]], [[0.10711385750608482, 0.27129161391795714], [0.036106040672471029, 0.82060226536996628]]], [[[-0.079125714927607949, 0.94746634083711834], [0.5250045383863029, 0.13944284447228295]], [[0.74141140619219814, -0.30961231905260733], [1.925468901691274, 0.29546058395884828]], [[-0.61916225901306388, -0.083171282436264149], [-0.0067402968960148524, 0.58130111672987184]], [[0.57708744270136292, 0.70615243759940904], [-0.82028908110121102, -0.86530356809728914]], [[0.078594791550913812, -0.68342308994887846], [-0.016596382336679427, 0.13706675588533179]], [[0.65792165404906111, -0.054056670455930433], [0.82535476283491915, 1.4270039674386905]]]]),self.functionspace)
62769          self.failUnless(isinstance(res,Data),"wrong type of result.")
62770          self.failUnlessEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")
62771          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62772       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62773       def test_generalTensorProduct_array_rank1_expandedData_rank0_offset0(self):
62774          arg0=numarray.array([0.29115487485101577, -0.92058624546831314])
62775          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62776          arg1=msk_arg1*(-0.98690142804)+(1.-msk_arg1)*(-0.76468651016)
62777          res=generalTensorProduct(arg0,arg1,offset=0)
62778          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62779          ref=msk_ref*numarray.array([-0.28734116177116109, 0.90852788028630016])+(1.-msk_ref)*numarray.array([-0.22264220516594166, 0.70395988334860971])
62780          self.failUnless(isinstance(res,Data),"wrong type of result.")
62781          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62782          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62783       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62784       def test_generalTensorProduct_array_rank2_expandedData_rank1_offset1(self):
62785          arg0=numarray.array([[-0.93610562681808984, 0.10378670816956537, -0.6406743208488439], [0.46455866754430919, 0.96760752415530793, 0.46044492106547819]])
62786          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62787          arg1=msk_arg1*numarray.array([-0.87433409270128148, 0.08998261487198489, -0.51239683641173372])+(1.-msk_arg1)*numarray.array([0.38283487176473474, -0.37481589977652274, 0.41164354845062046])
62788          res=generalTensorProduct(arg0,arg1,offset=1)
62789          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62790          ref=msk_ref*numarray.array([1.1560875584597956, -0.55504214679636932])+(1.-msk_ref)*numarray.array([-0.66100423684397858, 0.0047137542931757204])
62791          self.failUnless(isinstance(res,Data),"wrong type of result.")
62792          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62793          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62794       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62795       def test_generalTensorProduct_array_rank3_expandedData_rank2_offset2(self):
62796          arg0=numarray.array([[[-0.27844168614466147, -0.095458702093299097, -0.75204233570228118], [-0.77969105642932335, -0.40539834359387661, 0.023424225802739063]], [[0.063079448469969934, 0.15874359589307074, -0.82728342758477114], [0.3643907679272369, 0.23196323302076571, -0.50630191450525808]]])
62797          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62798          arg1=msk_arg1*numarray.array([[0.31217869013741106, 0.45819759196953314, 0.91338852760958655], [0.76904716070208923, 0.98152925870510721, 0.62346661947792459]])+(1.-msk_arg1)*numarray.array([[0.35723835535980708, 0.046533644843017141, 0.64767896554838189], [0.61659097493132853, 0.89567276797294992, 0.62083369756270601]])
62799          res=generalTensorProduct(arg0,arg1,offset=2)
62800          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62801          ref=msk_ref*numarray.array([-1.8004946559637984, -0.47095315631831763])+(1.-msk_ref)*numarray.array([-1.42030626984827, -0.3877788378780993])
62802          self.failUnless(isinstance(res,Data),"wrong type of result.")
62803          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62804          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62805       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62806       def test_generalTensorProduct_array_rank4_expandedData_rank3_offset3(self):
62807          arg0=numarray.array([[[[-0.86203815370676407, 0.88648224286799171, -0.38452407224253693], [-0.46071855687976693, 0.8586457771625009, 0.037036902773721847], [0.1881681544450049, -0.20839311565038021, 0.12509054139061448], [-0.43081955516318438, -0.0088692839201998108, -0.13803890124233775]], [[0.81623934567894785, -0.050788722017519161, 0.91176548145987923], [0.96823772412961673, 0.86884436732030212, 0.23907626590257047], [0.75559066784077378, -0.65582359259300205, -0.53760253067996167], [-0.84323947632390528, 0.6934215459637012, -0.59227571906648624]]], [[[-0.25777810203980334, -0.21814236286210531, -0.43246308055155303], [-0.99530719662785505, 0.3533948078447835, 0.62127608202896889], [-0.26136821534411125, 0.070198516358207286, -0.83830727278858874], [0.52558803670458309, 0.27597664998370197, 0.68879285745108443]], [[-0.93059227228277841, 0.72030334971118237, 0.96692171710246955], [-0.59894877093386323, -0.082739724763901901, 0.40633121158963226], [-0.66987320171247067, 0.1674568775135965, 0.5538152509341483], [-0.02966270303085361, -0.20276500886129778, 0.11675540799808104]]]])
62808          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62809          arg1=msk_arg1*numarray.array([[[-0.95870994948189536, -0.1693406955788368, -0.60552624845409508], [-0.20965230518883282, -0.11303671679882132, 0.58547932226790222], [0.35431173214629474, 0.96469780889006063, -0.16874838566023143], [-0.35595512304521892, 0.067234067256850327, 0.10677388363591578]], [[-0.59949107728149165, 0.098530273481613362, 0.846975545321488], [0.76114764834682513, 0.49472104472565603, 0.52386510056675628], [-0.93264227734981109, -0.023985624737179689, 0.74131816851261401], [0.21527174688341777, 0.13972173775871455, 0.26086833461282399]]])+(1.-msk_arg1)*numarray.array([[[0.65820391082560414, 0.53705567060814019, -0.73116351630946408], [0.39599413821283891, 0.31102752414801293, 0.49531801658287722], [0.22694855172826944, 0.39611876925310519, -0.13363576636984287], [-0.40611627716086485, -0.83287756387037226, -0.78666239358211021]], [[0.40474813642881169, -0.80033715552398332, 0.74170381177548328], [0.0023823306792924992, -0.036412734592137008, -0.81900336670928131], [0.3265854558303507, 0.022783328089716282, -0.62868657633332936], [-0.26240459887855083, -0.49620438016689739, -0.22707804450351565]]])
62810          res=generalTensorProduct(arg0,arg1,offset=3)
62811          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62812          ref=msk_ref*numarray.array([1.1562414069369997, 3.2908847053255363])+(1.-msk_ref)*numarray.array([1.9308237189329767, -1.9001695476925771])
62813          self.failUnless(isinstance(res,Data),"wrong type of result.")
62814          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62815          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62816       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62817       def test_generalTensorProduct_array_rank1_expandedData_rank1_offset0(self):
62818          arg0=numarray.array([-0.95183416146539646, -0.80840515776198618])
62819          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62820          arg1=msk_arg1*numarray.array([-0.65815107380220117, 0.68239014658138952])+(1.-msk_arg1)*numarray.array([-0.9225185278432928, 0.022234635287948334])
62821          res=generalTensorProduct(arg0,arg1,offset=0)
62822          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62823          ref=msk_ref*numarray.array([[0.62645067545006838, -0.64952225296354582], [0.53205272264828907, -0.55164771410235303]])+(1.-msk_ref)*numarray.array([[0.87808464938601261, -0.021163685434793217], [0.74576873603951233, -0.017974593847734099]])
62824          self.failUnless(isinstance(res,Data),"wrong type of result.")
62825          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62826          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62827       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62828       def test_generalTensorProduct_array_rank2_expandedData_rank2_offset1(self):
62829          arg0=numarray.array([[-0.53439976652275312, 0.42037713600795867, -0.86528805366263817], [-0.55963038967778078, 0.95127858496616535, -0.2547752443514979]])
62830          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62831          arg1=msk_arg1*numarray.array([[0.0092311296347167282, -0.5164230921009485], [-0.86153656744382512, -0.96439171784069333], [-0.19199528280736633, -0.57924062379753982]])+(1.-msk_arg1)*numarray.array([[0.088011214563954887, -0.057907099615626567], [0.68258740356562986, -0.72858993558715079], [0.38842519918913143, 0.62530388310971374]])
62832          res=generalTensorProduct(arg0,arg1,offset=1)
62833          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62834          ref=msk_ref*numarray.array([[-0.2009721637369028, 0.37177814347814475], [-0.77581166235763011, -0.48082296096319366]])+(1.-msk_ref)*numarray.array([[-0.096188719328219346, -0.81640498989544297], [0.50111590404151019, -0.81999737983614895]])
62835          self.failUnless(isinstance(res,Data),"wrong type of result.")
62836          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62837          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62838       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62839       def test_generalTensorProduct_array_rank3_expandedData_rank3_offset2(self):
62840          arg0=numarray.array([[[-0.57751158972654504, -0.88227518602905852, -0.89134985212393048], [0.32092214174534317, 0.081471612073153787, -0.66338459945531647]], [[-0.87597525244806307, 0.21348800353113506, 0.85949001658947632], [-0.88550230417698761, -0.39920779922819505, -0.47120320847210451]]])
62841          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62842          arg1=msk_arg1*numarray.array([[[-0.028812235426639576, -0.22209286764317193], [-0.0058056813464393286, -0.28565742859450172], [-0.66132872409783783, 0.32564512398375101]], [[-0.66567096211121513, -0.92727600105647157], [-0.52286496151683504, 0.5080017220624411], [-0.59842032109304166, 0.66582638298051022]]])+(1.-msk_arg1)*numarray.array([[[-0.85470084785081313, 0.96604272440464878], [0.3389593344405939, -0.31280712475982675], [0.96014403863407716, -0.87918624581692861]], [[0.36362592228564905, -0.34261654301827016], [-0.25514137595147734, -0.69460580450413056], [0.0082411831956854531, 0.83083204817619727]]])
62843          res=generalTensorProduct(arg0,arg1,offset=2)
62844          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62845          ref=msk_ref*numarray.array([[0.75199249174915561, -0.60786871649050611], [0.53575644250351862, 0.71801941282029547]])+(1.-msk_ref)*numarray.array([[-0.57083825476567096, -0.21596145005282441], [1.422274321425349, -1.4794728229067164]])
62846          self.failUnless(isinstance(res,Data),"wrong type of result."