/[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 313 by gross, Mon Dec 5 07:01:36 2005 UTC
# Line 14801  class Test_util_unary_no_tagged_data(Tes Line 14801  class Test_util_unary_no_tagged_data(Tes
14801        self.failUnless(isinstance(res,Symbol),"wrong type of result.")        self.failUnless(isinstance(res,Symbol),"wrong type of result.")
14802        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
14803        self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14804       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14805       def test_length_float_rank0(self):
14806          arg=-0.510102533262
14807          res=length(arg)
14808          ref=0.510102533262
14809          self.failUnless(isinstance(res,float),"wrong type of result.")
14810          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14811       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14812       def test_length_array_rank0(self):
14813          arg=numarray.array(0.991109436523)
14814          res=length(arg)
14815          ref=numarray.array(0.991109436523)
14816          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
14817          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
14818          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14819       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14820       def test_length_array_rank1(self):
14821          arg=numarray.array([-0.76294483500740484, 0.011677546682929307])
14822          res=length(arg)
14823          ref=numarray.array(0.763034197373)
14824          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
14825          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
14826          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14827       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14828       def test_length_array_rank2(self):
14829          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]])
14830          res=length(arg)
14831          ref=numarray.array(2.57369396272)
14832          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
14833          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
14834          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14835       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14836       def test_length_array_rank3(self):
14837          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]]])
14838          res=length(arg)
14839          ref=numarray.array(2.46349793439)
14840          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
14841          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
14842          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14843       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14844       def test_length_array_rank4(self):
14845          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]]]])
14846          res=length(arg)
14847          ref=numarray.array(4.74889961553)
14848          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
14849          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
14850          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14851       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14852       def test_length_constData_rank0(self):
14853          arg=Data(-0.621348324338,self.functionspace)
14854          res=length(arg)
14855          ref=Data(0.621348324338,self.functionspace)
14856          self.failUnless(isinstance(res,Data),"wrong type of result.")
14857          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14858          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14859       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14860       def test_length_constData_rank1(self):
14861          arg=Data(numarray.array([0.32933097146312651, 0.074695318351896134]),self.functionspace)
14862          res=length(arg)
14863          ref=Data(0.337695542388,self.functionspace)
14864          self.failUnless(isinstance(res,Data),"wrong type of result.")
14865          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14866          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14867       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14868       def test_length_constData_rank2(self):
14869          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)
14870          res=length(arg)
14871          ref=Data(2.69665449585,self.functionspace)
14872          self.failUnless(isinstance(res,Data),"wrong type of result.")
14873          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14874          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14875       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14876       def test_length_constData_rank3(self):
14877          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)
14878          res=length(arg)
14879          ref=Data(2.34509551447,self.functionspace)
14880          self.failUnless(isinstance(res,Data),"wrong type of result.")
14881          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14882          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14883       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14884       def test_length_constData_rank4(self):
14885          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)
14886          res=length(arg)
14887          ref=Data(4.80409161546,self.functionspace)
14888          self.failUnless(isinstance(res,Data),"wrong type of result.")
14889          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14890          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14891       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14892       def test_length_expandedData_rank0(self):
14893          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
14894          arg=msk_arg*(0.883776938505)+(1.-msk_arg)*(-0.0468902435277)
14895          res=length(arg)
14896          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
14897          ref=msk_ref*(0.883776938505)+(1.-msk_ref)*(0.0468902435277)
14898          self.failUnless(isinstance(res,Data),"wrong type of result.")
14899          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14900          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14901       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14902       def test_length_expandedData_rank1(self):
14903          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
14904          arg=msk_arg*numarray.array([-0.58845041644366813, 0.84032988075424919])+(1.-msk_arg)*numarray.array([0.24641851124094183, -0.83673496226594679])
14905          res=length(arg)
14906          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
14907          ref=msk_ref*(1.0258792332)+(1.-msk_ref)*(0.872265716259)
14908          self.failUnless(isinstance(res,Data),"wrong type of result.")
14909          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14910          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14911       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14912       def test_length_expandedData_rank2(self):
14913          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
14914          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]])
14915          res=length(arg)
14916          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
14917          ref=msk_ref*(2.41490921017)+(1.-msk_ref)*(2.63013072264)
14918          self.failUnless(isinstance(res,Data),"wrong type of result.")
14919          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14920          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14921       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14922       def test_length_expandedData_rank3(self):
14923          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
14924          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]]])
14925          res=length(arg)
14926          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
14927          ref=msk_ref*(3.13508828546)+(1.-msk_ref)*(2.77076207142)
14928          self.failUnless(isinstance(res,Data),"wrong type of result.")
14929          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14930          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14931       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14932       def test_length_expandedData_rank4(self):
14933          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
14934          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]]]])
14935          res=length(arg)
14936          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
14937          ref=msk_ref*(4.72250379236)+(1.-msk_ref)*(4.95651187575)
14938          self.failUnless(isinstance(res,Data),"wrong type of result.")
14939          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14940          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14941       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14942       def test_length_Symbol_rank0(self):
14943          arg=Symbol(shape=())
14944          res=length(arg)
14945          s=numarray.array(-0.789837980175)
14946          sub=res.substitute({arg:s})
14947          ref=numarray.array(0.789837980175)
14948          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
14949          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14950          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14951       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14952       def test_length_Symbol_rank1(self):
14953          arg=Symbol(shape=(2,))
14954          res=length(arg)
14955          s=numarray.array([-0.99278720130643516, -0.31635710603880374])
14956          sub=res.substitute({arg:s})
14957          ref=numarray.array(1.04197324611)
14958          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
14959          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14960          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14961       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14962       def test_length_Symbol_rank2(self):
14963          arg=Symbol(shape=(4, 5))
14964          res=length(arg)
14965          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]])
14966          sub=res.substitute({arg:s})
14967          ref=numarray.array(3.04731243366)
14968          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
14969          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14970          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14971       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14972       def test_length_Symbol_rank3(self):
14973          arg=Symbol(shape=(6, 2, 2))
14974          res=length(arg)
14975          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]]])
14976          sub=res.substitute({arg:s})
14977          ref=numarray.array(2.99147603017)
14978          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
14979          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14980          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14981       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14982       def test_length_Symbol_rank4(self):
14983          arg=Symbol(shape=(3, 2, 3, 4))
14984          res=length(arg)
14985          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]]]])
14986          sub=res.substitute({arg:s})
14987          ref=numarray.array(4.83951826943)
14988          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
14989          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
14990          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14991       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14992       def test_maxval_float_rank0(self):
14993          arg=0.315854880825
14994          res=maxval(arg)
14995          ref=0.315854880825
14996          self.failUnless(isinstance(res,float),"wrong type of result.")
14997          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
14998       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14999       def test_maxval_array_rank0(self):
15000          arg=numarray.array(-0.377472785293)
15001          res=maxval(arg)
15002          ref=numarray.array(-0.377472785293)
15003          self.failUnless(isinstance(res,float),"wrong type of result.")
15004          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15005       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15006       def test_maxval_array_rank1(self):
15007          arg=numarray.array([0.67183156228324403, 0.98323683252360539])
15008          res=maxval(arg)
15009          ref=numarray.array(0.983236832524)
15010          self.failUnless(isinstance(res,float),"wrong type of result.")
15011          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15012       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15013       def test_maxval_array_rank2(self):
15014          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]])
15015          res=maxval(arg)
15016          ref=numarray.array(0.962948238385)
15017          self.failUnless(isinstance(res,float),"wrong type of result.")
15018          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15019       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15020       def test_maxval_array_rank3(self):
15021          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]]])
15022          res=maxval(arg)
15023          ref=numarray.array(0.822802668551)
15024          self.failUnless(isinstance(res,float),"wrong type of result.")
15025          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15026       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15027       def test_maxval_array_rank4(self):
15028          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]]]])
15029          res=maxval(arg)
15030          ref=numarray.array(0.935345721712)
15031          self.failUnless(isinstance(res,float),"wrong type of result.")
15032          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15033       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15034       def test_maxval_constData_rank0(self):
15035          arg=Data(0.00425301467094,self.functionspace)
15036          res=maxval(arg)
15037          ref=Data(0.00425301467094,self.functionspace)
15038          self.failUnless(isinstance(res,Data),"wrong type of result.")
15039          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15040          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15041       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15042       def test_maxval_constData_rank1(self):
15043          arg=Data(numarray.array([0.24481630771410834, 0.8482027633371616]),self.functionspace)
15044          res=maxval(arg)
15045          ref=Data(0.848202763337,self.functionspace)
15046          self.failUnless(isinstance(res,Data),"wrong type of result.")
15047          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15048          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15049       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15050       def test_maxval_constData_rank2(self):
15051          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)
15052          res=maxval(arg)
15053          ref=Data(0.958977801516,self.functionspace)
15054          self.failUnless(isinstance(res,Data),"wrong type of result.")
15055          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15056          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15057       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15058       def test_maxval_constData_rank3(self):
15059          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)
15060          res=maxval(arg)
15061          ref=Data(0.972307036227,self.functionspace)
15062          self.failUnless(isinstance(res,Data),"wrong type of result.")
15063          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15064          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15065       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15066       def test_maxval_constData_rank4(self):
15067          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)
15068          res=maxval(arg)
15069          ref=Data(0.971940023254,self.functionspace)
15070          self.failUnless(isinstance(res,Data),"wrong type of result.")
15071          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15072          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15073       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15074       def test_maxval_expandedData_rank0(self):
15075          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15076          arg=msk_arg*(0.332235320145)+(1.-msk_arg)*(-0.24604500324)
15077          res=maxval(arg)
15078          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15079          ref=msk_ref*(0.332235320145)+(1.-msk_ref)*(-0.24604500324)
15080          self.failUnless(isinstance(res,Data),"wrong type of result.")
15081          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15082          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15083       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15084       def test_maxval_expandedData_rank1(self):
15085          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15086          arg=msk_arg*numarray.array([-0.59427677340505958, -0.84740257716903722])+(1.-msk_arg)*numarray.array([-0.72031138157212804, 0.92918576704192746])
15087          res=maxval(arg)
15088          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15089          ref=msk_ref*(-0.594276773405)+(1.-msk_ref)*(0.929185767042)
15090          self.failUnless(isinstance(res,Data),"wrong type of result.")
15091          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15092          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15093       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15094       def test_maxval_expandedData_rank2(self):
15095          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15096          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]])
15097          res=maxval(arg)
15098          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15099          ref=msk_ref*(0.857239699597)+(1.-msk_ref)*(0.94898016702)
15100          self.failUnless(isinstance(res,Data),"wrong type of result.")
15101          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15102          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15103       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15104       def test_maxval_expandedData_rank3(self):
15105          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15106          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]]])
15107          res=maxval(arg)
15108          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15109          ref=msk_ref*(0.910447076187)+(1.-msk_ref)*(0.753038263205)
15110          self.failUnless(isinstance(res,Data),"wrong type of result.")
15111          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15112          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15113       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15114       def test_maxval_expandedData_rank4(self):
15115          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15116          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]]]])
15117          res=maxval(arg)
15118          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15119          ref=msk_ref*(0.983976581325)+(1.-msk_ref)*(0.996672966128)
15120          self.failUnless(isinstance(res,Data),"wrong type of result.")
15121          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15122          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15123       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15124       def test_maxval_Symbol_rank0(self):
15125          arg=Symbol(shape=())
15126          res=maxval(arg)
15127          s=numarray.array(0.264444652408)
15128          sub=res.substitute({arg:s})
15129          ref=numarray.array(0.264444652408)
15130          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15131          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15132          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15133       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15134       def test_maxval_Symbol_rank1(self):
15135          arg=Symbol(shape=(2,))
15136          res=maxval(arg)
15137          s=numarray.array([-0.46872519059702666, -0.34377250714318253])
15138          sub=res.substitute({arg:s})
15139          ref=numarray.array(-0.343772507143)
15140          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15141          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15142          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15143       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15144       def test_maxval_Symbol_rank2(self):
15145          arg=Symbol(shape=(4, 5))
15146          res=maxval(arg)
15147          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]])
15148          sub=res.substitute({arg:s})
15149          ref=numarray.array(0.88423312487)
15150          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15151          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15152          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15153       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15154       def test_maxval_Symbol_rank3(self):
15155          arg=Symbol(shape=(6, 2, 2))
15156          res=maxval(arg)
15157          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]]])
15158          sub=res.substitute({arg:s})
15159          ref=numarray.array(0.932998747348)
15160          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15161          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15162          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15163       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15164       def test_maxval_Symbol_rank4(self):
15165          arg=Symbol(shape=(3, 2, 3, 4))
15166          res=maxval(arg)
15167          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]]]])
15168          sub=res.substitute({arg:s})
15169          ref=numarray.array(0.97442268603)
15170          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15171          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15172          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15173       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15174       def test_minval_float_rank0(self):
15175          arg=-0.0813988872107
15176          res=minval(arg)
15177          ref=-0.0813988872107
15178          self.failUnless(isinstance(res,float),"wrong type of result.")
15179          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15180       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15181       def test_minval_array_rank0(self):
15182          arg=numarray.array(0.203135339689)
15183          res=minval(arg)
15184          ref=numarray.array(0.203135339689)
15185          self.failUnless(isinstance(res,float),"wrong type of result.")
15186          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15187       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15188       def test_minval_array_rank1(self):
15189          arg=numarray.array([0.53544902048869591, -0.81095461710032879])
15190          res=minval(arg)
15191          ref=numarray.array(-0.8109546171)
15192          self.failUnless(isinstance(res,float),"wrong type of result.")
15193          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15194       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15195       def test_minval_array_rank2(self):
15196          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]])
15197          res=minval(arg)
15198          ref=numarray.array(-0.9842638414)
15199          self.failUnless(isinstance(res,float),"wrong type of result.")
15200          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15201       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15202       def test_minval_array_rank3(self):
15203          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]]])
15204          res=minval(arg)
15205          ref=numarray.array(-0.886240212506)
15206          self.failUnless(isinstance(res,float),"wrong type of result.")
15207          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15208       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15209       def test_minval_array_rank4(self):
15210          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]]]])
15211          res=minval(arg)
15212          ref=numarray.array(-0.991898674121)
15213          self.failUnless(isinstance(res,float),"wrong type of result.")
15214          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15215       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15216       def test_minval_constData_rank0(self):
15217          arg=Data(-0.570106420108,self.functionspace)
15218          res=minval(arg)
15219          ref=Data(-0.570106420108,self.functionspace)
15220          self.failUnless(isinstance(res,Data),"wrong type of result.")
15221          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15222          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15223       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15224       def test_minval_constData_rank1(self):
15225          arg=Data(numarray.array([-0.19847831559753981, 0.40610397160211087]),self.functionspace)
15226          res=minval(arg)
15227          ref=Data(-0.198478315598,self.functionspace)
15228          self.failUnless(isinstance(res,Data),"wrong type of result.")
15229          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15230          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15231       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15232       def test_minval_constData_rank2(self):
15233          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)
15234          res=minval(arg)
15235          ref=Data(-0.96391313335,self.functionspace)
15236          self.failUnless(isinstance(res,Data),"wrong type of result.")
15237          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15238          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15239       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15240       def test_minval_constData_rank3(self):
15241          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)
15242          res=minval(arg)
15243          ref=Data(-0.826272785432,self.functionspace)
15244          self.failUnless(isinstance(res,Data),"wrong type of result.")
15245          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15246          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15247       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15248       def test_minval_constData_rank4(self):
15249          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)
15250          res=minval(arg)
15251          ref=Data(-0.960432428889,self.functionspace)
15252          self.failUnless(isinstance(res,Data),"wrong type of result.")
15253          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15254          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15255       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15256       def test_minval_expandedData_rank0(self):
15257          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15258          arg=msk_arg*(-0.778944214859)+(1.-msk_arg)*(0.953941502903)
15259          res=minval(arg)
15260          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15261          ref=msk_ref*(-0.778944214859)+(1.-msk_ref)*(0.953941502903)
15262          self.failUnless(isinstance(res,Data),"wrong type of result.")
15263          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15264          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15265       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15266       def test_minval_expandedData_rank1(self):
15267          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15268          arg=msk_arg*numarray.array([-0.73159504520188157, 0.68299192035807255])+(1.-msk_arg)*numarray.array([-0.3100681210597318, -0.65103554359904581])
15269          res=minval(arg)
15270          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15271          ref=msk_ref*(-0.731595045202)+(1.-msk_ref)*(-0.651035543599)
15272          self.failUnless(isinstance(res,Data),"wrong type of result.")
15273          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15274          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15275       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15276       def test_minval_expandedData_rank2(self):
15277          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15278          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]])
15279          res=minval(arg)
15280          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15281          ref=msk_ref*(-0.959241439926)+(1.-msk_ref)*(-0.991313252486)
15282          self.failUnless(isinstance(res,Data),"wrong type of result.")
15283          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15284          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15285       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15286       def test_minval_expandedData_rank3(self):
15287          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15288          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]]])
15289          res=minval(arg)
15290          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15291          ref=msk_ref*(-0.981008494543)+(1.-msk_ref)*(-0.898866074377)
15292          self.failUnless(isinstance(res,Data),"wrong type of result.")
15293          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15294          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15295       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15296       def test_minval_expandedData_rank4(self):
15297          msk_arg=whereNegative(self.functionspace.getX()[0]-0.5)
15298          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]]]])
15299          res=minval(arg)
15300          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
15301          ref=msk_ref*(-0.991774174013)+(1.-msk_ref)*(-0.997736561662)
15302          self.failUnless(isinstance(res,Data),"wrong type of result.")
15303          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15304          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15305       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15306       def test_minval_Symbol_rank0(self):
15307          arg=Symbol(shape=())
15308          res=minval(arg)
15309          s=numarray.array(0.507552163379)
15310          sub=res.substitute({arg:s})
15311          ref=numarray.array(0.507552163379)
15312          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15313          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15314          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15315       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15316       def test_minval_Symbol_rank1(self):
15317          arg=Symbol(shape=(2,))
15318          res=minval(arg)
15319          s=numarray.array([-0.91662367981879389, 0.4198006315668994])
15320          sub=res.substitute({arg:s})
15321          ref=numarray.array(-0.916623679819)
15322          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15323          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15324          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15325       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15326       def test_minval_Symbol_rank2(self):
15327          arg=Symbol(shape=(4, 5))
15328          res=minval(arg)
15329          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]])
15330          sub=res.substitute({arg:s})
15331          ref=numarray.array(-0.897490434505)
15332          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15333          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15334          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15335       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15336       def test_minval_Symbol_rank3(self):
15337          arg=Symbol(shape=(6, 2, 2))
15338          res=minval(arg)
15339          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]]])
15340          sub=res.substitute({arg:s})
15341          ref=numarray.array(-0.969839189966)
15342          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15343          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15344          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15345       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15346       def test_minval_Symbol_rank4(self):
15347          arg=Symbol(shape=(3, 2, 3, 4))
15348          res=minval(arg)
15349          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]]]])
15350          sub=res.substitute({arg:s})
15351          ref=numarray.array(-0.991347203321)
15352          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
15353          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
15354          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
15355    
15356  class Test_util_unary_with_tagged_data(Test_util_base):  class Test_util_unary_with_tagged_data(Test_util_base):
15357     """     """
# Line 16007  class Test_util_unary_with_tagged_data(T Line 16557  class Test_util_unary_with_tagged_data(T
16557        self.failUnless(isinstance(res,Data),"wrong type of result.")        self.failUnless(isinstance(res,Data),"wrong type of result.")
16558        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
16559        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16560       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16561       def test_length_taggedData_rank0(self):
16562          arg=Data(0.0304173948959,self.functionspace)
16563          arg.setTaggedValue(1,0.218413236568)
16564          res=length(arg)
16565          ref=Data(0.0304173948959,self.functionspace)
16566          ref.setTaggedValue(1,0.218413236568)
16567          self.failUnless(isinstance(res,Data),"wrong type of result.")
16568          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16569          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16570       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16571       def test_length_taggedData_rank1(self):
16572          arg=Data(numarray.array([0.39703364688152853, -0.33246454817593807]),self.functionspace)
16573          arg.setTaggedValue(1,numarray.array([-0.53598331151915435, 0.50067334409291053]))
16574          res=length(arg)
16575          ref=Data(0.517849777976,self.functionspace)
16576          ref.setTaggedValue(1,0.73345204868)
16577          self.failUnless(isinstance(res,Data),"wrong type of result.")
16578          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16579          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16580       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16581       def test_length_taggedData_rank2(self):
16582          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)
16583          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]]))
16584          res=length(arg)
16585          ref=Data(2.6546513714,self.functionspace)
16586          ref.setTaggedValue(1,2.19865063671)
16587          self.failUnless(isinstance(res,Data),"wrong type of result.")
16588          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16589          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16590       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16591       def test_length_taggedData_rank3(self):
16592          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)
16593          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]]]))
16594          res=length(arg)
16595          ref=Data(2.76676324475,self.functionspace)
16596          ref.setTaggedValue(1,3.02637754858)
16597          self.failUnless(isinstance(res,Data),"wrong type of result.")
16598          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16599          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16600       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16601       def test_length_taggedData_rank4(self):
16602          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)
16603          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]]]]))
16604          res=length(arg)
16605          ref=Data(4.84097039803,self.functionspace)
16606          ref.setTaggedValue(1,4.824055271)
16607          self.failUnless(isinstance(res,Data),"wrong type of result.")
16608          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16609          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16610       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16611       def test_maxval_taggedData_rank0(self):
16612          arg=Data(-0.219558082185,self.functionspace)
16613          arg.setTaggedValue(1,0.373894454941)
16614          res=maxval(arg)
16615          ref=Data(-0.219558082185,self.functionspace)
16616          ref.setTaggedValue(1,0.373894454941)
16617          self.failUnless(isinstance(res,Data),"wrong type of result.")
16618          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16619          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16620       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16621       def test_maxval_taggedData_rank1(self):
16622          arg=Data(numarray.array([0.64744990357184862, -0.52792070755787024]),self.functionspace)
16623          arg.setTaggedValue(1,numarray.array([-0.10929307972444979, 0.83862721932489936]))
16624          res=maxval(arg)
16625          ref=Data(0.647449903572,self.functionspace)
16626          ref.setTaggedValue(1,0.838627219325)
16627          self.failUnless(isinstance(res,Data),"wrong type of result.")
16628          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16629          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16630       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16631       def test_maxval_taggedData_rank2(self):
16632          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)
16633          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]]))
16634          res=maxval(arg)
16635          ref=Data(0.871760927326,self.functionspace)
16636          ref.setTaggedValue(1,0.972623141288)
16637          self.failUnless(isinstance(res,Data),"wrong type of result.")
16638          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16639          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16640       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16641       def test_maxval_taggedData_rank3(self):
16642          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)
16643          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]]]))
16644          res=maxval(arg)
16645          ref=Data(0.978351724294,self.functionspace)
16646          ref.setTaggedValue(1,0.992987962841)
16647          self.failUnless(isinstance(res,Data),"wrong type of result.")
16648          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16649          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16650       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16651       def test_maxval_taggedData_rank4(self):
16652          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)
16653          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]]]]))
16654          res=maxval(arg)
16655          ref=Data(0.992159926925,self.functionspace)
16656          ref.setTaggedValue(1,0.999331534245)
16657          self.failUnless(isinstance(res,Data),"wrong type of result.")
16658          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16659          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16660       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16661       def test_minval_taggedData_rank0(self):
16662          arg=Data(0.00722788253378,self.functionspace)
16663          arg.setTaggedValue(1,0.691024712935)
16664          res=minval(arg)
16665          ref=Data(0.00722788253378,self.functionspace)
16666          ref.setTaggedValue(1,0.691024712935)
16667          self.failUnless(isinstance(res,Data),"wrong type of result.")
16668          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16669          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16670       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16671       def test_minval_taggedData_rank1(self):
16672          arg=Data(numarray.array([-0.47859075115756422, -0.15003593348682531]),self.functionspace)
16673          arg.setTaggedValue(1,numarray.array([-0.067933816863879004, -0.74579305994260148]))
16674          res=minval(arg)
16675          ref=Data(-0.478590751158,self.functionspace)
16676          ref.setTaggedValue(1,-0.745793059943)
16677          self.failUnless(isinstance(res,Data),"wrong type of result.")
16678          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16679          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16680       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16681       def test_minval_taggedData_rank2(self):
16682          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)
16683          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]]))
16684          res=minval(arg)
16685          ref=Data(-0.963282242318,self.functionspace)
16686          ref.setTaggedValue(1,-0.980329974747)
16687          self.failUnless(isinstance(res,Data),"wrong type of result.")
16688          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16689          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16690       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16691       def test_minval_taggedData_rank3(self):
16692          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)
16693          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]]]))
16694          res=minval(arg)
16695          ref=Data(-0.846582601997,self.functionspace)
16696          ref.setTaggedValue(1,-0.95904548813)
16697          self.failUnless(isinstance(res,Data),"wrong type of result.")
16698          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16699          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16700       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
16701       def test_minval_taggedData_rank4(self):
16702          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)
16703          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]]]]))
16704          res=minval(arg)
16705          ref=Data(-0.997674820866,self.functionspace)
16706          ref.setTaggedValue(1,-0.971190410568)
16707          self.failUnless(isinstance(res,Data),"wrong type of result.")
16708          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
16709          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
16710    
16711  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):
16712     """     """
# Line 60826  class Test_util_overloaded_binary_no_tag Line 61525  class Test_util_overloaded_binary_no_tag
61525        self.failUnless(isinstance(res,Symbol),"wrong type of result.")        self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61526        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
61527        self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61528       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61529       def test_generalTensorProduct_float_rank0_float_rank0_offset0(self):
61530          arg0=-0.816058209277
61531          arg1=-0.334851342127
61532          res=generalTensorProduct(arg0,arg1,offset=0)
61533          ref=0.27325818663014179
61534          self.failUnless(isinstance(res,float),"wrong type of result.")
61535          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61536       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61537       def test_generalTensorProduct_float_rank0_array_rank0_offset0(self):
61538          arg0=-0.0378781468644
61539          arg1=numarray.array(-0.223764515469)
61540          res=generalTensorProduct(arg0,arg1,offset=0)
61541          ref=numarray.array(0.008475785179988933)
61542          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61543          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
61544          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61545       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61546       def test_generalTensorProduct_float_rank0_array_rank1_offset0(self):
61547          arg0=0.543146680723
61548          arg1=numarray.array([-0.92731085296922822, -0.36581780458574942])
61549          res=generalTensorProduct(arg0,arg1,offset=0)
61550          ref=numarray.array([-0.50366581178893521, -0.19869272631023729])
61551          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61552          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
61553          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61554       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61555       def test_generalTensorProduct_float_rank0_array_rank2_offset0(self):
61556          arg0=-0.559404776535
61557          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]])
61558          res=generalTensorProduct(arg0,arg1,offset=0)
61559          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]])
61560          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61561          self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.")
61562          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61563       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61564       def test_generalTensorProduct_float_rank0_array_rank3_offset0(self):
61565          arg0=-0.959498524214
61566          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]]])
61567          res=generalTensorProduct(arg0,arg1,offset=0)
61568          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]]])
61569          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61570          self.failUnlessEqual(res.shape,(6, 2, 2),"wrong shape of result.")
61571          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61572       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61573       def test_generalTensorProduct_float_rank0_array_rank4_offset0(self):
61574          arg0=-0.9304595906
61575          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]]]])
61576          res=generalTensorProduct(arg0,arg1,offset=0)
61577          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]]]])
61578          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61579          self.failUnlessEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.")
61580          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61581       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61582       def test_generalTensorProduct_float_rank0_Symbol_rank0_offset0(self):
61583          arg0=0.562491357932
61584          arg1=Symbol(shape=())
61585          res=generalTensorProduct(arg0,arg1,offset=0)
61586          s1=numarray.array(0.00324768537641)
61587          sub=res.substitute({arg1:s1})
61588          ref=numarray.array(0.0018267949575127625)
61589          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61590          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
61591          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61592       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61593       def test_generalTensorProduct_float_rank0_Symbol_rank1_offset0(self):
61594          arg0=0.91409519904
61595          arg1=Symbol(shape=(2,))
61596          res=generalTensorProduct(arg0,arg1,offset=0)
61597          s1=numarray.array([0.25097568619682953, 0.66141307495224799])
61598          sub=res.substitute({arg1:s1})
61599          ref=numarray.array([0.22941566982832673, 0.60459451639622652])
61600          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61601          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
61602          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61603       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61604       def test_generalTensorProduct_float_rank0_Symbol_rank2_offset0(self):
61605          arg0=-0.311325649398
61606          arg1=Symbol(shape=(4, 5))
61607          res=generalTensorProduct(arg0,arg1,offset=0)
61608          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]])
61609          sub=res.substitute({arg1:s1})
61610          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]])
61611          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61612          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
61613          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61614       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61615       def test_generalTensorProduct_float_rank0_Symbol_rank3_offset0(self):
61616          arg0=0.948217578168
61617          arg1=Symbol(shape=(6, 2, 2))
61618          res=generalTensorProduct(arg0,arg1,offset=0)
61619          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]]])
61620          sub=res.substitute({arg1:s1})
61621          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]]])
61622          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61623          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
61624          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61625       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61626       def test_generalTensorProduct_float_rank0_Symbol_rank4_offset0(self):
61627          arg0=-0.830323568577
61628          arg1=Symbol(shape=(3, 2, 3, 4))
61629          res=generalTensorProduct(arg0,arg1,offset=0)
61630          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]]]])
61631          sub=res.substitute({arg1:s1})
61632          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]]]])
61633          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61634          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
61635          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61636       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61637       def test_generalTensorProduct_float_rank0_constData_rank0_offset0(self):
61638          arg0=0.492353721328
61639          arg1=Data(-0.437214319534,self.functionspace)
61640          res=generalTensorProduct(arg0,arg1,offset=0)
61641          ref=Data(-0.21526409724074577,self.functionspace)
61642          self.failUnless(isinstance(res,Data),"wrong type of result.")
61643          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
61644          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61645       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61646       def test_generalTensorProduct_float_rank0_constData_rank1_offset0(self):
61647          arg0=0.979385563268
61648          arg1=Data(numarray.array([0.22021089255261517, 0.058911120671208295]),self.functionspace)
61649          res=generalTensorProduct(arg0,arg1,offset=0)
61650          ref=Data(numarray.array([0.21567136904043174, 0.057696701101331072]),self.functionspace)
61651          self.failUnless(isinstance(res,Data),"wrong type of result.")
61652          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
61653          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61654       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61655       def test_generalTensorProduct_float_rank0_constData_rank2_offset0(self):
61656          arg0=0.893109236094
61657          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)
61658          res=generalTensorProduct(arg0,arg1,offset=0)
61659          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)
61660          self.failUnless(isinstance(res,Data),"wrong type of result.")
61661          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
61662          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61663       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61664       def test_generalTensorProduct_float_rank0_constData_rank3_offset0(self):
61665          arg0=-0.924871621274
61666          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)
61667          res=generalTensorProduct(arg0,arg1,offset=0)
61668          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)
61669          self.failUnless(isinstance(res,Data),"wrong type of result.")
61670          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
61671          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61672       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61673       def test_generalTensorProduct_float_rank0_constData_rank4_offset0(self):
61674          arg0=-0.654494887933
61675          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)
61676          res=generalTensorProduct(arg0,arg1,offset=0)
61677          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)
61678          self.failUnless(isinstance(res,Data),"wrong type of result.")
61679          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
61680          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61681       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61682       def test_generalTensorProduct_float_rank0_expandedData_rank0_offset0(self):
61683          arg0=0.817315288431
61684          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
61685          arg1=msk_arg1*(-0.107441089832)+(1.-msk_arg1)*(-0.984717408273)
61686          res=generalTensorProduct(arg0,arg1,offset=0)
61687          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
61688          ref=msk_ref*numarray.array(-0.087813245324982178)+(1.-msk_ref)*numarray.array(-0.80482459256581285)
61689          self.failUnless(isinstance(res,Data),"wrong type of result.")
61690          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
61691          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61692       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61693       def test_generalTensorProduct_float_rank0_expandedData_rank1_offset0(self):
61694          arg0=-0.731273459059
61695          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
61696          arg1=msk_arg1*numarray.array([0.32690953465836348, -0.45530172275332514])+(1.-msk_arg1)*numarray.array([-0.88987813857334852, -0.4432112304820599])
61697          res=generalTensorProduct(arg0,arg1,offset=0)
61698          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
61699          ref=msk_ref*numarray.array([-0.23906026620885493, 0.33295006571315844])+(1.-msk_ref)*numarray.array([0.65074426453515033, 0.32410860960822918])
61700          self.failUnless(isinstance(res,Data),"wrong type of result.")
61701          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
61702          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61703       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61704       def test_generalTensorProduct_float_rank0_expandedData_rank2_offset0(self):
61705          arg0=0.360959926398
61706          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
61707          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]])
61708          res=generalTensorProduct(arg0,arg1,offset=0)
61709          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
61710          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]])
61711          self.failUnless(isinstance(res,Data),"wrong type of result.")
61712          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
61713          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61714       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61715       def test_generalTensorProduct_float_rank0_expandedData_rank3_offset0(self):
61716          arg0=0.460701578466
61717          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
61718          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]]])
61719          res=generalTensorProduct(arg0,arg1,offset=0)
61720          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
61721          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]]])
61722          self.failUnless(isinstance(res,Data),"wrong type of result.")
61723          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
61724          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61725       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61726       def test_generalTensorProduct_float_rank0_expandedData_rank4_offset0(self):
61727          arg0=0.784374548175
61728          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
61729          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]]]])
61730          res=generalTensorProduct(arg0,arg1,offset=0)
61731          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
61732          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]]]])
61733          self.failUnless(isinstance(res,Data),"wrong type of result.")
61734          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
61735          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61736       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61737       def test_generalTensorProduct_array_rank0_float_rank0_offset0(self):
61738          arg0=numarray.array(0.429129135575)
61739          arg1=-0.799328581784
61740          res=generalTensorProduct(arg0,arg1,offset=0)
61741          ref=numarray.array(-0.34301518334135217)
61742          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61743          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
61744          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61745       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61746       def test_generalTensorProduct_array_rank0_array_rank0_offset0(self):
61747          arg0=numarray.array(0.546867720148)
61748          arg1=numarray.array(-0.945901917593)
61749          res=generalTensorProduct(arg0,arg1,offset=0)
61750          ref=numarray.array(-0.51728322515706049)
61751          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61752          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
61753          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61754       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61755       def test_generalTensorProduct_array_rank1_array_rank1_offset1(self):
61756          arg0=numarray.array([0.84720838597731163, 0.96761384931609951, -0.34350404065584983])
61757          arg1=numarray.array([0.14254722554740384, 0.38587156635226205, -0.9756326729326732])
61758          res=generalTensorProduct(arg0,arg1,offset=1)
61759          ref=numarray.array(0.82927564188954528)
61760          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61761          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
61762          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61763       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61764       def test_generalTensorProduct_array_rank2_array_rank2_offset2(self):
61765          arg0=numarray.array([[-0.75781563843283184, -0.75850235491912232, -0.81113786053232517], [-0.03044399430833189, -0.84899525253564301, 0.6258693367354744]])
61766          arg1=numarray.array([[-0.10841119021549361, 0.48014833287233638, -0.84646955254583744], [0.52283861134408616, 0.42335269030510125, 0.2326408917305347]])
61767          res=generalTensorProduct(arg0,arg1,offset=2)
61768          ref=numarray.array(0.17482663666982518)
61769          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61770          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
61771          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61772       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61773       def test_generalTensorProduct_array_rank3_array_rank3_offset3(self):
61774          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]]])
61775          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]]])
61776          res=generalTensorProduct(arg0,arg1,offset=3)
61777          ref=numarray.array(-1.2953232993207786)
61778          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61779          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
61780          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61781       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61782       def test_generalTensorProduct_array_rank4_array_rank4_offset4(self):
61783          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]]]])
61784          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]]]])
61785          res=generalTensorProduct(arg0,arg1,offset=4)
61786          ref=numarray.array(-2.4776044528835741)
61787          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61788          self.failUnlessEqual(res.shape,(),"wrong shape of result.")
61789          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61790       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61791       def test_generalTensorProduct_array_rank0_array_rank1_offset0(self):
61792          arg0=numarray.array(0.430018952533)
61793          arg1=numarray.array([0.17405266481347681, 0.12684725858108425])
61794          res=generalTensorProduct(arg0,arg1,offset=0)
61795          ref=numarray.array([0.074845944608683102, 0.054546725266730989])
61796          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61797          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
61798          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61799       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61800       def test_generalTensorProduct_array_rank1_array_rank2_offset1(self):
61801          arg0=numarray.array([-0.2596702139875493, -0.2895735074501018, -0.88211626259666986])
61802          arg1=numarray.array([[-0.95159197241138482, -0.45620300561671234], [0.17942838282450158, 0.46668790449160968], [-0.56794717501757241, 0.81081773034821758]])
61803          res=generalTensorProduct(arg0,arg1,offset=1)
61804          ref=numarray.array([0.69613782433314564, -0.7319136272398028])
61805          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61806          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
61807          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61808       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61809       def test_generalTensorProduct_array_rank2_array_rank3_offset2(self):
61810          arg0=numarray.array([[-0.97489218317706583, -0.045252664981564106, -0.89113304764498258], [-0.3501913135304584, -0.55826461424592799, -0.8654061515474869]])
61811          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]]])
61812          res=generalTensorProduct(arg0,arg1,offset=2)
61813          ref=numarray.array([-0.12730353075159806, 0.29174259527508767])
61814          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61815          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
61816          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61817       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61818       def test_generalTensorProduct_array_rank3_array_rank4_offset3(self):
61819          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]]])
61820          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]]]])
61821          res=generalTensorProduct(arg0,arg1,offset=3)
61822          ref=numarray.array([2.340750975303576, -3.0908910578666107])
61823          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61824          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
61825          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61826       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61827       def test_generalTensorProduct_array_rank0_array_rank2_offset0(self):
61828          arg0=numarray.array(0.563644591)
61829          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]])
61830          res=generalTensorProduct(arg0,arg1,offset=0)
61831          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]])
61832          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61833          self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.")
61834          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61835       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61836       def test_generalTensorProduct_array_rank1_array_rank3_offset1(self):
61837          arg0=numarray.array([-0.055353661857031167, -0.58911500691978236, 0.23067676644596946])
61838          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]]])
61839          res=generalTensorProduct(arg0,arg1,offset=1)
61840          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]])
61841          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61842          self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.")
61843          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61844       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61845       def test_generalTensorProduct_array_rank2_array_rank4_offset2(self):
61846          arg0=numarray.array([[0.44725799816010214, -0.30781810713277391, -0.42095006385057743], [0.23951656502926255, -0.70741474776970859, 0.82912121602278477]])
61847          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]]]])
61848          res=generalTensorProduct(arg0,arg1,offset=2)
61849          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]])
61850          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61851          self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.")
61852          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61853       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61854       def test_generalTensorProduct_array_rank0_array_rank3_offset0(self):
61855          arg0=numarray.array(0.484459788449)
61856          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]]])
61857          res=generalTensorProduct(arg0,arg1,offset=0)
61858          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]]])
61859          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61860          self.failUnlessEqual(res.shape,(6, 2, 2),"wrong shape of result.")
61861          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61862       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61863       def test_generalTensorProduct_array_rank1_array_rank4_offset1(self):
61864          arg0=numarray.array([-0.041265439380634428, -0.54458056973457958, 0.70617486649744965])
61865          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]]]])
61866          res=generalTensorProduct(arg0,arg1,offset=1)
61867          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]]])
61868          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61869          self.failUnlessEqual(res.shape,(6, 2, 2),"wrong shape of result.")
61870          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61871       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61872       def test_generalTensorProduct_array_rank0_array_rank4_offset0(self):
61873          arg0=numarray.array(-0.973401265831)
61874          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]]]])
61875          res=generalTensorProduct(arg0,arg1,offset=0)
61876          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]]]])
61877          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
61878          self.failUnlessEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.")
61879          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61880       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61881       def test_generalTensorProduct_array_rank0_Symbol_rank0_offset0(self):
61882          arg0=numarray.array(-0.957462297702)
61883          arg1=Symbol(shape=())
61884          res=generalTensorProduct(arg0,arg1,offset=0)
61885          s1=numarray.array(-0.559707298165)
61886          sub=res.substitute({arg1:s1})
61887          ref=numarray.array(0.53589863574133045)
61888          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61889          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
61890          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61891       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61892       def test_generalTensorProduct_array_rank1_Symbol_rank1_offset1(self):
61893          arg0=numarray.array([-0.36386467030272707, 0.79053000390700823, 0.49949697175291008])
61894          arg1=Symbol(shape=(3,))
61895          res=generalTensorProduct(arg0,arg1,offset=1)
61896          s1=numarray.array([-0.41668251834151615, -0.84458361932879855, -0.81891948201294307])
61897          sub=res.substitute({arg1:s1})
61898          ref=numarray.array(-0.92510044610547126)
61899          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61900          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
61901          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61902       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61903       def test_generalTensorProduct_array_rank2_Symbol_rank2_offset2(self):
61904          arg0=numarray.array([[0.24921109239870542, 0.070069423064783365, 0.18377777086430602], [-0.62079299114141939, 0.69372333437842615, 0.18995102366798089]])
61905          arg1=Symbol(shape=(2, 3))
61906          res=generalTensorProduct(arg0,arg1,offset=2)
61907          s1=numarray.array([[0.21185241787837517, -0.47522346439650831, 0.15044667792382516], [-0.96445248594758759, 0.24322056182988483, 0.43116514893080304]])
61908          sub=res.substitute({arg1:s1})
61909          ref=numarray.array(0.89649947772901273)
61910          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61911          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
61912          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61913       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61914       def test_generalTensorProduct_array_rank3_Symbol_rank3_offset3(self):
61915          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]]])
61916          arg1=Symbol(shape=(2, 4, 3))
61917          res=generalTensorProduct(arg0,arg1,offset=3)
61918          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]]])
61919          sub=res.substitute({arg1:s1})
61920          ref=numarray.array(-1.185796687546163)
61921          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61922          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
61923          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61924       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61925       def test_generalTensorProduct_array_rank4_Symbol_rank4_offset4(self):
61926          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]]]])
61927          arg1=Symbol(shape=(4, 2, 3, 2))
61928          res=generalTensorProduct(arg0,arg1,offset=4)
61929          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]]]])
61930          sub=res.substitute({arg1:s1})
61931          ref=numarray.array(3.4217241320311644)
61932          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61933          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
61934          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61935       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61936       def test_generalTensorProduct_array_rank0_Symbol_rank1_offset0(self):
61937          arg0=numarray.array(0.108487093181)
61938          arg1=Symbol(shape=(2,))
61939          res=generalTensorProduct(arg0,arg1,offset=0)
61940          s1=numarray.array([0.84138252420927007, -0.92070896817838488])
61941          sub=res.substitute({arg1:s1})
61942          ref=numarray.array([0.091279144304962714, -0.099885039623576935])
61943          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61944          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
61945          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61946       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61947       def test_generalTensorProduct_array_rank1_Symbol_rank2_offset1(self):
61948          arg0=numarray.array([-0.88164918266823733, 0.51849070402116149, 0.21407376222612973])
61949          arg1=Symbol(shape=(3, 2))
61950          res=generalTensorProduct(arg0,arg1,offset=1)
61951          s1=numarray.array([[-0.66753189134297752, 0.63604973587224611], [0.24368306203710977, 0.90997330527638165], [-0.98449387680117129, -0.47340125794576626]])
61952          sub=res.substitute({arg1:s1})
61953          ref=numarray.array([0.5041220407057575, -0.19030281840593222])
61954          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61955          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
61956          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61957       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61958       def test_generalTensorProduct_array_rank2_Symbol_rank3_offset2(self):
61959          arg0=numarray.array([[-0.48368367521376232, 0.30609630853711667, -0.26702652782848735], [0.41384989253050808, -0.50719047280485663, 0.23578081638741089]])
61960          arg1=Symbol(shape=(2, 3, 2))
61961          res=generalTensorProduct(arg0,arg1,offset=2)
61962          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]]])
61963          sub=res.substitute({arg1:s1})
61964          ref=numarray.array([0.079694931224933291, -0.85723771425921702])
61965          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61966          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
61967          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61968       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61969       def test_generalTensorProduct_array_rank3_Symbol_rank4_offset3(self):
61970          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]]])
61971          arg1=Symbol(shape=(2, 4, 3, 2))
61972          res=generalTensorProduct(arg0,arg1,offset=3)
61973          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]]]])
61974          sub=res.substitute({arg1:s1})
61975          ref=numarray.array([-3.1632114345394542, -2.3602881471017327])
61976          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61977          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
61978          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61979       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61980       def test_generalTensorProduct_array_rank0_Symbol_rank2_offset0(self):
61981          arg0=numarray.array(0.455040090646)
61982          arg1=Symbol(shape=(4, 5))
61983          res=generalTensorProduct(arg0,arg1,offset=0)
61984          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]])
61985          sub=res.substitute({arg1:s1})
61986          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]])
61987          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61988          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
61989          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
61990       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61991       def test_generalTensorProduct_array_rank1_Symbol_rank3_offset1(self):
61992          arg0=numarray.array([0.69261168472180512, 0.25365734042241272, 0.84943826521908639])
61993          arg1=Symbol(shape=(3, 4, 5))
61994          res=generalTensorProduct(arg0,arg1,offset=1)
61995          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]]])
61996          sub=res.substitute({arg1:s1})
61997          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]])
61998          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
61999          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62000          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62001       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62002       def test_generalTensorProduct_array_rank2_Symbol_rank4_offset2(self):
62003          arg0=numarray.array([[0.3039031119878608, -0.46902944817620895, -0.44578563165877094], [-0.80408081597354619, 0.25386737228506684, 0.67140851967585236]])
62004          arg1=Symbol(shape=(2, 3, 4, 5))
62005          res=generalTensorProduct(arg0,arg1,offset=2)
62006          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]]]])
62007          sub=res.substitute({arg1:s1})
62008          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]])
62009          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62010          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62011          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62012       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62013       def test_generalTensorProduct_array_rank0_Symbol_rank3_offset0(self):
62014          arg0=numarray.array(0.890045711116)
62015          arg1=Symbol(shape=(6, 2, 2))
62016          res=generalTensorProduct(arg0,arg1,offset=0)
62017          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]]])
62018          sub=res.substitute({arg1:s1})
62019          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]]])
62020          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62021          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
62022          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62023       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62024       def test_generalTensorProduct_array_rank1_Symbol_rank4_offset1(self):
62025          arg0=numarray.array([0.67072802523959729, 0.59461710689684333, -0.16300700133972379])
62026          arg1=Symbol(shape=(3, 6, 2, 2))
62027          res=generalTensorProduct(arg0,arg1,offset=1)
62028          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]]]])
62029          sub=res.substitute({arg1:s1})
62030          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]]])
62031          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62032          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
62033          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62034       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62035       def test_generalTensorProduct_array_rank0_Symbol_rank4_offset0(self):
62036          arg0=numarray.array(-0.400251875744)
62037          arg1=Symbol(shape=(3, 2, 3, 4))
62038          res=generalTensorProduct(arg0,arg1,offset=0)
62039          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]]]])
62040          sub=res.substitute({arg1:s1})
62041          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]]]])
62042          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62043          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
62044          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62045       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62046       def test_generalTensorProduct_array_rank0_constData_rank0_offset0(self):
62047          arg0=numarray.array(0.276030930635)
62048          arg1=Data(0.525251086603,self.functionspace)
62049          res=generalTensorProduct(arg0,arg1,offset=0)
62050          ref=Data(0.14498554625225879,self.functionspace)
62051          self.failUnless(isinstance(res,Data),"wrong type of result.")
62052          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62053          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62054       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62055       def test_generalTensorProduct_array_rank1_constData_rank1_offset1(self):
62056          arg0=numarray.array([0.65548645255509275, 0.37351981102482612, 0.66146316938990646])
62057          arg1=Data(numarray.array([0.35738251475002025, 0.75375267320042005, -0.61347308966363956]),self.functionspace)
62058          res=generalTensorProduct(arg0,arg1,offset=1)
62059          ref=Data(0.11001109862765807,self.functionspace)
62060          self.failUnless(isinstance(res,Data),"wrong type of result.")
62061          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62062          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62063       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62064       def test_generalTensorProduct_array_rank2_constData_rank2_offset2(self):
62065          arg0=numarray.array([[-0.088883398927412705, 0.36597586224843726, 0.74959282604165689], [-0.718337701269115, 0.33607066789476403, 0.59912096183685004]])
62066          arg1=Data(numarray.array([[0.87315550347073834, -0.79911382372503281, 0.79698915770889056], [0.15146867556573818, -0.66249741709046073, 0.63805916366214133]]),self.functionspace)
62067          res=generalTensorProduct(arg0,arg1,offset=2)
62068          ref=Data(0.27817496562025817,self.functionspace)
62069          self.failUnless(isinstance(res,Data),"wrong type of result.")
62070          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62071          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62072       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62073       def test_generalTensorProduct_array_rank3_constData_rank3_offset3(self):
62074          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]]])
62075          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)
62076          res=generalTensorProduct(arg0,arg1,offset=3)
62077          ref=Data(-0.47517867398842628,self.functionspace)
62078          self.failUnless(isinstance(res,Data),"wrong type of result.")
62079          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62080          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62081       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62082       def test_generalTensorProduct_array_rank4_constData_rank4_offset4(self):
62083          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]]]])
62084          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)
62085          res=generalTensorProduct(arg0,arg1,offset=4)
62086          ref=Data(1.0916478580238695,self.functionspace)
62087          self.failUnless(isinstance(res,Data),"wrong type of result.")
62088          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62089          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62090       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62091       def test_generalTensorProduct_array_rank0_constData_rank1_offset0(self):
62092          arg0=numarray.array(-0.259974017677)
62093          arg1=Data(numarray.array([-0.044411300170266399, -0.8714302585888849]),self.functionspace)
62094          res=generalTensorProduct(arg0,arg1,offset=0)
62095          ref=Data(numarray.array([0.011545784135536585, 0.22654922545091835]),self.functionspace)
62096          self.failUnless(isinstance(res,Data),"wrong type of result.")
62097          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62098          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62099       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62100       def test_generalTensorProduct_array_rank1_constData_rank2_offset1(self):
62101          arg0=numarray.array([0.25002746419177746, 0.56003262174718937, -0.38411653061655926])
62102          arg1=Data(numarray.array([[-0.25220197912710396, -0.51956798157298234], [-0.92297279746096805, -0.36259445263568946], [-0.45338691929511876, -0.038077564179096912]]),self.functionspace)
62103          res=generalTensorProduct(arg0,arg1,offset=1)
62104          ref=Data(numarray.array([-0.40579888640212991, -0.31834476500168113]),self.functionspace)
62105          self.failUnless(isinstance(res,Data),"wrong type of result.")
62106          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62107          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62108       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62109       def test_generalTensorProduct_array_rank2_constData_rank3_offset2(self):
62110          arg0=numarray.array([[0.80780440839221423, -0.29207184993427804, 0.47539604196932705], [-0.32342927832232093, 0.36904363909067373, 0.17617657281137911]])
62111          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)
62112          res=generalTensorProduct(arg0,arg1,offset=2)
62113          ref=Data(numarray.array([0.37481049227597868, -0.27872493940663351]),self.functionspace)
62114          self.failUnless(isinstance(res,Data),"wrong type of result.")
62115          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62116          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62117       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62118       def test_generalTensorProduct_array_rank3_constData_rank4_offset3(self):
62119          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]]])
62120          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)
62121          res=generalTensorProduct(arg0,arg1,offset=3)
62122          ref=Data(numarray.array([-0.58464390506716768, 2.647960905222289]),self.functionspace)
62123          self.failUnless(isinstance(res,Data),"wrong type of result.")
62124          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62125          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62126       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62127       def test_generalTensorProduct_array_rank0_constData_rank2_offset0(self):
62128          arg0=numarray.array(-0.544185299417)
62129          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)
62130          res=generalTensorProduct(arg0,arg1,offset=0)
62131          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)
62132          self.failUnless(isinstance(res,Data),"wrong type of result.")
62133          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62134          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62135       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62136       def test_generalTensorProduct_array_rank1_constData_rank3_offset1(self):
62137          arg0=numarray.array([0.80321090298129461, 0.75733336332953161, -0.43955933605807429])
62138          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)
62139          res=generalTensorProduct(arg0,arg1,offset=1)
62140          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)
62141          self.failUnless(isinstance(res,Data),"wrong type of result.")
62142          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62143          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62144       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62145       def test_generalTensorProduct_array_rank2_constData_rank4_offset2(self):
62146          arg0=numarray.array([[-0.11565043696176636, -0.25516973814347077, -0.54480447818461442], [0.68830407667880444, -0.30647666874713475, -0.013222647666291332]])
62147          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)
62148          res=generalTensorProduct(arg0,arg1,offset=2)
62149          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)
62150          self.failUnless(isinstance(res,Data),"wrong type of result.")
62151          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62152          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62153       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62154       def test_generalTensorProduct_array_rank0_constData_rank3_offset0(self):
62155          arg0=numarray.array(0.729161045519)
62156          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)
62157          res=generalTensorProduct(arg0,arg1,offset=0)
62158          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)
62159          self.failUnless(isinstance(res,Data),"wrong type of result.")
62160          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
62161          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62162       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62163       def test_generalTensorProduct_array_rank1_constData_rank4_offset1(self):
62164          arg0=numarray.array([0.094563644000015712, -0.40340577007888978, 0.37726109420617804])
62165          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)
62166          res=generalTensorProduct(arg0,arg1,offset=1)
62167          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)
62168          self.failUnless(isinstance(res,Data),"wrong type of result.")
62169          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
62170          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62171       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62172       def test_generalTensorProduct_array_rank0_constData_rank4_offset0(self):
62173          arg0=numarray.array(0.170303473899)
62174          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)
62175          res=generalTensorProduct(arg0,arg1,offset=0)
62176          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)
62177          self.failUnless(isinstance(res,Data),"wrong type of result.")
62178          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
62179          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62180       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62181       def test_generalTensorProduct_array_rank0_expandedData_rank0_offset0(self):
62182          arg0=numarray.array(-0.501038685672)
62183          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62184          arg1=msk_arg1*(-0.37497860758)+(1.-msk_arg1)*(0.886271009021)
62185          res=generalTensorProduct(arg0,arg1,offset=0)
62186          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62187          ref=msk_ref*numarray.array(0.18787878869669156)+(1.-msk_ref)*numarray.array(-0.44405606150884158)
62188          self.failUnless(isinstance(res,Data),"wrong type of result.")
62189          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62190          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62191       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62192       def test_generalTensorProduct_array_rank1_expandedData_rank1_offset1(self):
62193          arg0=numarray.array([0.44038262808839268, -0.80364141181592696, -0.35078298317395173])
62194          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62195          arg1=msk_arg1*numarray.array([0.71915786866679077, -0.24226928051609842, -0.52239122903446766])+(1.-msk_arg1)*numarray.array([0.80851332796867226, 0.23987618213601136, 0.93431506683977128])
62196          res=generalTensorProduct(arg0,arg1,offset=1)
62197          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62198          ref=msk_ref*numarray.array(0.69464821255213227)+(1.-msk_ref)*numarray.array(-0.16446103582788724)
62199          self.failUnless(isinstance(res,Data),"wrong type of result.")
62200          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62201          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62202       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62203       def test_generalTensorProduct_array_rank2_expandedData_rank2_offset2(self):
62204          arg0=numarray.array([[-0.70824728644205526, -0.12630675377204637, 0.4347607103368023], [-0.89056712613274125, 0.010820129422368874, -0.90039689321841987]])
62205          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62206          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]])
62207          res=generalTensorProduct(arg0,arg1,offset=2)
62208          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62209          ref=msk_ref*numarray.array(-0.8118034424514643)+(1.-msk_ref)*numarray.array(-1.1456877747602543)
62210          self.failUnless(isinstance(res,Data),"wrong type of result.")
62211          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62212          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62213       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62214       def test_generalTensorProduct_array_rank3_expandedData_rank3_offset3(self):
62215          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]]])
62216          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62217          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]]])
62218          res=generalTensorProduct(arg0,arg1,offset=3)
62219          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62220          ref=msk_ref*numarray.array(-0.77220523654832762)+(1.-msk_ref)*numarray.array(1.497391405841505)
62221          self.failUnless(isinstance(res,Data),"wrong type of result.")
62222          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62223          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62224       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62225       def test_generalTensorProduct_array_rank4_expandedData_rank4_offset4(self):
62226          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]]]])
62227          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62228          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]]]])
62229          res=generalTensorProduct(arg0,arg1,offset=4)
62230          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62231          ref=msk_ref*numarray.array(-0.13645802998092274)+(1.-msk_ref)*numarray.array(-0.3226720375795763)
62232          self.failUnless(isinstance(res,Data),"wrong type of result.")
62233          self.failUnlessEqual(res.getShape(),(),"wrong shape of result.")
62234          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62235       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62236       def test_generalTensorProduct_array_rank0_expandedData_rank1_offset0(self):
62237          arg0=numarray.array(-0.874708255678)
62238          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62239          arg1=msk_arg1*numarray.array([0.14654086700981339, 0.29310796739100886])+(1.-msk_arg1)*numarray.array([-0.9215158534245409, -0.30896457872014915])
62240          res=generalTensorProduct(arg0,arg1,offset=0)
62241          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62242          ref=msk_ref*numarray.array([-0.1281805061677056, -0.25638395888193338])+(1.-msk_ref)*numarray.array([0.80605752472866621, 0.27025386771861076])
62243          self.failUnless(isinstance(res,Data),"wrong type of result.")
62244          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62245          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62246       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62247       def test_generalTensorProduct_array_rank1_expandedData_rank2_offset1(self):
62248          arg0=numarray.array([0.2892485283016033, -0.20014935288134739, 0.087006388727603357])
62249          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62250          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]])
62251          res=generalTensorProduct(arg0,arg1,offset=1)
62252          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62253          ref=msk_ref*numarray.array([0.1478271281060469, -0.25905799210082081])+(1.-msk_ref)*numarray.array([0.0089970234678914754, 0.17628595431432692])
62254          self.failUnless(isinstance(res,Data),"wrong type of result.")
62255          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62256          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62257       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62258       def test_generalTensorProduct_array_rank2_expandedData_rank3_offset2(self):
62259          arg0=numarray.array([[-0.3779633899829653, -0.88393082872430706, -0.31590593488209229], [-0.027735783300006034, 0.18453001551873927, -0.38062223999076217]])
62260          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62261          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]]])
62262          res=generalTensorProduct(arg0,arg1,offset=2)
62263          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62264          ref=msk_ref*numarray.array([-0.050687863928685628, 0.35918123517652517])+(1.-msk_ref)*numarray.array([-0.2853759841192921, -1.3975229289751401])
62265          self.failUnless(isinstance(res,Data),"wrong type of result.")
62266          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62267          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62268       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62269       def test_generalTensorProduct_array_rank3_expandedData_rank4_offset3(self):
62270          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]]])
62271          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62272          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]]]])
62273          res=generalTensorProduct(arg0,arg1,offset=3)
62274          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62275          ref=msk_ref*numarray.array([-2.5499534018495988, -0.3528016548882395])+(1.-msk_ref)*numarray.array([0.38566076603801253, 0.3178879452215792])
62276          self.failUnless(isinstance(res,Data),"wrong type of result.")
62277          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62278          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62279       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62280       def test_generalTensorProduct_array_rank0_expandedData_rank2_offset0(self):
62281          arg0=numarray.array(0.246720077242)
62282          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62283          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]])
62284          res=generalTensorProduct(arg0,arg1,offset=0)
62285          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62286          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]])
62287          self.failUnless(isinstance(res,Data),"wrong type of result.")
62288          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62289          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62290       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62291       def test_generalTensorProduct_array_rank1_expandedData_rank3_offset1(self):
62292          arg0=numarray.array([-0.45898756380933037, 0.88983535078897669, -0.93601582386512105])
62293          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62294          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]]])
62295          res=generalTensorProduct(arg0,arg1,offset=1)
62296          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62297          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]])
62298          self.failUnless(isinstance(res,Data),"wrong type of result.")
62299          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62300          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62301       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62302       def test_generalTensorProduct_array_rank2_expandedData_rank4_offset2(self):
62303          arg0=numarray.array([[-0.15567837122009331, -0.99458185572550151, -0.33226843547045659], [0.92930130927476728, -0.37142212420915421, -0.96245710875878232]])
62304          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62305          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]]]])
62306          res=generalTensorProduct(arg0,arg1,offset=2)
62307          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62308          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]])
62309          self.failUnless(isinstance(res,Data),"wrong type of result.")
62310          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62311          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62312       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62313       def test_generalTensorProduct_array_rank0_expandedData_rank3_offset0(self):
62314          arg0=numarray.array(0.397935405161)
62315          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62316          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]]])
62317          res=generalTensorProduct(arg0,arg1,offset=0)
62318          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62319          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]]])
62320          self.failUnless(isinstance(res,Data),"wrong type of result.")
62321          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
62322          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62323       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62324       def test_generalTensorProduct_array_rank1_expandedData_rank4_offset1(self):
62325          arg0=numarray.array([0.58094125486846315, -0.70531568726399341, 0.33962817234815112])
62326          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62327          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]]]])
62328          res=generalTensorProduct(arg0,arg1,offset=1)
62329          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62330          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]]])
62331          self.failUnless(isinstance(res,Data),"wrong type of result.")
62332          self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.")
62333          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62334       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62335       def test_generalTensorProduct_array_rank0_expandedData_rank4_offset0(self):
62336          arg0=numarray.array(0.230590279322)
62337          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62338          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]]]])
62339          res=generalTensorProduct(arg0,arg1,offset=0)
62340          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62341          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]]]])
62342          self.failUnless(isinstance(res,Data),"wrong type of result.")
62343          self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
62344          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62345       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62346       def test_generalTensorProduct_array_rank1_float_rank0_offset0(self):
62347          arg0=numarray.array([-0.27625195823531112, -0.75078696241622422])
62348          arg1=0.427691913345
62349          res=generalTensorProduct(arg0,arg1,offset=0)
62350          ref=numarray.array([-0.11815072858291316, -0.32110551247013941])
62351          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62352          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
62353          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62354       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62355       def test_generalTensorProduct_array_rank1_array_rank0_offset0(self):
62356          arg0=numarray.array([0.53938078068318251, -0.49824063116272055])
62357          arg1=numarray.array(-0.832775572875)
62358          res=generalTensorProduct(arg0,arg1,offset=0)
62359          ref=numarray.array([-0.44918313863132658, 0.41492262704625121])
62360          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62361          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
62362          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62363       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62364       def test_generalTensorProduct_array_rank2_array_rank1_offset1(self):
62365          arg0=numarray.array([[0.88539183799797438, -0.40982751242758342, 0.59340415310638051], [0.2778157681814577, -0.15842581033003245, 0.36342429966143941]])
62366          arg1=numarray.array([0.20672442496420129, -0.34180190599784144, -0.54398285808314895])
62367          res=generalTensorProduct(arg0,arg1,offset=1)
62368          ref=numarray.array([0.00031025625101116505, -0.08611504037333928])
62369          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62370          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
62371          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62372       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62373       def test_generalTensorProduct_array_rank3_array_rank2_offset2(self):
62374          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]]])
62375          arg1=numarray.array([[-0.88221591813325406, 0.93087345105456332, 0.10605621958128308], [-0.33744894794646707, -0.50807432404282804, -0.69305432358433916]])
62376          res=generalTensorProduct(arg0,arg1,offset=2)
62377          ref=numarray.array([1.1081637895104819, 0.36505080704249099])
62378          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62379          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
62380          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62381       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62382       def test_generalTensorProduct_array_rank4_array_rank3_offset3(self):
62383          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]]]])
62384          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]]])
62385          res=generalTensorProduct(arg0,arg1,offset=3)
62386          ref=numarray.array([1.4862950482934913, -0.348605050085871])
62387          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62388          self.failUnlessEqual(res.shape,(2,),"wrong shape of result.")
62389          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62390       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62391       def test_generalTensorProduct_array_rank1_array_rank1_offset0(self):
62392          arg0=numarray.array([-0.86119269783132357, 0.70989525090873573])
62393          arg1=numarray.array([-0.94133810017909458, 0.23299903772206854])
62394          res=generalTensorProduct(arg0,arg1,offset=0)
62395          ref=numarray.array([[0.81067349806464717, -0.20065706988797052], [-0.66825144681659099, 0.16540491034520183]])
62396          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62397          self.failUnlessEqual(res.shape,(2, 2),"wrong shape of result.")
62398          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62399       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62400       def test_generalTensorProduct_array_rank2_array_rank2_offset1(self):
62401          arg0=numarray.array([[-0.55121571333120323, 0.96947139195929588, -0.29668652541182272], [-0.48483467722216389, -0.68798570197690379, 0.086192052612611647]])
62402          arg1=numarray.array([[-0.039211707293509868, 0.727938931848223], [0.37579996279226902, 0.30903452193668368], [0.57623481940432675, -0.35460484107182633]])
62403          res=generalTensorProduct(arg0,arg1,offset=1)
62404          ref=numarray.array([[0.21498031584282018, 0.0035552287569717012], [-0.18986694388423817, -0.59610548868813584]])
62405          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62406          self.failUnlessEqual(res.shape,(2, 2),"wrong shape of result.")
62407          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62408       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62409       def test_generalTensorProduct_array_rank3_array_rank3_offset2(self):
62410          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]]])
62411          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]]])
62412          res=generalTensorProduct(arg0,arg1,offset=2)
62413          ref=numarray.array([[0.62202141735356897, -0.15400176785301534], [0.065187568504999405, 0.26265633877401284]])
62414          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62415          self.failUnlessEqual(res.shape,(2, 2),"wrong shape of result.")
62416          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62417       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62418       def test_generalTensorProduct_array_rank4_array_rank4_offset3(self):
62419          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]]]])
62420          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]]]])
62421          res=generalTensorProduct(arg0,arg1,offset=3)
62422          ref=numarray.array([[3.1323213977016477, -0.058175766091763288], [-0.6373593664946231, 1.4879611045290597]])
62423          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62424          self.failUnlessEqual(res.shape,(2, 2),"wrong shape of result.")
62425          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62426       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62427       def test_generalTensorProduct_array_rank1_array_rank2_offset0(self):
62428          arg0=numarray.array([-0.2829757697975257, -0.9280442578646535])
62429          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]])
62430          res=generalTensorProduct(arg0,arg1,offset=0)
62431          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]]])
62432          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62433          self.failUnlessEqual(res.shape,(2, 4, 5),"wrong shape of result.")
62434          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62435       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62436       def test_generalTensorProduct_array_rank2_array_rank3_offset1(self):
62437          arg0=numarray.array([[0.88719262810266786, -0.85937267417991481, 0.73515009090045735], [-0.23577510922465361, 0.6157923906886702, -0.93175714362701467]])
62438          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]]])
62439          res=generalTensorProduct(arg0,arg1,offset=1)
62440          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]]])
62441          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62442          self.failUnlessEqual(res.shape,(2, 4, 5),"wrong shape of result.")
62443          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62444       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62445       def test_generalTensorProduct_array_rank3_array_rank4_offset2(self):
62446          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]]])
62447          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]]]])
62448          res=generalTensorProduct(arg0,arg1,offset=2)
62449          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]]])
62450          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62451          self.failUnlessEqual(res.shape,(2, 4, 5),"wrong shape of result.")
62452          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62453       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62454       def test_generalTensorProduct_array_rank1_array_rank3_offset0(self):
62455          arg0=numarray.array([-0.10853748989477352, 0.27834309849207006])
62456          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]]])
62457          res=generalTensorProduct(arg0,arg1,offset=0)
62458          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]]]])
62459          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62460          self.failUnlessEqual(res.shape,(2, 6, 2, 2),"wrong shape of result.")
62461          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62462       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62463       def test_generalTensorProduct_array_rank2_array_rank4_offset1(self):
62464          arg0=numarray.array([[0.0078035188859546523, -0.85228540660692742, -0.67849544792883698], [0.15092314754829839, 0.49233214806070325, 0.093137282528565013]])
62465          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]]]])
62466          res=generalTensorProduct(arg0,arg1,offset=1)
62467          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]]]])
62468          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62469          self.failUnlessEqual(res.shape,(2, 6, 2, 2),"wrong shape of result.")
62470          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62471       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62472       def test_generalTensorProduct_array_rank1_Symbol_rank0_offset0(self):
62473          arg0=numarray.array([-0.36050666921258179, -0.043413969575951894])
62474          arg1=Symbol(shape=())
62475          res=generalTensorProduct(arg0,arg1,offset=0)
62476          s1=numarray.array(-0.0160703058462)
62477          sub=res.substitute({arg1:s1})
62478          ref=numarray.array([0.0057934524338569549, 0.00069767576908508482])
62479          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62480          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62481          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62482       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62483       def test_generalTensorProduct_array_rank2_Symbol_rank1_offset1(self):
62484          arg0=numarray.array([[0.77607716220803979, -0.99594136800213739, -0.96448610306306004], [0.48337776457661419, -0.90884666590234664, 0.90716223281288966]])
62485          arg1=Symbol(shape=(3,))
62486          res=generalTensorProduct(arg0,arg1,offset=1)
62487          s1=numarray.array([-0.28627301517467196, 0.95051276753062108, -0.26521491840056299])
62488          sub=res.substitute({arg1:s1})
62489          ref=numarray.array([-0.91302883210909636, -1.2428413273531005])
62490          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62491          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62492          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62493       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62494       def test_generalTensorProduct_array_rank3_Symbol_rank2_offset2(self):
62495          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]]])
62496          arg1=Symbol(shape=(2, 3))
62497          res=generalTensorProduct(arg0,arg1,offset=2)
62498          s1=numarray.array([[0.08210650131697439, 0.85672069216400626, 0.1044751096001153], [0.33964493465944301, 0.97118542067270508, 0.24346151848231123]])
62499          sub=res.substitute({arg1:s1})
62500          ref=numarray.array([0.22584862671430195, 0.71628952127448364])
62501          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62502          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62503          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62504       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62505       def test_generalTensorProduct_array_rank4_Symbol_rank3_offset3(self):
62506          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]]]])
62507          arg1=Symbol(shape=(2, 4, 3))
62508          res=generalTensorProduct(arg0,arg1,offset=3)
62509          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]]])
62510          sub=res.substitute({arg1:s1})
62511          ref=numarray.array([-2.9911419496760034, 0.81581298487748888])
62512          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62513          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62514          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62515       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62516       def test_generalTensorProduct_array_rank1_Symbol_rank1_offset0(self):
62517          arg0=numarray.array([0.15159051577085525, 0.075625057793151873])
62518          arg1=Symbol(shape=(2,))
62519          res=generalTensorProduct(arg0,arg1,offset=0)
62520          s1=numarray.array([-0.52448466453461906, 0.63688849231133648])
62521          sub=res.substitute({arg1:s1})
62522          ref=numarray.array([[-0.079506900810706896, 0.09654625503799788], [-0.039664183067052439, 0.048164729038838186]])
62523          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62524          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62525          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62526       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62527       def test_generalTensorProduct_array_rank2_Symbol_rank2_offset1(self):
62528          arg0=numarray.array([[0.24388178473861255, 0.15637170047183457, 0.28365657045737191], [-0.44590736256655195, 0.81338818922856326, 0.53028641533895837]])
62529          arg1=Symbol(shape=(3, 2))
62530          res=generalTensorProduct(arg0,arg1,offset=1)
62531          s1=numarray.array([[-0.025834489874195121, 0.03199833701523791], [0.36562987923660306, -0.053737830634191575], [0.93443335628854807, 0.13250150309657216]])
62532          sub=res.substitute({arg1:s1})
62533          ref=numarray.array([[0.31593176562698988, 0.036985657532828349], [0.80443612952257926, 0.012285736286508434]])
62534          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62535          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62536          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62537       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62538       def test_generalTensorProduct_array_rank3_Symbol_rank3_offset2(self):
62539          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]]])
62540          arg1=Symbol(shape=(2, 3, 2))
62541          res=generalTensorProduct(arg0,arg1,offset=2)
62542          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]]])
62543          sub=res.substitute({arg1:s1})
62544          ref=numarray.array([[0.12797839044236509, 0.95433679191757426], [-0.59491752926979713, 0.40403149084354251]])
62545          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62546          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62547          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62548       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62549       def test_generalTensorProduct_array_rank4_Symbol_rank4_offset3(self):
62550          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]]]])
62551          arg1=Symbol(shape=(2, 4, 3, 2))
62552          res=generalTensorProduct(arg0,arg1,offset=3)
62553          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]]]])
62554          sub=res.substitute({arg1:s1})
62555          ref=numarray.array([[1.9385852650867614, -0.47494800748598132], [0.9144289552774485, -2.1243775217119816]])
62556          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62557          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62558          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62559       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62560       def test_generalTensorProduct_array_rank1_Symbol_rank2_offset0(self):
62561          arg0=numarray.array([0.30166435952651804, -0.42256409011527007])
62562          arg1=Symbol(shape=(4, 5))
62563          res=generalTensorProduct(arg0,arg1,offset=0)
62564          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]])
62565          sub=res.substitute({arg1:s1})
62566          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]]])
62567          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62568          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
62569          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62570       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62571       def test_generalTensorProduct_array_rank2_Symbol_rank3_offset1(self):
62572          arg0=numarray.array([[-0.72102873213880825, 0.94977404572871227, -0.67687789450781666], [-0.83767281947448824, -0.82821901004659848, 0.63145092311017903]])
62573          arg1=Symbol(shape=(3, 4, 5))
62574          res=generalTensorProduct(arg0,arg1,offset=1)
62575          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]]])
62576          sub=res.substitute({arg1:s1})
62577          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]]])
62578          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62579          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
62580          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62581       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62582       def test_generalTensorProduct_array_rank3_Symbol_rank4_offset2(self):
62583          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]]])
62584          arg1=Symbol(shape=(2, 3, 4, 5))
62585          res=generalTensorProduct(arg0,arg1,offset=2)
62586          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]]]])
62587          sub=res.substitute({arg1:s1})
62588          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]]])
62589          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62590          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
62591          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62592       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62593       def test_generalTensorProduct_array_rank1_Symbol_rank3_offset0(self):
62594          arg0=numarray.array([0.83364130451665663, 0.963725923030196])
62595          arg1=Symbol(shape=(6, 2, 2))
62596          res=generalTensorProduct(arg0,arg1,offset=0)
62597          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]]])
62598          sub=res.substitute({arg1:s1})
62599          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]]]])
62600          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62601          self.failUnlessEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")
62602          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62603       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62604       def test_generalTensorProduct_array_rank2_Symbol_rank4_offset1(self):
62605          arg0=numarray.array([[0.28720169174230659, -0.93521276442752277, 0.88082216045026929], [0.33901224963528165, -0.49844209506510206, -0.91178566313768172]])
62606          arg1=Symbol(shape=(3, 6, 2, 2))
62607          res=generalTensorProduct(arg0,arg1,offset=1)
62608          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]]]])
62609          sub=res.substitute({arg1:s1})
62610          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]]]])
62611          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62612          self.failUnlessEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")
62613          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62614       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62615       def test_generalTensorProduct_array_rank1_constData_rank0_offset0(self):
62616          arg0=numarray.array([0.6160768652045161, -0.19852491943844375])
62617          arg1=Data(-0.127743684549,self.functionspace)
62618          res=generalTensorProduct(arg0,arg1,offset=0)
62619          ref=Data(numarray.array([-0.07869992872685018, 0.025360304683933566]),self.functionspace)
62620          self.failUnless(isinstance(res,Data),"wrong type of result.")
62621          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62622          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62623       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62624       def test_generalTensorProduct_array_rank2_constData_rank1_offset1(self):
62625          arg0=numarray.array([[-0.147330786554285, 0.75868746628337624, 0.91276304020295584], [0.86195142670321001, 0.82026307789735986, 0.51850854945729585]])
62626          arg1=Data(numarray.array([-0.032130921017267999, 0.97480750910482583, -0.41846172877515819]),self.functionspace)
62627          res=generalTensorProduct(arg0,arg1,offset=1)
62628          ref=Data(numarray.array([0.36235171329753918, 0.5549273305730611]),self.functionspace)
62629          self.failUnless(isinstance(res,Data),"wrong type of result.")
62630          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62631          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62632       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62633       def test_generalTensorProduct_array_rank3_constData_rank2_offset2(self):
62634          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]]])
62635          arg1=Data(numarray.array([[-0.8421427135254449, -0.074943382571228456, 0.064562133179139058], [-0.01557261982862479, -0.95681115206026246, 0.64051923923966125]]),self.functionspace)
62636          res=generalTensorProduct(arg0,arg1,offset=2)
62637          ref=Data(numarray.array([-0.31370996966656212, 0.41621626444562154]),self.functionspace)
62638          self.failUnless(isinstance(res,Data),"wrong type of result.")
62639          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62640          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62641       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62642       def test_generalTensorProduct_array_rank4_constData_rank3_offset3(self):
62643          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]]]])
62644          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)
62645          res=generalTensorProduct(arg0,arg1,offset=3)
62646          ref=Data(numarray.array([-0.13438557714464205, 0.57095048620887479]),self.functionspace)
62647          self.failUnless(isinstance(res,Data),"wrong type of result.")
62648          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62649          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62650       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62651       def test_generalTensorProduct_array_rank1_constData_rank1_offset0(self):
62652          arg0=numarray.array([0.77222220157677213, 0.20023484376496881])
62653          arg1=Data(numarray.array([-0.87513477210940049, 0.78642316309113269]),self.functionspace)
62654          res=generalTensorProduct(arg0,arg1,offset=0)
62655          ref=Data(numarray.array([[-0.67579850039470801, 0.60729342637320338], [-0.1752324743666174, 0.15746931919470553]]),self.functionspace)
62656          self.failUnless(isinstance(res,Data),"wrong type of result.")
62657          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62658          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62659       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62660       def test_generalTensorProduct_array_rank2_constData_rank2_offset1(self):
62661          arg0=numarray.array([[-0.71122442013988474, -0.88620202081667698, 0.81296611964484011], [0.26644445696728636, -0.39083505585295297, 0.66205348878542747]])
62662          arg1=Data(numarray.array([[0.50771144562442871, 0.78794870667652761], [0.044324453513875151, 0.67905968686319507], [0.15625523908072414, 0.72252988978874555]]),self.functionspace)
62663          res=generalTensorProduct(arg0,arg1,offset=1)
62664          ref=Data(numarray.array([[-0.27334698339857488, -0.57480010793031822], [0.22140267633512434, 0.4228976689122268]]),self.functionspace)
62665          self.failUnless(isinstance(res,Data),"wrong type of result.")
62666          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62667          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62668       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62669       def test_generalTensorProduct_array_rank3_constData_rank3_offset2(self):
62670          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]]])
62671          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)
62672          res=generalTensorProduct(arg0,arg1,offset=2)
62673          ref=Data(numarray.array([[1.1328567408737318, -0.30374365715880441], [-0.42994593424502503, -0.757985932157905]]),self.functionspace)
62674          self.failUnless(isinstance(res,Data),"wrong type of result.")
62675          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62676          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62677       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62678       def test_generalTensorProduct_array_rank4_constData_rank4_offset3(self):
62679          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]]]])
62680          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)
62681          res=generalTensorProduct(arg0,arg1,offset=3)
62682          ref=Data(numarray.array([[-3.5513232696205592, 0.21335526423937778], [0.32119253058626618, 0.84439863121792413]]),self.functionspace)
62683          self.failUnless(isinstance(res,Data),"wrong type of result.")
62684          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62685          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62686       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62687       def test_generalTensorProduct_array_rank1_constData_rank2_offset0(self):
62688          arg0=numarray.array([-0.37433185500928889, -0.13004333795062428])
62689          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)
62690          res=generalTensorProduct(arg0,arg1,offset=0)
62691          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)
62692          self.failUnless(isinstance(res,Data),"wrong type of result.")
62693          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
62694          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62695       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62696       def test_generalTensorProduct_array_rank2_constData_rank3_offset1(self):
62697          arg0=numarray.array([[-0.49270204786421656, -0.42569639943642756, -0.52266174672625332], [0.65559150000470723, 0.81341516784513201, -0.11832324769855895]])
62698          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)
62699          res=generalTensorProduct(arg0,arg1,offset=1)
62700          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)
62701          self.failUnless(isinstance(res,Data),"wrong type of result.")
62702          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
62703          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62704       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62705       def test_generalTensorProduct_array_rank3_constData_rank4_offset2(self):
62706          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]]])
62707          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)
62708          res=generalTensorProduct(arg0,arg1,offset=2)
62709          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)
62710          self.failUnless(isinstance(res,Data),"wrong type of result.")
62711          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
62712          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62713       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62714       def test_generalTensorProduct_array_rank1_constData_rank3_offset0(self):
62715          arg0=numarray.array([0.67427786450132854, 0.35682159762611643])
62716          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)
62717          res=generalTensorProduct(arg0,arg1,offset=0)
62718          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)
62719          self.failUnless(isinstance(res,Data),"wrong type of result.")
62720          self.failUnlessEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")
62721          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62722       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62723       def test_generalTensorProduct_array_rank2_constData_rank4_offset1(self):
62724          arg0=numarray.array([[-0.8414171582235519, 0.30176859578095439, 0.58504055830599722], [-0.66736294612972791, 0.85223569442908698, 0.73630544893008509]])
62725          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)
62726          res=generalTensorProduct(arg0,arg1,offset=1)
62727          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)
62728          self.failUnless(isinstance(res,Data),"wrong type of result.")
62729          self.failUnlessEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")
62730          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62731       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62732       def test_generalTensorProduct_array_rank1_expandedData_rank0_offset0(self):
62733          arg0=numarray.array([0.29115487485101577, -0.92058624546831314])
62734          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62735          arg1=msk_arg1*(-0.98690142804)+(1.-msk_arg1)*(-0.76468651016)
62736          res=generalTensorProduct(arg0,arg1,offset=0)
62737          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62738          ref=msk_ref*numarray.array([-0.28734116177116109, 0.90852788028630016])+(1.-msk_ref)*numarray.array([-0.22264220516594166, 0.70395988334860971])
62739          self.failUnless(isinstance(res,Data),"wrong type of result.")
62740          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62741          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62742       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62743       def test_generalTensorProduct_array_rank2_expandedData_rank1_offset1(self):
62744          arg0=numarray.array([[-0.93610562681808984, 0.10378670816956537, -0.6406743208488439], [0.46455866754430919, 0.96760752415530793, 0.46044492106547819]])
62745          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62746          arg1=msk_arg1*numarray.array([-0.87433409270128148, 0.08998261487198489, -0.51239683641173372])+(1.-msk_arg1)*numarray.array([0.38283487176473474, -0.37481589977652274, 0.41164354845062046])
62747          res=generalTensorProduct(arg0,arg1,offset=1)
62748          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62749          ref=msk_ref*numarray.array([1.1560875584597956, -0.55504214679636932])+(1.-msk_ref)*numarray.array([-0.66100423684397858, 0.0047137542931757204])
62750          self.failUnless(isinstance(res,Data),"wrong type of result.")
62751          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62752          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62753       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62754       def test_generalTensorProduct_array_rank3_expandedData_rank2_offset2(self):
62755          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]]])
62756          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62757          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]])
62758          res=generalTensorProduct(arg0,arg1,offset=2)
62759          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62760          ref=msk_ref*numarray.array([-1.8004946559637984, -0.47095315631831763])+(1.-msk_ref)*numarray.array([-1.42030626984827, -0.3877788378780993])
62761          self.failUnless(isinstance(res,Data),"wrong type of result.")
62762          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62763          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62764       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62765       def test_generalTensorProduct_array_rank4_expandedData_rank3_offset3(self):
62766          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]]]])
62767          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62768          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]]])
62769          res=generalTensorProduct(arg0,arg1,offset=3)
62770          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62771          ref=msk_ref*numarray.array([1.1562414069369997, 3.2908847053255363])+(1.-msk_ref)*numarray.array([1.9308237189329767, -1.9001695476925771])
62772          self.failUnless(isinstance(res,Data),"wrong type of result.")
62773          self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.")
62774          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62775       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62776       def test_generalTensorProduct_array_rank1_expandedData_rank1_offset0(self):
62777          arg0=numarray.array([-0.95183416146539646, -0.80840515776198618])
62778          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62779          arg1=msk_arg1*numarray.array([-0.65815107380220117, 0.68239014658138952])+(1.-msk_arg1)*numarray.array([-0.9225185278432928, 0.022234635287948334])
62780          res=generalTensorProduct(arg0,arg1,offset=0)
62781          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62782          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]])
62783          self.failUnless(isinstance(res,Data),"wrong type of result.")
62784          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62785          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62786       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62787       def test_generalTensorProduct_array_rank2_expandedData_rank2_offset1(self):
62788          arg0=numarray.array([[-0.53439976652275312, 0.42037713600795867, -0.86528805366263817], [-0.55963038967778078, 0.95127858496616535, -0.2547752443514979]])
62789          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62790          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]])
62791          res=generalTensorProduct(arg0,arg1,offset=1)
62792          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62793          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]])
62794          self.failUnless(isinstance(res,Data),"wrong type of result.")
62795          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62796          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62797       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62798       def test_generalTensorProduct_array_rank3_expandedData_rank3_offset2(self):
62799          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]]])
62800          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62801          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]]])
62802          res=generalTensorProduct(arg0,arg1,offset=2)
62803          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62804          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]])
62805          self.failUnless(isinstance(res,Data),"wrong type of result.")
62806          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62807          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62808       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62809       def test_generalTensorProduct_array_rank4_expandedData_rank4_offset3(self):
62810          arg0=numarray.array([[[[0.69159689651634126, -0.59090842509553143, -0.43135145353526427], [-0.85755695962978895, 0.90444021996380708, -0.85971361299009419], [-0.53895774793285645, -0.63033054477634431, 0.93428861019956178], [0.12299329903454237, 0.067704742323386302, -0.27868318807727044]], [[0.99523971168037506, 0.46153683557296721, 0.14018910273506258], [0.47703047692507483, 0.0047738926026992257, -0.61741912764866669], [-0.13024185961681045, -0.61232926300550994, 0.76182271590697992], [-0.75209876075994497, -0.055722854973428548, 0.82614719001010628]]], [[[0.7211460891642083, -0.60402768296748111, 0.19368109445438164], [0.42842708432208654, -0.85042559191090095, 0.71018735606345507], [0.097728493743475031, 0.22182769654230383, 0.22868747450683991], [0.54128597637741427, 0.072859757703582329, 0.34631714875160946]], [[-0.018781736926382964, 0.29077138320300411, -0.27523765279888246], [-0.39991690554215475, -0.62511312122452334, -0.4519563441182477], [-0.60815044921226757, -0.069183550613817646, -0.62675461869291582], [0.72475084110073329, 0.1009870909350985, -0.40135913316866278]]]])
62811          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62812          arg1=msk_arg1*numarray.array([[[[0.2714786143168173, 0.7494569218751852], [-0.66840954813273945, 0.68287402737501046], [-0.17185448776577172, 0.11974417099990919]], [[-0.63652796825392732, -0.18008736960253335], [0.11022825302457862, 0.42893403096432747], [0.15732822649890621, 0.50567747478371738]], [[-0.47494751829399262, 0.2856235030976384], [-0.62763151253532956, 0.91680161771086155], [-0.51028314023700272, 0.076092007263474315]], [[0.4826811592122211, -0.59568618450752386], [0.084383931514229849, -0.84335741501559469], [0.56392407045697746, -0.4419053614418329]]], [[[0.34178305372535966, 0.37988220006384266], [-0.36444859447203637, 0.44743991832476659], [-0.59222173620597895, 0.3544596391106376]], [[0.91214344914864065, 0.17010396306962106], [-0.070698214560513284, -0.15767350139424918], [0.24097557183936824, 0.32871436598467896]], [[0.16938731087469905, -0.40674660966800436], [-0.30808827481075385, 0.090452911865188446], [0.96989817308638915, 0.803542905682193]], [[0.14863210698789953, 0.89305106615937846], [0.35120876555130187, -0.88123575553722677], [-0.63118989111319435, -0.58198595823451771]]]])+(1.-msk_arg1)*numarray.array([[[[0.87458542573314046, -0.098393421806612924], [-0.40725192915153463, 0.009187722909765883], [-0.558873701402542, -0.70837118716980885]], [[-0.48202577818102865, -0.70787427447265627], [0.08410603310050635, -0.24362819286110216], [0.93531410068538356, 0.14215059996114543]], [[0.12621712632838156, -0.31731010570612161], [0.28291687010727684, -0.22507048646829197], [-0.12734329148427381, -0.22078847278169911]], [[0.18793670166937293, -0.83923175834671015], [-0.080617779388756361, 0.5576124801275284], [0.62963956354474404, 0.30809329932510576]]], [[[0.25723270353601491, 0.4487530039604215], [-0.86011558828098833, -0.85426775787757525], [-0.11307191256432358, 0.79273833884876765]], [[0.90385519796863312, 0.73123586567713827], [0.89086988761973052, -0.3570581542268696], [0.32624764389976679, 0.46050759704798572]], [[-0.048392477541703727, -0.70402162378852684], [-0.25090355658000663, 0.47577646563708242], [0.37327487480029276, -0.12809825413405895]], [[-0.39890666625614291, 0.036286276831182462], [-0.59226111552599137, 0.91281475180418936], [0.27915607280106447, 0.36341786064335824]]]])
62813          res=generalTensorProduct(arg0,arg1,offset=3)
62814          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62815          ref=msk_ref*numarray.array([[1.8775075843770035, -0.47905670539861511], [-0.20005988227364535, 0.2168358200945118]])+(1.-msk_ref)*numarray.array([[1.3338867513020598, 0.60296320850136587], [-0.4231995710883284, -0.95143894581038047]])
62816          self.failUnless(isinstance(res,Data),"wrong type of result.")
62817          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
62818          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62819       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62820       def test_generalTensorProduct_array_rank1_expandedData_rank2_offset0(self):
62821          arg0=numarray.array([0.27085458013892416, -0.761233747538685])
62822          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62823          arg1=msk_arg1*numarray.array([[0.6282254653676167, 0.66336261818162656, 0.62949010506867231, 0.21983756527088194, -0.31326350691617511], [0.77956086644159073, -0.99825821970040374, 0.93493854035737733, 0.2790104740152819, 0.29948379103350442], [0.27564407792033796, 0.95398663368491876, 0.9341263093207588, 0.30021451148270262, -0.16967946935232336], [0.31228271689270226, 0.26402616536698953, 0.71921859263476384, 0.26667198250776458, -0.33568466803827035]])+(1.-msk_arg1)*numarray.array([[0.98934766013174724, 0.4382220278769926, 0.14132373851055258, -0.9181264274417229, -0.21975962549435457], [0.25330433017376142, -0.48947413745648971, -0.27532084950845359, -0.57884540683316521, 0.71475450532935114], [-0.36891992059617196, 0.10375862551888648, 0.23788354189138938, -0.36142898643368548, -0.81354427867434631], [0.71222029279450783, 0.77225287657191455, -0.88059776034403026, -0.70113739035096301, -0.36845191007242395]])
62824          res=generalTensorProduct(arg0,arg1,offset=0)
62825          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62826          ref=msk_ref*numarray.array([[[0.17015774465472605, 0.17967480342744191, 0.1705002781099825, 0.059544011440208065, -0.084848855638627568], [0.21114763117277299, -0.27038281096718275, 0.25323238580419605, 0.075571264793771381, 0.081116556478793136], [0.074659460992894028, 0.25839164912487433, 0.2530123893077969, 0.081314475459259641, -0.045958461429618992], [0.084583204168615395, 0.071512696166166109, 0.19480364993619689, 0.0722293278569551, -0.090921729820579847]], [[-0.47822642530102522, -0.50497401181547341, -0.47918911171994599, -0.16734777366093373, 0.23846675333691075], [-0.59342803979583636, 0.75990784559383429, -0.71170676879459449, -0.21239218873719792, -0.22797716857552699], [-0.20982957442214417, -0.7262068202617854, -0.71108847111872209, -0.22853341764147328, 0.12916573833544456], [-0.23772014287179397, -0.200985627310582, -0.54749346457086012, -0.2029997126079563, 0.25553449784205196]]])+(1.-msk_ref)*numarray.array([[[0.26796934509641146, 0.11869444336825075, 0.038278181857938826, -0.24867874801917828, -0.059522901094760619], [0.068608637996585564, -0.13257631198963957, -0.07457191309710412, -0.15678292963314169, 0.19359453144338584], [-0.0999236501979614, 0.028103498950709859, 0.064431846860952449, -0.097894696370532802, -0.22035219402476397], [0.19290812837127805, 0.20916822864496235, -0.23851393664925927, -0.18990627348321107, -0.09979688740405103]], [[-0.75312482694071925, -0.33358939653480518, -0.10758039908256511, 0.69890882107576724, 0.16728844327276546], [-0.1928238045259488, 0.37260423197926906, 0.20958352204685446, 0.4406366582891651, -0.54409525066202102], [0.28083429369709806, -0.078984567343204998, -0.18108498007175811, 0.27513194181202294, 0.61929736004392899], [-0.54216612255706265, -0.58786495128036809, 0.67034073318085896, 0.5337294431963574, 0.28047802829221785]]])
62827          self.failUnless(isinstance(res,Data),"wrong type of result.")
62828          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
62829          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62830       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62831       def test_generalTensorProduct_array_rank2_expandedData_rank3_offset1(self):
62832          arg0=numarray.array([[-0.89076447496715128, 0.87539787153488069, -0.10040401630418772], [-0.25888231137033602, 0.79182869856722293, 0.8486492404149617]])
62833          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62834          arg1=msk_arg1*numarray.array([[[-0.37626405022890896, 0.96996241659488214, 0.94083631785676447, -0.92099542792847711, 0.26368361308189292], [0.43428664975305775, -0.87620265780048423, -0.72798638320344189, 0.66417763701402999, 0.94402359908265199], [0.094054914424213765, 0.1471937029183219, 0.39235011388237728, -0.43970283872615146, -0.04329485019665924], [0.35940224977990365, 0.058628951418325359, -0.26082713581151462, -0.39588426044180336, 0.48251663711488191]], [[0.42699452628670831, 0.73526133579421238, 0.0074535182202144501, 0.7358977050430664, 0.41420616604791949], [-0.61509760162490812, -0.03287365325784819, 0.48001982919602892, -0.21258347477212425, 0.50692686551287713], [-0.92898024764680254, 0.46339006253143022, 0.60077609196584447, 0.77471239800208425, -0.088303128751292093], [-0.62436155387923264, 0.026829101469713956, -0.19194167222184166, -0.18133208254937849, 0.1070232588426272]], [[-0.073982856268555386, -0.61868286422325691, 0.62511534846888783, -0.43764632559992767, 0.28456746033414992], [-0.87384441124812962, 0.33875667857850256, 0.76356645553102531, -0.50540072890539967, -0.39118410004169357], [-0.82436572347412151, -0.27538834051902938, 0.47128604617722103, 0.17154171813145647, -0.75370705693781526], [-0.79131104650325312, -0.89551801032584732, 0.17061789795339077, 0.17311122353528119, -0.80920506425741467]]])+(1.-msk_arg1)*numarray.array([[[0.81399836433348072, 0.5947058839640087, 0.50867425514925868, 0.39873844275272075, 0.7361122583014339], [-0.23099084996904362, -0.30322135927946658, 0.73116731166687621, 0.95045192764291508, 0.96195156138762528], [-0.30266035851449447, -0.33895888199980506, 0.37060007508642845, 0.253408385058981, -0.89943390385351862], [0.85793967300136909, -0.94042973915197203, -0.1238173551502737, 0.69292647008265007, -0.061862818777513207]], [[-0.80370283964710154, 0.85859721499155439, -0.7779844476011275, -0.71821682913180851, 0.46337259846731338], [0.3558489867779393, -0.94486824197804609, 0.090922341717106558, 0.61218447849560298, -0.30118565442223022], [-0.61203946346101867, 0.047984184900190963, 0.11361036747760922, 0.68672570877244632, -0.92259914764591811], [0.53556409767576185, -0.16461660440889703, -0.14173554799358912, -0.025171143190497292, 0.51410785190609443]], [[-0.0002342625806208698, -0.16648861823586514, 0.83854711254042535, -0.98909902761303359, 0.58576920173369063], [-0.37775820521221881, -0.23291294112003902, -0.5842470912099258, 0.95077327660807476, 0.54357655306337049], [0.98937229761854972, -0.059928414219934778, 0.76910064285561552, 0.78277084462156865, 0.90591947406928242], [-0.82417099341902267, 0.88840209440649542, 0.36017184168222149, -0.13898180515707104, 0.42690868007998573]]])
62835          res=generalTensorProduct(arg0,arg1,offset=1)
62836          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62837          ref=msk_ref*numarray.array([[[0.71638092452661539, -0.15824360999326934, -0.89430286635995471, 1.5085347422789634, 0.09914348504360701], [-0.83756476228689958, 0.71770014326982645, 0.99200760633972218, -0.72697670243356616, -0.35786353174111246], [-0.81423847841281327, 0.30218584836337525, 0.12910755711589228, 1.0526297750780551, 0.036940359178822747], [-0.7872567244465033, 0.06117515610321185, 0.047179493158585252, 0.17652085418521446, -0.2548733074618581]], [[0.37272913227771742, -0.19394982850253067, 0.2928396946939999, 0.44972612541571561, 0.50121526523451243], [-1.3410684609184069, 0.48828866516505043, 1.2165563666613397, -0.76918148268712483, -0.17496986049363089], [-1.4595397191811474, 0.095111598111981582, 0.7740957917898017, 0.87284954587114494, -0.69834560199487916], [-1.2589758003252762, -0.75391462519685182, 0.060333356770094604, 0.10581419380527256, -0.72690219764715702]]])+(1.-msk_ref)*numarray.array([[[-1.4286170598992811, 0.23858742596012278, -1.2183483832939415, -0.88459800823544776, -0.30888084333824822], [0.55519632980331146, -0.53365143827341344, -0.51304388760445063, -0.40618527841275937, -1.1751068274376888], [-0.36551590056459726, 0.34995483736739474, -0.307883900917791, 0.29683770007251808, -0.097415514640130457], [-0.21264043333801094, 0.60439723934888911, -0.049945595146734065, -0.6253147170560982, 0.46229077451115413]], [[-0.84732355832397188, 0.38461264211045965, -0.036084809447573418, -1.5113291652715284, 0.67345786684874709], [0.020986671318356409, -0.86733653458018867, -0.61311221430016927, 1.0455630660159252, -0.026213859541991513], [0.43335305020987475, 0.07488751030592089, 0.64671482175322148, 1.1424640585123191, 0.27111491912076507], [-0.49746247063807508, 0.86705423552254579, 0.22548340844306392, -0.31726444311671365, 0.785396267887434]]])
62838          self.failUnless(isinstance(res,Data),"wrong type of result.")
62839          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
62840          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62841       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62842       def test_generalTensorProduct_array_rank3_expandedData_rank4_offset2(self):
62843          arg0=numarray.array([[[0.1063401450973509, 0.7347201265110952, 0.77557257223333576], [-0.73542281536299914, -0.28039277069155211, -0.11093720810248753]], [[-0.61993729208668347, -0.061906177645713711, 0.88894013651824588], [0.12260622376961283, 0.49766036507753442, -0.75978333750907545]]])
62844          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62845          arg1=msk_arg1*numarray.array([[[[0.58934142497165043, 0.52072267920554216, -0.24474900185541282, -0.2339032907627383, 0.20216098693689877], [0.95010527418772717, 0.55691375490173778, -0.42868414647327047, -0.8142870000527882, -0.75770157825760642], [-0.068550015156339184, -0.74051479447311119, 0.98586554943291982, -0.64297423499979578, 0.78246000792773307], [-0.098820424618294656, -0.1720129197876834, 0.26211118700658642, -0.52374470532212558, 0.6339607302502186]], [[0.85966828916736304, -0.01155394276102184, 0.32183546985303879, -0.07190262283629667, 0.18121834184349095], [-0.77537330415614814, 0.43157188986442763, 0.16876526738685471, 0.9413919737879568, 0.96440948866919696], [-0.48173201675316202, -0.4565981300219133, -0.41611248741151985, -0.81492699566492477, -0.81430201516927303], [0.88138778438611975, -0.73009913653432168, 0.095981472491643238, -0.2718713419486527, -0.85560622484582582]], [[0.50719470480713702, -0.084409034760861035, -0.57220195228152182, 0.15404510359216106, -0.44448976261939843], [-0.8536562365588638, 0.29636917171095378, -0.78504686298305804, -0.21331230180392358, -0.710772757639754], [-0.49583261372963228, 0.35955161363159927, 0.58630467633233296, -0.94629479197891642, 0.07419563379308447], [-0.016179687553983912, 0.39888477747431805, 0.94940469634095082, 0.60371784213955482, 0.58659729554638784]]], [[[0.53552791582705384, -0.46300755951753603, -0.51887345943107666, -0.45581919535954096, -0.74747240536396564], [-0.77048791181745702, 0.23704151648023108, -0.49418530279478934, 0.66878670820914543, 0.90121276760669833], [0.3351674343806561, -0.58299469935552417, -0.028083885024752009, 0.036103656727092925, -0.38567002717484966], [0.11797140777311999, -0.99817792014530649, 0.40779214920414075, -0.921750596458077, -0.72089830941069799]], [[0.75274316068062075, 0.73841939946695168, 0.19303211181341839, -0.95916107922353788, -0.86709809507916202], [0.82538601080696616, -0.58017675666252444, -0.58201782479566355, -0.17582745324932092, 0.16015893460559849], [-0.0022676355598854059, 0.24577353184572504, -0.97907765390122603, -0.41470031909688387, 0.84425091589415069], [0.62702195590585164, 0.75928175775096829, 0.88414372285028353, 0.64979153702213477, -0.53500939622936605]], [[0.30027144273108508, 0.89899564997589509, -0.92916623923867503, 0.88136984737211299, -0.75210012709254204], [-0.12587664756149453, -0.85843796241966497, -0.35781498938042722, 0.82061886191296352, 0.038700438981897678], [0.25299956148293146, 0.99718711337756494, -0.68221776342570362, -0.4976783432793046, 0.21490861252196236], [-0.99525103424889694, 0.50256023605425537, -0.62305943613047798, -0.0045169326618819117, -0.031477365905458132]]]])+(1.-msk_arg1)*numarray.array([[[[0.28091576643077798, -0.38165757100343822, 0.80700093117070026, -0.62610901843753308, -0.41353036913547236], [-0.82881110772740985, 0.32106482888905896, -0.044908397238956121, 0.33319920204956488, 0.67262011512847453], [0.69995356606247805, 0.50347884387876563, -0.56277625281790278, -0.90165197419903031, 0.77403800116773125], [0.77538833471041491, 0.44824092846781816, -0.0024780121103866737, -0.58904099787263831, -0.57701096175118649]], [[0.26184723557308165, 0.84796625109029211, 0.095973415749075253, 0.72895101803199469, 0.73510131880506879], [-0.58045954319132798, -0.11168494155481024, -0.4446049583809073, -0.97498189599881679, -0.76649061016432962], [0.25746025885088497, -0.23803361394803924, 0.84023190140370119, -0.4886795790763736, -0.05600385072515901], [0.63146130629204666, 0.47602482633473753, -0.78325166645988498, 0.63261763207027122, -0.065571415180843751]], [[0.98978639793935907, 0.33041266015524151, 0.45507905078001687, -0.46640036401192786, 0.11049719839082828], [0.91083896594419489, -0.46268510701864973, -0.075480717993535507, 0.13845294173647327, 0.2668739919294596], [0.12170774119249983, -0.4026126399394192, 0.44314080315334059, -0.4469777362961842, 0.72837971161695347], [-0.35781784374386638, -0.059319728422007945, 0.86217927222470947, -0.71906654545594639, 0.23942604062478101]]], [[[-0.94573218477036747, 0.22118010418470924, 0.67892428519722303, -0.82235529251235939, 0.040532530776837383], [0.83917939686881393, -0.70655880446834485, 0.58339948714670964, 0.13838580213699214, -0.46273377849380481], [-0.20868587191257015, -0.023209495786937095, -0.99345396137764386, 0.61394512683099878, 0.48552737378751631], [0.47399755242008013, 0.42211205856270206, -0.46406803281513187, 0.21717387977671754, -0.43220160213149672]], [[-0.31214125060322995, 0.93271820758799273, 0.93753470922960025, -0.24350189298137259, 0.84773553297058646], [0.86389739633213414, 0.96903149857012427, -0.5699533816464426, 0.86342125132430581, -0.53958019960295633], [0.26713363733418616, 0.11335025136093879, 0.86786015852660769, -0.7421325270539294, -0.34894362855751848], [-0.15346126415864081, 0.55952536518288998, -0.90125861724459377, -0.26791327917962482, 0.5242388093756658]], [[-0.6764867755927666, 0.18182155247275311, -0.008730963857910945, -0.57438207973052613, -0.11403850615974753], [0.085756451333229622, -0.09336552373878293, 0.85036339966003061, 0.83759185189488305, -0.55679297803716099], [0.37401685053224454, 0.14762381641539246, -0.095382515538033896, -0.88149302887226311, 0.84509265836944536], [0.80135525904334504, 0.29157013320523495, 0.087131686714815304, -0.72546347352247209, -0.97647922784024077]]]])
62846          res=generalTensorProduct(arg0,arg1,offset=2)
62847          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62848          ref=msk_ref*numarray.array([[[0.44943808511352612, 0.01514627286710489, 0.19719389292089173, 0.54815650152532192, 0.68618070961586863], [-0.78155387990152392, 0.68974698362097675, 0.035871822538538073, -0.093948360762736285, -0.63523204703737968], [-1.0197030170736783, 0.11384941056045859, 0.62469585199799293, -1.256098960162489, -0.43446574802886834], [0.47235532702580108, 0.22008675506541142, 0.35603801943731406, 0.70896323019301422, 0.57740297799443563]], [[0.24442047791538596, -0.76946218200042604, 0.36156449021575654, -0.91647938269023732, -0.48340243877933209], [-0.88792031529593196, 0.28404452955387594, -0.52092551939684562, -0.37209044715706024, -0.06101477328093597], [-0.52070636285621452, 0.10014565578866419, -0.036578839058394208, -0.21597236660024671, -0.15912964595291751], [1.0749995007912609, 0.38006427695663242, 1.6389209160323681, 1.0919834347863884, -0.1493223202288107]]])+(1.-msk_ref)*numarray.array([[[1.8479909702301192, 0.39433223370920706, -0.25192874896578482, 0.84404248951334837, 0.32696110156400698], [-0.67708532323279991, -0.14849322351655808, -0.75354797826054676, -1.0103153210514304, 0.26871901474652377], [0.39506520917841714, -0.46469416675920172, 1.3990258978425365, -0.94721847918286284, 0.25309662611885092], [-0.12557076715895446, -0.14825941082406582, 0.67727479419709846, -0.15964287588200157, 0.35534222842017021]], [[0.93219113421872168, 0.8309764420013751, 0.45475456358217065, 0.14281857053996705, 0.82257945121064913], [1.8270860478620496, -0.13686780327409448, -0.86994039785412247, -0.21285966859042055, -0.034516479240326692], [-0.51849093699240667, -0.71388591211016816, 1.0733620975532849, 0.56757078292043206, -0.58511613402528517], [-1.4649750552206109, -0.25140479825088402, 0.24483056357942121, 0.13129053668213414, 1.5244202237019748]]])
62849          self.failUnless(isinstance(res,Data),"wrong type of result.")
62850          self.failUnlessEqual(res.getShape(),(2, 4, 5),"wrong shape of result.")
62851          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62852       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62853       def test_generalTensorProduct_array_rank1_expandedData_rank3_offset0(self):
62854          arg0=numarray.array([-0.70655521088462447, 0.22854912801047367])
62855          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62856          arg1=msk_arg1*numarray.array([[[0.62682397995702521, 0.74658842325501573], [0.46436859069751057, -0.49740292812453357]], [[0.40674697443543439, 0.37889930474566014], [-0.29143619788113329, -0.50180586882605183]], [[-0.037252484854398027, -0.85874127917761212], [-0.78338659167318281, -0.88726552896983923]], [[0.22800197782355514, 0.89418589464460041], [0.14744720771656961, -0.31683668156005296]], [[0.059346667875287418, 0.60226913399488136], [-0.52554046850049785, 0.38750214003644468]], [[-0.21532092433386785, -0.15381524804315272], [0.67074482877365349, 0.3077463691295812]]])+(1.-msk_arg1)*numarray.array([[[0.83196796150556285, 0.061796374414873956], [0.95283433254538297, 0.97948915895176203]], [[0.57170301510769583, -0.52680724631507636], [-0.59968299300210415, 0.63087563814855563]], [[-0.12970134468597982, -0.94232737861980742], [0.54258848650047198, 0.26169731939619623]], [[0.41956970409478678, 0.76378353149135214], [-0.23040301855708534, -0.44668202481542574]], [[0.96995213564809757, -0.6000602989475019], [-0.80841963559245489, -0.45308168367369572]], [[0.88903583338070535, 0.20113070611977979], [-0.54311552814072162, -0.23676249933680227]]])
62857          res=generalTensorProduct(arg0,arg1,offset=0)
62858          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62859          ref=msk_ref*numarray.array([[[[-0.44288574934607555, -0.52750594083696689], [-0.32810204752847544, 0.35144263077565951]], [[-0.2873891942989113, -0.26771327816860752], [0.20591576425331728, 0.35455355147153328]], [[0.026320937292275477, 0.60674812560466995], [0.55350587848383292, 0.62690208293194261]], [[-0.16109598552323348, -0.63179170336067225], [-0.10417959294252986, 0.22386260835564784]], [[-0.041931697435923468, -0.42553639497905354], [0.37132335654977361, -0.27379165627169344]], [[0.15213612110058827, 0.10867896501840059], [-0.47391825394394005, -0.21743980073932873]]], [[[0.14326007403523275, 0.1706321331176483], [0.1061310364793686, -0.11368100549271845]], [[0.092961666328116963, 0.08659710570339535], [-0.066607488896420861, -0.11468729375073228]], [[-0.0085140229296960454, -0.19626457054264199], [-0.17904232242200294, -0.20278376295980843]], [[0.052109653216236881, 0.2043654065002887], [0.033698930751201166, -0.072412747292282226]], [[0.01356362919322413, 0.13764808540215326], [-0.12011181581000459, 0.088563276207521885]], [[-0.049211409498914678, -0.035154340814977272], [0.15329814573375297, 0.07033516431295514]]]])+(1.-msk_ref)*numarray.array([[[[-0.58783129849081406, -0.043662550356606482], [-0.67323006276971342, -0.69206316926236566]], [[-0.40393974440279368, 0.37221840501569708], [0.42370914358452449, -0.44574846955402475]], [[0.09164116094662185, 0.66580631972307336], [-0.38336872250291021, -0.18490360469392036]], [[-0.29644916075749156, -0.53965523416307548], [0.16279245336505549, 0.3156055122418342]], [[-0.68532473575083341, 0.42397573106634301], [0.57119310610929819, 0.32012722455602882]], [[-0.62815290073829211, -0.14210994847783445], [0.38374110652018179, 0.1672857776484851]]], [[[0.19014555213474771, 0.014123507486728188], [0.21776945584168897, 0.22386139317413745]], [[0.13066222558382254, -0.12040133677490952], [-0.13705702513334189, 0.1441860769819035]], [[-0.029643129229766571, -0.21536810068395246], [0.12400812545820554, 0.059810694150679064]], [[0.095892290010475986, 0.1745620601111087], [-0.052658408982202837, -0.10208878726951831]], [[0.22168171481426938, -0.13714325807815572], [-0.18476360278120044, -0.10355142372114041]], [[0.20318836448922498, 0.045968247499806512], [-0.12412858036550979, -0.054111862769006508]]]])
62860          self.failUnless(isinstance(res,Data),"wrong type of result.")
62861          self.failUnlessEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")
62862          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62863       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62864       def test_generalTensorProduct_array_rank2_expandedData_rank4_offset1(self):
62865          arg0=numarray.array([[-0.99284960193132088, -0.51982266840284241, 0.8215003955668887], [0.64252159175176837, 0.5085065099060635, -0.86623342670929393]])
62866          msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5)
62867          arg1=msk_arg1*numarray.array([[[[-0.50031991364893713, 0.11427379123022852], [0.48252754079696691, -0.13936690575407606]], [[0.46576700100754076, 0.98277774876930901], [0.52965031267989948, 0.020804644485333368]], [[0.058593543875176568, -0.29501213702910944], [-0.75332346932056904, 0.36787604093280479]], [[-0.99626234214496279, 0.90338659297312152], [-0.87031804102975818, 0.023334480967474702]], [[0.54208659369311207, 0.59101178140033905], [-0.34786360842552488, -0.21450091782674874]], [[0.62578035595363457, 0.82644778998995427], [-0.016412877094006628, 0.59012327780721407]]], [[[-0.72312672808438827, 0.036901695533946066], [0.37879968041278556, -0.97799967975835078]], [[-0.84875797240168871, -0.087802935859226716], [0.60013066625857436, -0.039461478713115339]], [[-0.73760411628399725, -0.16610574970060332], [-0.94565916708426623, -0.89401889052882111]], [[0.9089153822495899, -0.70244072881526942], [-0.13613521373391868, -0.86813132471366483]], [[-0.74766813057495729, 0.12366820907983], [0.35361385969803183, 0.13882946492246373]], [[-0.44811106298903014, 0.78542753572163182], [-0.12926741218139903, 0.87400298352422245]]], [[[-0.6444329937253459, 0.0068239752019536581], [-0.84051948138480359, 0.023694231767414919]], [[0.27496201567306966, -0.28777296918329243], [-0.69594616861665304, 0.43631473140377408]], [[-0.27192141699667549, -0.1616430858961968], [0.32323221049899598, 0.98954763780178201]], [[-0.41122953686967145, 0.95778903958407358], [-0.44926352997041041, -0.073263712160966943]], [[-0.2976229177380616, -0.75102334970567841], [-0.79224479510209722, -0.35657998970107374]], [[0.12217342652843777, 0.19000201644815662], [-0.51516312357496008, -0.61501871262557639]]]])+(1.-msk_arg1)*numarray.array([[[[0.80857279598744114, 0.062643192534418413], [-0.024124022759439478, -0.26055565830586414]], [[-0.095688136535071022, 0.19186613050696133], [0.42017140067258407, -0.80907983234481273]], [[-0.86095967602771228, 0.85919741690276119], [0.850434618274724, 0.86423179482366308]], [[0.95875097148848121, -0.01011455712048237], [0.43484394218224587, 0.95645632792262303]], [[-0.89501101906325764, -0.4659165204187381], [-0.013261982650479176, 0.97296816807559838]], [[-0.33296195405386153, -0.07560291340836045], [0.65203924127865531, -0.69888619610514935]]], [[[-0.62662995138581068, -0.4622060267467154], [0.80101388056372347, -0.35891789406708541]], [[0.62211190125148286, -0.50607336824268079], [0.85112911463529661, 0.16958447241492292]], [[0.35099889975840837, -0.36292892306851088], [0.73021534757463091, -0.3448771645520925]], [[0.10955081613938988, -0.48490972912346186], [0.93983330025018463, 0.37752330487022734]], [[0.23480746571472455, 0.38766594456920545], [-0.18699090339220548, -0.98985726804815877]], [[-0.8218382793223018, 0.89844658791565757], [-0.82817152418402862, -0.23104054633466831]]], [[[0.23612839666851682, 0.077948024566344865], [-0.17690905049187422, 0.62264137853217871]], [[0.86829931685154116, -0.22696650556150866], [-0.57157014934161188, -0.87746120133717143]], [[0.90273528322173502, -0.76296197487611139], [0.64156187954856625, -0.096495312704755865]], [[-0.2340832698357822, -0.60446582382942382], [0.67126294296859168, 0.62832897040892344]], [[0.072749360978900279, 0.085247508095577018], [-0.12236580507706263, -0.17394610238480901]], [[-0.90473704568524482, -0.091141502343677239], [0.73456912181207534, -0.94061770267405609]]]])
62868          res=generalTensorProduct(arg0,arg1,offset=1)
62869          msk_ref=whereNegative(self.functionspace.getX()[0]-0.5)
62870          ref=msk_ref*numarray.array([[[[0.34323813322917751, -0.12703312764741675], [-1.366473023902778, 0.66622160089903049]], [[0.20464845714024568, -1.166514148258154], [-1.4095446792437867, 0.35828981260804887]], [[0.1018652116135757, 0.2464583578563036], [1.5050473670586864, 0.91239948036347918]], [[0.1788386232571969, 0.25504166971208175], [0.56579092307233037, 0.36792054307598743]], [[-0.39405296069686208, -1.2680373292037097], [-0.48926966754296553, -0.15213015462141261]], [[-0.28800197058034072, -1.0727346650937664], [-0.33971506017130654, -1.5454683402518552]]], [[[-0.13095159558157032, 0.086276975219371208], [1.2307425375930485, -0.60739018554292645]], [[-0.37051488847949487, 0.83608612421414596], [1.2483339470076666, -0.3846493904332291]], [[-0.10188145694618903, -0.13399687872589086], [-1.2448949825498767, -1.0754253676105423]], [[0.17829009383703959, -0.60641917356494301], [-0.23925668840208986, -0.36299404577771227]], [[0.2259191492997894, 1.093185449669154], [0.64257399390526859, 0.24165572190031626]], [[0.068379291788924795, 0.76581946670844125], [0.36997256931998207, 1.3563529215138428]]]])+(1.-msk_ref)*numarray.array([[[[-0.28307515393034871, 0.24210423441875861], [-0.53776450138709619, 0.95676637782190921]], [[0.48492429197868403, -0.1138788767096286], [-1.3291483192041289, -0.0056939874892899534]], [[1.413943679202998, -1.2911686962855025], [-0.69689282487784443, -0.75804816307569745]], [[-1.2011420167305784, -0.234459610044297], [-0.36883851570969794, -0.62968995842750397]], [[0.82631671943376905, 0.33109834769770563], [0.0098457072890749536, -0.59435760386740188]], [[0.014549469979123653, -0.46684336049329861], [0.38657425458931938, 0.041271180079275216]]], [[[-0.0036622398463170558, -0.26230635416421899], [0.5450651003123842, -0.88927749690642932]], [[-0.4972836347675067, 0.062542503195873317], [1.1978870618002786, 0.32646976970828218]], [[-1.1566794337749444, 1.0284043378696595], [0.36199951712229195, 0.46350277054552957]], [[0.87449625643190121, 0.27052992658743547], [0.17583757398762101, 0.26223734328761283]], [[-0.51868070796507848, -0.17607500889662875], [0.0023901487734229593, 0.27248211972693437]], [[0.15186811151791813, 0.48723925038438809], [-0.63848964771753924, 0.2482594027725199]]]])
62871          self.failUnless(isinstance(res,Data),"wrong type of result.")
62872          self.failUnlessEqual(res.getShape(),(2, 6, 2, 2),"wrong shape of result.")
62873          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62874       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62875       def test_generalTensorProduct_array_rank2_float_rank0_offset0(self):
62876          arg0=numarray.array([[0.70256681769804308, -0.89304203095639134, 0.89620407509848721, -0.24465218943155254, 0.072349928183562895], [-0.49562914015701298, 0.81392934532580763, 0.096748603015513579, 0.54106186492168118, -0.16195371828838945], [-0.44206941156178936, 0.23427641461408988, 0.15396469517359135, 0.93969752262564787, 0.59672259343765099], [-0.52709693781176759, -0.40882648274709688, -0.60888193281882375, -0.066699046444738563, -0.17955814339905984]])
62877          arg1=0.0129612549167
62878          res=generalTensorProduct(arg0,arg1,offset=0)
62879          ref=numarray.array([[0.0091061476202284972, -0.011574945414590733, 0.011615929474774429, -0.00317099939316139, 0.0009377458623951307], [-0.0064239756297406634, 0.01054954572898467, 0.0012539833065227392, 0.0070128407569777021, -0.0020991234274500264], [-0.0057297743341464579, 0.0030365163307935453, 0.0019955756623233844, 0.012179659135381897, 0.0077342736481247542], [-0.0068318377768123916, -0.0052989042596001228, -0.0078918739454633142, -0.00086450334367386657, -0.0023272988689721184]])
62880          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62881          self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.")
62882          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62883       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62884       def test_generalTensorProduct_array_rank2_array_rank0_offset0(self):
62885          arg0=numarray.array([[-0.64477915422427268, 0.14212893254486847, -0.17502579382986094, 0.017476722765484176, -0.31150925666943841], [0.67545083910387649, -0.33561794227724095, -0.28092880043761226, -0.76895557214213306, -0.89310180447234444], [0.96264049665813656, 0.66695101232719756, 0.48328612305636054, -0.083992173413074633, 0.20294230093391308], [0.87684786750727284, 0.43917443473167084, 0.47284029513488735, -0.080655481104712434, -0.18861972588598341]])
62886          arg1=numarray.array(-0.466603480111)
62887          res=generalTensorProduct(arg0,arg1,offset=0)
62888          ref=numarray.array([[0.30085619726431673, -0.066317854549950969, 0.081667644510269727, -0.0081546996633166686, 0.14535130324886855], [-0.31516771217001943, 0.15660049985438032, 0.13108235594770479, 0.35879734601255531, 0.41672441006054767], [-0.44917140583683218, -0.31120166341567718, -0.22550298690763365, 0.039191040416659009, -0.094693583877574469], [-0.40914026650713425, -0.20492031962174498, -0.22062892724682967, 0.037634128173516336, 0.088010620516054086]])
62889          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62890          self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.")
62891          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62892       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62893       def test_generalTensorProduct_array_rank3_array_rank1_offset1(self):
62894          arg0=numarray.array([[[0.51651976078155082, -0.48900909438819595, 0.73093394040689308], [0.43546767535817166, 0.43632139168007189, -0.055346908513881576], [-0.59603430155196402, 0.78251909559571153, -0.78349396188260956], [-0.87039484205774786, 0.52802435003447323, 0.84519861016841458], [-0.78459234944782286, 0.43523277611709132, -0.1346011109463916]], [[0.65198484359554243, -0.21597755498324056, -0.045436632095025464], [0.27028348931945789, -0.087348685416429594, -0.6680818078060442], [0.5168299639290983, 0.51459259819847736, 0.096211701369114166], [-0.13146270299202145, -0.21074827742220603, 0.6114034269267925], [0.24822593851867469, 0.19403456664372487, 0.87202157088988641]], [[-0.45556821974363704, -0.44493491514148498, 0.84152223287724626], [0.73243379450920609, -0.088622182447032127, 0.18989029125357737], [0.32628129971615505, -0.34145831311918218, -0.72290982982024987], [0.18449965648439881, 0.95756277814674884, -0.57862484416886639], [0.55687448999060396, 0.48725031254022899, 0.067966582012516152]], [[0.67429362026844419, -0.94430221399486602, -0.74526329288835225], [-0.067904060174055259, -0.61966038936320711, -0.7267483430099595], [0.52871831837124561, 0.37731475138194792, 0.60147750632954233], [-0.7167624110802544, -0.36197817014900191, -0.4538878392138086], [0.6166857301938744, 0.031209706315663555, -0.081277166810240997]]])
62895          arg1=numarray.array([-0.89000002389473343, 0.051155631229641729, 0.8074302108950091])
62896          res=generalTensorProduct(arg0,arg1,offset=1)
62897          ref=numarray.array([[0.10545997731491186, -0.40993471127751713, -0.062115893970066005, 1.4841017412163346, 0.61187081375213914], [-0.62800190397048439, -0.78445012406417947, -0.35597013673243572, 0.59988644558750415, 0.4931014304127348], [1.0621652739822622, -0.50307646038473941, -0.89155711643984259, -0.58241915027793834, -0.4158144404449905], [-1.2501758117285884, -0.55806307105255182, 0.03439356807947358, 0.25291858746386486, -0.61287940231956151]])
62898          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62899          self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.")
62900          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62901       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62902       def test_generalTensorProduct_array_rank4_array_rank2_offset2(self):
62903          arg0=numarray.array([[[[0.11359149857412709, 0.62223492098498245, 0.61624973156776486], [0.42856935440404076, 0.76738569992247574, 0.0068041041611515141]], [[0.45505897008946405, 0.22558591722770482, 0.39886607959770304], [0.87677742811452974, 0.67841888151699492, -0.19860277075284305]], [[-0.74440084821443664, 0.88785576247761577, 0.072855425836091614], [0.55797601842570232, 0.29814137531714335, 0.20575142800628177]], [[-0.55651007861326418, 0.22485153116461398, -0.56110166122691707], [0.56856029656942986, 0.96474640955619284, -0.99254747922550002]], [[-0.92981368999931813, -0.81857816070292611, 0.35581265862816647], [0.64205575647322721, -0.71371930387374594, 0.11824718849344507]]], [[[0.42585839299070249, -0.6092499546805894, -0.19978088505417912], [0.5921754789012359, -0.95654497533374294, -0.96817856903480415]], [[-0.35653850496113293, 0.59003985623903321, 0.021943133302768869], [-0.17422939434125628, 0.14893762912519048, -0.42560436793922496]], [[-0.4558021107120227, 0.285666137135969, 0.30812270447782364], [0.15875025818283794, 0.0060421114597595249, 0.64128933142879752]], [[0.51687373082737853, -0.71358462575914317, -0.51824276615902365], [-0.4748189951045354, 0.66922158838218193, -0.51497454399191378]], [[-0.6230914895905042, -0.10459060849879265, 0.93513505090904503], [-0.31841260866933596, 0.5241642865700733, -0.40719137826562135]]], [[[-0.82622695606198726, 0.2646568279873609, 0.48052466143507755], [-0.66991304550137043, -0.22073535759583063, -0.56919222589057439]], [[-0.71555337093767801, 0.54163862515813999, -0.35739729353948024], [-0.54211786564996478, 0.47649792006107128, -0.89397888095636513]], [[-0.65839086632948707, -0.58821984622232781, -0.24971124649764342], [-0.28894539953175524, -0.99226489274258634, -0.090647897373135056]], [[0.3921854713622952, -0.64097181419522942, 0.85493708800766366], [-0.43401262707404742, 0.71988135867947389, 0.13752639916991338]], [[-0.02563731519982726, -0.68770638896312675, -0.64504293876273056], [-0.12931505512125363, -0.72126991891579806, -0.18106407390492452]]], [[[-0.89652327967778556, 0.56420287319635687, -0.90802707516778502], [-0.1192435100433924, -0.048391708963940738, 0.78502305152399376]], [[0.42506857464571124, 0.20079303003637139, -0.098008718714911014], [0.89931317348018425, -0.64702786095734099, 0.32132811414482365]], [[-0.85778717247632175, 0.34875667445257852, 0.033305394637672459], [-0.36372808735870854, 0.18456949252849797, -0.72683963575994937]], [[0.19458328329732644, 0.64870186112543271, 0.58745765657603388], [0.8661646645152441, 0.18819038987247083, -0.7406496524171613]], [[0.13991868471777291, 0.73190229773289794, 0.64725953704882544], [-0.70180644018482696, 0.17412151837829826, -0.72318368922912546]]]])
62904          arg1=numarray.array([[-0.066988924225406477, -0.089914462635613868, 0.98472935483579427], [0.14271262674878105, -0.48924616248884045, 0.3975281949408167]])
62905          res=generalTensorProduct(arg0,arg1,offset=2)
62906          ref=numarray.array([[0.23170848246086329, 0.056270964367504381, 0.057336107994252053, -1.3208940230391728, 0.9740888894798182], [-0.0028589177894156048, -0.27448257238351786, 0.582895824688199, -1.0806857626922517, 0.50824245321893868], [0.29085723639890759, -1.0185802559659378, 0.259286911555699, 0.51377454749918805, -0.30919497606362778], [-0.5661070839905652, 0.42959508217095266, -0.3722469844177837, 0.24423628407793885, 0.089363030547507438]])
62907          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62908          self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.")
62909          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62910       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62911       def test_generalTensorProduct_array_rank2_array_rank1_offset0(self):
62912          arg0=numarray.array([[-0.46363245472843229, -0.54452675971181641, 0.86555927302725855, -0.68362843177860366, 0.50922403215831724], [0.79387039320598873, 0.16724334772625427, -0.095083253003442225, -0.047193090518169223, 0.40761838311031129], [0.6483724628296641, 0.729683779250905, 0.97607297501888679, -0.83907437568163967, -0.35928060985655708], [0.72595610410235079, 0.049324367163139371, -0.42024134914962952, 0.22304083542942643, -0.33374820413977258]])
62913          arg1=numarray.array([-0.54752666526987048, 0.0021590525800481153])
62914          res=generalTensorProduct(arg0,arg1,offset=0)
62915          ref=numarray.array([[[0.25385113184834274, -0.0010010068475754628], [0.29814292089521888, -0.0011756619054610372], [-0.47391678235402823, 0.0018687879816140737], [0.37430479553541002, -0.0014759897294258412], [-0.27881373620292071, 0.0010994414604539192]], [[-0.43466520904855588, 0.0017140079206752017], [-0.091570192469125372, 0.00036108718140425339], [0.052060616439986121, -0.00020528974271644964], [0.025839475475192338, -0.0001018923638436975], [-0.22318193400708525, 0.00088006952172935864]], [[-0.35500121242593902, 0.0013998702387045369], [-0.39952132635476434, 0.0015754256462109258], [-0.53442598107213268, 0.002107392875029767], [0.4594155948303667, -0.0018116056956677057], [0.19671571421088604, -0.00077570572767205988]], [[-0.39748032481146706, 0.0015673773995638586], [-0.0270064062693804, 0.0001064939021828166], [0.23009334450840796, -0.00090732316912440841], [-0.12212080484167984, 0.00048155689118999019], [0.18273604125245765, -0.0007205799212344011]]])
62916          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62917          self.failUnlessEqual(res.shape,(4, 5, 2),"wrong shape of result.")
62918          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62919       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62920       def test_generalTensorProduct_array_rank3_array_rank2_offset1(self):
62921          arg0=numarray.array([[[0.057878150023086716, -0.79096230952887203, -0.74879752761820217], [-0.085774073234239134, -0.80255606255561962, 0.61893382102270689], [0.38066168190116678, 0.17841858097455909, 0.26732894780889294], [0.10352889709491953, -0.44726387355488728, 0.76021297388746056], [-0.73480564445365926, 0.50331520550406084, -0.38918351404128249]], [[-0.84716773948232027, 0.12730278518590454, 0.0028553691887278632], [0.096471847215960915, 0.79248530574361609, 0.63285890498524799], [0.49611392978157709, 0.083410756971258548, -0.2096717369131762], [0.66066199680002802, -0.26913604504765831, 0.35511213697911148], [0.13995402196674966, -0.94031534719036292, -0.82700404523290039]], [[0.77292212444378827, 0.98704207837379032, -0.42675540454425964], [-0.82613193079213687, -0.97309825947172945, -0.88780781701656841], [0.37739108423584788, -0.98298576471935895, 0.69119911656720867], [-0.41925510579083469, 0.61207793196919935, 0.46295892929670268], [-0.19714928414628208, 0.59501997884747193, -0.31082224386403046]], [[0.9449929655509921, 0.69415150872013887, -0.33218415609004981], [0.51441777355708251, -0.31313508236326437, 0.62889707609465528], [0.51928491120999287, 0.36808013495619374, -0.98553510595674076], [-0.22479264109228514, -0.77612379798780595, 0.33992382154124079], [-0.29380739525606758, 0.28481867071743272, -0.91928819878438062]]])
62922          arg1=numarray.array([[-0.65544108334594164, 0.83273898243034994], [0.5815051944337668, -0.71020437712138884], [-0.71584773219930908, 0.49357543157186545]])
62923          res=generalTensorProduct(arg0,arg1,offset=1)
62924          ref=numarray.array([[[0.038140603076380675, 0.24035422326652411], [-0.85353303987731777, 0.80404194187402789], [-0.33711679459360466, 0.32222516525511136], [-0.87214009157007011, 0.77908375581894274], [1.0528983500233395, -1.1614493875707341]], [[0.62725176223517132, -0.79447125650347705], [-0.055427902185096745, -0.17012705790751081], [-0.12657662577302262, 0.25040590632049275], [-0.84373524104562425, 0.91657522244551692], [-0.046520904273868458, 0.3761723667511328]], [[0.37285706965838383, -0.26799520403039323], [0.6111543275679342, -0.43505374659186558], [-1.3137622694282016, 1.3535479624783031], [0.29931541793776423, -0.5553253432712526], [0.69772834726055777, -0.74017391087632201]], [[0.022058769759363966, 0.12998510245483108], [-0.96945476545548037, 0.96117378516837182], [0.57917291627816847, -0.31541924967669865], [-0.54731538461866969, 0.53179097023677169], [1.0162673462729805, -0.9006824074393891]]])
62925          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62926          self.failUnlessEqual(res.shape,(4, 5, 2),"wrong shape of result.")
62927          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62928       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62929       def test_generalTensorProduct_array_rank4_array_rank3_offset2(self):
62930          arg0=numarray.array([[[[-0.54688844052075258, -0.65131322835599637, -0.4395611967426043], [0.53004782336123135, -0.28512778697352759, 0.63037917090587681]], [[-0.036577740804340397, 0.29669393735587257, -0.10075509863972387], [0.37402291311214309, -0.32145063727746082, 0.97513765010062725]], [[0.40302801811395339, -0.47782141247386711, -0.14764357527423089], [0.65465840534068986, -0.24883920145334559, -0.49425115453037605]], [[-0.85418926357252234, 0.8800418825442895, -0.97681309714413267], [0.47709268451718834, 0.70334993728605744, 0.38188895589332761]], [[0.32509745224252873, 0.037152711736442745, -0.94062910540000799], [-0.88401732047171699, 0.16747046594034054, 0.18511668997329944]]], [[[-0.18393608823444052, -0.78938349932788299, -0.66209453554939479], [0.72459455492634706, -0.32338204775031132, -0.43695368726508588]], [[0.31531159108096185, -0.58662135497576329, 0.54378800957299123], [0.10858501601247972, 0.28701647612019432, 0.78870443432819481]], [[-0.60628756803418016, -0.19621032211007994, 0.75098049465582606], [0.47618409948266804, 0.89236015856583006, 0.31714100807616341]], [[-0.62027342852786771, -0.53027522060601884, -0.85612879295155531], [0.26311917573979571, -0.88975881845260463, 0.42731457303418074]], [[-0.56090605057124532, -0.44261868291373063, 0.40802055192916065], [0.78769509954166561, 0.20858939338740434, 0.016327904954584582]]], [[[-0.46677250606911191, -0.20953793776687446, -0.28548891796555398], [0.87016845751426897, -0.38663177116039615, 0.8584601851880187]], [[-0.86565314937033366, -0.97734446338850889, -0.68197698067283952], [-0.88719966504012437, 0.93196090085414807, 0.59175052068726419]], [[-0.67677889252873324, -0.72999078856616029, -0.17568479400110726], [0.98472949512608854, 0.025778388190602408, 0.33393676013222828]], [[-0.94122733770752665, -0.52715624079975698, 0.022021084371674826], [-0.85926212987873352, -0.79928660513832517, 0.48782818673352724]], [[0.97503096117363541, -0.09555839043137615, 0.87002270552154548], [0.4057828259233407, -0.1731792384590658, 0.75290248432128437]]], [[[0.31113423838777665, 0.9771278197398805, -0.28868381013255107], [0.64771540003483596, -0.02244814358973013, 0.34710159506404659]], [[0.80484315187736444, 0.33771712015164823, -0.64980895170019415], [0.99481794046315741, 0.21211067712827303, -0.3286989665008182]], [[-0.22194923484870888, 0.56187270860724636, -0.49649707662351394], [-0.21391184676841601, 0.99830594339051859, -0.52005395227544882]], [[0.65366853820070636, -0.61602733120461739, -0.36448166579662233], [-0.72256258752464064, -0.19161174336703657, 0.73033779357911865]], [[0.75705762850610259, -0.64824263025091344, -0.56296536362637872], [0.3108621474230111, 0.42959519102548316, -0.12291261522373476]]]])
62931          arg1=numarray.array([[[-0.56482467849400231, 0.50385277202421563], [0.37484768216288611, -0.56408800461333253], [0.64816775783170066, 0.90701009690374512]], [[-0.68692081555055373, 0.26948975670108655], [-0.77883374718403742, -0.34750325210521416], [0.5133951495722997, -0.038244899825524703]]])
62932          res=generalTensorProduct(arg0,arg1,offset=2)
62933          ref=numarray.array([[[-0.038556693359247829, -0.089023217082385808], [0.56063225862696298, -0.10197073502712151], [-1.0120884882485315, 0.62048464976490358], [-0.50024754449722686, -1.9432361436455674], [-0.20752565531454981, -1.0138261560016955]], [[-1.0913633979615964, 0.076436999807802247], [0.061266037297184384, 0.88235737267146164], [-0.10362378119880797, 0.2924467623956965], [0.32827160736809669, -0.42616265213086119], [-0.27979319325051172, 0.47630639065189445]], [[0.14416944831734096, -0.039902555067586103], [-0.13205337154902314, -1.0889955632192752], [-0.53031390736681072, 0.15507930461718974], [1.8115035399666799, -0.1293687331542954], [0.22005292502492046, 1.4750347563247577]], [[-0.24582327942798946, -0.48718076147320177], [-1.7665005655679229, -0.16740784988694599], [-0.88340134432060369, -1.2637754560094718], [0.18415905150055678, 0.19018857428414288], [-1.6467167292370792, 0.17568542665521436]]])
62934          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62935          self.failUnlessEqual(res.shape,(4, 5, 2),"wrong shape of result.")
62936          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62937       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62938       def test_generalTensorProduct_array_rank2_array_rank2_offset0(self):
62939          arg0=numarray.array([[0.96238903821825073, -0.16263253916272413, -0.93128822680073009, -0.36608053566035692, -0.76556761049634114], [0.30681269986560711, -0.10364804404936945, -0.9181717601197914, -0.49122591136894411, 0.072883536061314036], [0.71520886999839939, 0.44189075659960886, 0.86619781158574294, -0.74089775366442367, -0.23016247460971773], [-0.63165910549855409, 0.95766272091718019, -0.91595580903292184, 0.30870732251937327, -0.13745144882682681]])
62940          arg1=numarray.array([[-0.87708521263646433, -0.92542397209068872, 0.27608907646829306, 0.19129440976119394, 0.82659336030485053], [-0.24708022792929341, 0.63592279157218234, -0.87762533114486296, 0.72977589944455556, -0.80110159202378672], [-0.27477607673887516, 0.28685774399108177, 0.077438162163678825, 0.12172184450223011, -0.89554832988726352], [0.73186437335660726, -0.62884815586546106, -0.43221594485264236, 0.92730356568725458, -0.46232789830798082]])
62941          res=generalTensorProduct(arg0,arg1,offset=0)
62942          ref=numarray.array([[[[-0.84409719422465679, -0.89061788644447126, 0.26570510076488563, 0.18409964302660339, 0.7955043890213771], [-0.23778730291961886, 0.61200512376221772, -0.84461699835647852, 0.70232832598130468, -0.77097139066288156], [-0.26444148421811031, 0.27606874834503436, 0.074525638406091804, 0.11714376886065271, -0.86186589587816431], [0.70433825038086806, -0.6051965719086817, -0.41595988746932699, 0.89242678671811138, -0.44493930139408289]], [[0.14264259519314601, 0.15050405038316267, -0.044901067541130012, -0.031110695587097573, -0.13443097704142634], [0.040183284845045616, -0.1034217383048318, 0.14273043603761565, -0.11868530754642891, 0.13028518603812914], [0.044687531061214807, -0.046652403283760302, -0.012593964940773878, -0.019795932642967955, 0.14564529883250257], [-0.11902496136172099, 0.10227117233619644, 0.070292376578001178, -0.15080973346236617, 0.075189560027592625]], [[0.81681913242935422, 0.86183645000722586, -0.25711850646320783, -0.17815023166339458, -0.76979666480356124], [0.23010290734579189, -0.59222740894542791, 0.81732213843730295, -0.67963170335562806, 0.74605648112307421], [0.25589572527340837, -0.26714723974551235, -0.072117248728119837, -0.11335812072939608, 0.83401361615506486], [-0.68157667452190229, 0.58563888400285435, 0.40251762087681947, -0.86358689339487771, 0.43056052861574773]], [[0.32108382446173489, 0.33877970341589453, -0.10107083700348597, -0.07002915999420968, -0.30259974011369412], [0.090451262191438814, -0.23279895617737403, 0.32128155133460956, -0.26715675218068169, 0.29326769992643253], [0.10059017335921876, -0.10501303657857675, -0.02834860388543313, -0.04455999803694307, 0.32784281231486745], [-0.26792130182911822, 0.23020906974825561, 0.15822584461260261, -0.33946778604654915, 0.16924924466331265]], [[0.67146803043977332, 0.70847461900950126, -0.21136485455597273, -0.1464488041821852, -0.63281310370072563], [0.18915661969672048, -0.4868418920040784, 0.67188152767563292, -0.55869279153558649, 0.61329743157046512], [0.21035966449053992, -0.21960899761962363, -0.05928414876887577, -0.093186301640779512, 0.68560279499578136], [-0.56029165951801985, 0.48142578005095171, 0.33089052811925579, -0.7099135749879284, 0.35394326437343626]]], [[[-0.26910088210119371, -0.28393182739749845, 0.084707634954639052, 0.058691554328029659, 0.25360934056611573], [-0.075807351814396087, 0.19510918858833501, -0.26926659731900288, 0.2239045140054359, -0.24578814231545412], [-0.084304789962733537, 0.088011598911260938, 0.023759011606069004, 0.037345807744350826, -0.27476560095284669], [0.22454528432499138, -0.19293860050659023, -0.13260934096520355, 0.2845085105835109, -0.14184807070306343]], [[0.090908166754394823, 0.095918384623598141, -0.028616092759335368, -0.019827291409326358, -0.085674785019793462], [0.025609382348143646, -0.065912153512871538, 0.090964148981345208, -0.07563984457179751, 0.083032613098101435], [0.028480002905543852, -0.029732244085090388, -0.0080263140430431971, -0.012616231100737646, 0.092821832744494334], [-0.075856310807829799, 0.065178881359508056, 0.044798337290926513, -0.096113200823489925, 0.047919382369077994]], [[0.80531487346146391, 0.8496981573115564, -0.25349719329074033, -0.17564112491151204, -0.75895468053443749], [0.22686208776863856, -0.58388634883812196, 0.80581079502299358, -0.67005962208601144, 0.73554885878324727], [0.25229163401814386, -0.26338467970428409, -0.071101533654266816, -0.11176156021164017, 0.82226718632492835], [-0.67197719985380422, 0.57739061811907533, 0.39684847483718932, -0.85142394707242519, 0.42449642014192268]], [[0.43084698292557133, 0.45459223409291688, -0.13562210820714737, -0.093968770774726734, -0.40604407674726817], [0.12137221014581359, -0.31238175285032838, 0.43111230313210669, -0.35848483129974273, 0.39352185964099667], [0.13497712871843687, -0.14091195672525839, -0.038039631783589219, -0.059792923999116884, 0.43991654452380685], [-0.35951074380056058, 0.30890650847769091, 0.21231567141842853, -0.45551553917039317, 0.22710744319762641]], [[-0.06392507172403504, -0.06744817144187619, 0.020122348160911727, 0.013942213012157763, 0.06024504698382132], [-0.018008080702322349, 0.046348301711762643, -0.063964437470819285, 0.053188648083845151, -0.058387116771041747], [-0.0200266520977842, 0.020907206728641197, 0.0056439670845783701, 0.0088715184432279475, -0.065270728995987931], [0.053340863447527281, -0.045832677245111163, -0.031501426402942477, 0.067585162869552115, -0.033696092048481251]]], [[[-0.62729912382203146, -0.66187143334841181, 0.19746135639978957, 0.13681545864231429, 0.59118690317181199], [-0.1767139706162569, 0.45481762116656821, -0.62768542137008854, 0.52194219639380612, -0.57295496438525129], [-0.19652228734700439, 0.20516320293015172, 0.055384460455837538, 0.087056542860560887, -0.64050410904762356], [0.52343589146046576, -0.44975777895711372, -0.30912467751334888, 0.66321573536066791, -0.33066101371758588]], [[-0.38757584821425606, -0.40893629920256974, 0.12200121088946128, 0.084531231462649598, 0.36526396538532352], [-0.10918246886047928, 0.28100840350676703, -0.38781452159058577, 0.32248122435371473, -0.35399938861254232], [-0.12142100844561372, 0.12675978552867603, 0.034219208068191238, 0.053787757961790403, -0.39573452906539897], [0.32340410167084982, -0.27788218738165732, -0.19099223088534895, 0.409766874239056, -0.20429842478042068]], [[-0.75972929175992143, -0.80160021941394022, 0.2391477538395643, 0.16569879910373259, 0.715993359767367], [-0.21402035271846051, 0.5508349303973209, -0.76019714122989324, 0.63213028704689123, -0.6939124458688587], [-0.23801043634732982, 0.24847555008149833, 0.067076766599400484, 0.10543519533001182, -0.77572200351761467], [0.63393931857906427, -0.5447068964303925, -0.37438450556382297, 0.8032283192739561, -0.40046741374940892]], [[0.64983046381463982, 0.68564454210919956, -0.20455377656664361, -0.14172959848063038, -0.61242116384379131], [0.18306118584770728, -0.47115376777983942, 0.65023063640422496, -0.54068932457690555, 0.59353436998741715], [0.20358097801655592, -0.21253225814423682, -0.05737376039497101, -0.090183441163592573, 0.66350974591139977], [-0.54223667020693145, 0.46591218607673546, 0.32022782263926913, -0.68703712878269729, 0.34253770131277711]], [[0.2018721029839991, 0.21299787147954727, -0.063545345052653912, -0.044028794729641739, -0.19025077330372642], [0.056868596687339262, -0.14636556336897324, 0.20199641799647464, -0.16796702692669144, 0.18438352483397927], [0.063243141785769202, -0.066023888217948259, -0.01782335903282093, -0.028015800944692547, 0.20612161973945239], [-0.16844771525044711, 0.14473724770775201, 0.099479891433061449, -0.21343048339299345, 0.10641053315567479]]], [[[0.55401886085995822, 0.58455247841772329, -0.17439417907988389, -0.12083285575662964, -0.52212522258120586], [0.15607047576019634, -0.40168642169062813, 0.55436003163383651, -0.46096959185755071, 0.50602311503121278], [0.17356481084527994, -0.18119630597473993, -0.048914520243761341, -0.07688671141791277, 0.56568125698731286], [-0.46228879542069434, 0.39721766362839245, 0.27301313710783248, -0.58573974082763092, 0.29203362669224564]], [[-0.83995181120966, -0.88624403911435357, 0.26440021618613696, 0.18319552494815097, 0.79159764652161824], [-0.23661952336360417, 0.60899955087026503, -0.84046906257003073, 0.69887917352185558, -0.76718513034858438], [-0.26314280529269907, 0.27471296762666325, 0.074159641080494498, 0.1165684728010636, -0.85763325031267323], [0.70087922713103556, -0.60222443598986841, -0.41391709777137137, 0.88804405583225932, -0.44275419304954228]], [[0.80337129553124498, 0.84764746305478689, -0.2528853934016676, -0.17521722585628965, -0.75712299007927086], [0.22631457006901468, -0.58247717503697238, 0.80386602021657894, -0.66844247438846616, 0.7337736568397093], [0.25168274367224863, -0.26274901697471009, -0.070929934474655038, -0.1114918305580197, 0.82028269502997042], [-0.67035542420022354, 0.57599712136460934, 0.39589070544443078, -0.84936908772818243, 0.42347192413317697]], [[-0.27076262761433806, -0.28568515661935973, 0.085230719573373262, 0.059053985050302044, 0.25517542307200203], [-0.076275475611528643, 0.19631402231529388, -0.27092936615290897, 0.22528716395669612, -0.24730592753967051], [-0.084825386942435993, 0.088555086091434684, 0.023905727702370327, 0.037576424708402952, -0.27646232710619356], [0.22593189114623718, -0.19413003046847199, -0.13342822708564031, 0.28626540092598013, -0.14272400761266585]], [[0.12055663322146748, 0.12720086574294209, -0.037948843565827457, -0.026293693774148787, -0.11361645496453697], [0.033961535305343973, -0.087408509043596663, 0.12063087329298507, -0.10030875469755483, 0.110112574481147], [0.037768369850709735, -0.039429012518769159, -0.010643987583884415, -0.016730843880705254, 0.12309441543744941], [-0.10059581846260338, 0.086436090115785832, 0.059408707826051566, -0.12745921860599571, 0.063547639455493812]]]])
62943          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62944          self.failUnlessEqual(res.shape,(4, 5, 4, 5),"wrong shape of result.")
62945          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62946       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62947       def test_generalTensorProduct_array_rank3_array_rank3_offset1(self):
62948          arg0=numarray.array([[[0.56691575903189695, -0.26202499027874815, -0.3051127616078555], [-0.58907833805541987, -0.30528083256776717, 0.2856035968325199], [-0.73732003256355894, -0.89445192385585837, 0.19444477125835746], [0.043725136580019752, 0.20800688396092926, 0.40600342514535637], [0.4119307137126631, -0.41188998031756485, -0.41430584234650847]], [[0.88403904797800048, 0.2700028481980592, -0.28213461466419165], [0.77552222084905109, 0.6174832534049941, 0.45555015756405659], [0.42093546631990542, 0.76578762584374105, 0.33614713111922856], [-0.23974404601627186, -0.77134236452494065, -0.54964084898634225], [-0.82378233554243185, -0.24451078585668173, -0.86129978649563754]], [[0.68069225832592362, 0.55319946077971949, 0.68042283391202085], [-0.57353969185481524, 0.91093587603846204, -0.75471370807849825], [0.74088507621827704, -0.85198485196749019, -0.76990948443504448], [-0.96421572202406369, -0.69005819366898158, 0.74963025425883711], [0.071145156464561987, -0.47229097264107156, 0.90818690700584392]], [[-0.17912383463065229, 0.841326225967997, 0.059765915118526802], [0.52552072453298315, 0.15718243997203807, 0.7736159998431158], [-0.35019997909366185, 0.17180624735045869, -0.97366325725652025], [-0.7564014878049472, 0.26198919432106971, -0.40720111939247738], [0.75948796941582231, 0.7319657022981052, -0.37540563370467872]]])
62949          arg1=numarray.array([[[0.011065684731264014, -0.51680683264041916, 0.64556639033434693, -0.73741523555867206, 0.95330673951811762], [0.7675401170408489, -0.3960270987893395, 0.54542171269408235, -0.59680970995703642, 0.97477387622303957], [-0.6580294248237526, -0.89410251530785789, -0.2629878257505498, -0.26247026356141689, 0.61251078978450346], [0.067061235697280397, 0.60990216119291274, 0.39340892221222856, 0.29350774913793543, 0.74460083148615208]], [[0.16603989860021628, -0.87186091940860333, 0.2929908377505348, -0.55236826757651758, -0.70877177644018619], [-0.98919373111426889, -0.879879982558748, -0.45033650812338255, 0.58851977832926017, -0.49995849766225908], [-0.48486037580079233, -0.80111165384966765, -0.021439470952025808, 0.4324397600910741, -0.41094651860471454], [-0.11662108760273449, 0.8065792264747178, 0.50811329874228273, 0.75643633088791185, -0.76631332253494233]], [[-0.96857510097960953, 0.88615534903593263, 0.40220533685305182, 0.8467256621198378, 0.40933331391092875], [0.97014402292632429, 0.35612986103046063, -0.52695701983013454, -0.31035249030379664, -0.61480248010561178], [-0.69986694135230509, -0.22018846860364993, -0.59178548162641476, 0.56866237128401953, -0.80582079569059251], [-0.39397276743265408, -0.66567564485350617, 0.74583286911868107, 0.17171581144746129, 0.80091654618320551]]])
62950          res=generalTensorProduct(arg0,arg1,offset=1)
62951          ref=numarray.array([[[[0.25829133212652239, -0.33491389462468057, 0.16649285770787964, -0.53166483314002733, 0.60126771383026867], [0.39832074382625332, -0.10262322482096303, 0.58798889497665541, -0.39785521352500841, 0.87120037496156166], [-0.032463380349482596, -0.22978722107606731, 0.037087036894735109, -0.43561469914916939, 0.70078648518259035], [0.18878182975201069, 0.33752536700813968, -0.13767179081229425, -0.08420373930558947, 0.37854932722206358]], [[-0.33383588629727756, 0.82369129246490047, -0.35486237233533757, 0.84485068066124558, -0.22829084500383223], [0.1269172516614232, 0.60361344806474571, -0.33431783215723537, 0.08326607664917976, -0.59718022822935968], [0.33576494341593377, 0.70837383782144414, -0.0075505712417800463, 0.18501199527374476, -0.46550806039847165], [-0.1164221779870033, -0.79563268777596574, -0.17385337489553884, -0.35478191656412106, 0.024057195137295428]], [[-0.34500802172270939, 1.3331979815139283, -0.65984852571808306, 1.2024192627952013, 0.010662845378936192], [0.50750296439648768, 1.1482566459036774, -0.10181003607484021, -0.14670931216064315, -0.39107659368999226], [0.78277710555278712, 1.3329810592997686, 0.098013175676841091, -0.082698567381600918, -0.2407322115948719], [-0.021739580965107315, -1.3005765707096244, -0.59952789530034978, -0.85961583291085397, 0.29215535091915845]], [[-0.35822351801098529, 0.15583158448328327, 0.25246833415251146, 0.19663353495064531, 0.060444786205243933], [0.22168348699787385, -0.055747489040687992, -0.2837708098627576, -0.029683594906239605, -0.31098460104676456], [-0.41377509773557852, -0.29512876585102388, -0.25622566863794571, 0.3093527693675317, -0.38586358997323256], [-0.18128002033794333, -0.075824504981135271, 0.42570362227419184, 0.23989483812046686, 0.1983341877020588]], [[0.33745444792990698, -0.22091716881848142, -0.021387387356124249, -0.42705241810710065, 0.51504313522402867], [0.32167599803873137, 0.051731341185124069, 0.62848642283280698, -0.35966879976613503, 0.86218345369960103], [0.21860556270121506, 0.052886945033081167, 0.14567812296294941, -0.52183731001523892, 0.75543302379122979], [0.23888485943330801, 0.19480883960845113, -0.3562324736001673, -0.26180655276428066, 0.2905363269654489]]], [[[0.32788230581983935, -0.94229744972172846, 0.53633821007743299, -1.0399354867161117, 0.53590288728388358], [0.13773909945611018, -0.68815008186277893, 0.50925476753009113, -0.28113989118272048, 0.90020501199959468], [-0.51518069889265772, -0.94460117594857296, -0.071317056504695248, -0.27571333401893677, 0.65787666467755368], [0.13895008007715542, 0.94476615593835001, 0.27455561779358983, 0.41526530064781347, 0.22538314935851905]], [[-0.33012599868318099, -0.53546649075280484, 0.86479272102616533, -0.52723404731699364, 0.48812771299187618], [0.42638311532591078, -0.68820395510012844, -0.095143947648366506, -0.24081921013251331, 0.16716943492728065], [-1.1285340986268984, -1.288376290264202, -0.48677938635610274, 0.32252702109791087, -0.14582865574105358], [-0.19947844642762175, 0.66779319854188623, 0.95861309490505509, 0.77293371299939306, 0.46912650576314324]], [[-0.19377450256091402, -0.58732405033027635, 0.63131071769479352, -0.44877660810352155, -0.0038918198575282614], [-0.10831633168453247, -0.72079102328402689, -0.29240987285171888, 0.095138690992506852, -0.17920922469326603], [-0.8835462633413651, -1.0638565726828566, -0.32604597651519368, 0.41182819909582785, -0.32774459257474825], [-0.19351134878997889, 0.65063288325476354, 0.80541622407796787, 0.76053918057036174, -0.0041785624272440702]], [[0.40164190078827883, 0.30933744580169081, -0.60183542678026614, 0.13746094598182396, 0.09316977294486628], [0.045763073991502146, 0.5778903260746997, 0.50623912258013914, -0.14028625656368349, 0.4898634938386251], [0.91642744526199671, 0.95331168872243266, 0.40485641215569251, -0.58319349265721088, 0.61304667065652119], [0.29042077985722936, -0.40248661293735177, -0.89618697143281167, -0.74822014778347123, -0.027640136247850444]], [[0.78451926597612875, -0.12432967474747814, -0.94986497952345594, 0.013245012196330008, -0.96457360419518412], [-1.2260022934956312, 0.23464570110352151, 0.11467132983459005, 0.61504839688837076, -0.15122701036968811], [1.263421855116867, 1.1220745793135234, 0.73159161618289437, -0.37930659782351078, 0.28995856653754054], [0.31259991288497885, -0.12629765653321134, -1.0907081936762757, -0.57464213253822249, -1.1158463895314539]]], [[[-0.55965510676196195, -0.23113906664269912, 0.87518411270908802, -0.23139119522592044, 0.53533608632318863], [0.63534532234752494, -0.51400282285250731, -0.2364151648922021, -0.29184584619571013, -0.03138138596522444], [-1.1923454812709127, -1.2016044570558235, -0.59353843526866468, 0.44749482786327455, -0.35870290918305481], [-0.28693472570515632, 0.40841396388476786, 1.0563601250159111, 0.73508798201082604, 0.62788181080202854]], [[0.87590199709062067, -1.1665937482686306, -0.40691196431198862, -0.71927062893298033, -1.5013343558909948], [-2.0734877731510664, -0.84315307049084476, -0.32534699613496948, 1.1126251157516212, -0.55050178115156578], [0.46392845682793865, -0.050778809471897557, 0.57793258851434481, 0.11528471890001807, -0.11748117579848238], [0.15264003513386964, 0.88733339097593822, -0.32566728936132755, 0.39113037095390635, -1.72958312566007]], [[0.61245007887775993, -0.32234158113795625, -0.080994954755456233, -0.72763266429929296, 0.99500395272115338], [0.66451400816600792, 0.18204609172054387, 1.1934838978463613, -0.70463401786619351, 1.6214947446892589], [0.46440371092680954, 0.18963297395490289, 0.27904360421478541, -1.0007109793026716, 1.4243293853511836], [0.4523674390338972, 0.27718411884311656, -0.71565783403137351, -0.55922241616451496, 0.58791774130105046]], [[-0.85132009891401605, 1.7642369040696644, -0.52314070250098199, 1.7269247861320425, -0.12325093819733579], [0.66977630172036773, 1.2559896646836712, -0.61016871793285088, -0.063309205991461198, -1.0557663785468505], [0.44442275888298921, 1.2498614254395517, -0.17524882217031917, 0.38095587294369637, -0.91108316905726594], [-0.2795200665644223, -1.6436744596961788, -0.17085992977882503, -0.67626650697717372, 0.41123623293722567]], [[-0.95727910049707221, 1.1797984242326987, 0.27282961497029379, 0.97740018419969432, 0.77432082511243205], [1.4028661306497732, 0.71081643984418108, -0.22708148543838103, -0.60227076697066351, -0.25287923774410448], [-0.45343042068769024, 0.11477445458431879, -0.54603646759171276, 0.29354083723658569, -0.49417238908849348], [-0.2979507400984498, -0.94210640766630971, 0.465367461798677, -0.18042634403764696, 1.1422795279554929]]], [[[0.079823816096485145, -0.58798514989684447, 0.15490271844508047, -0.28202793114536451, -0.7426040624123984], [-0.91173781221982519, -0.64804378543262064, -0.50807201198191332, 0.58349146720927025, -0.63197766342632544], [-0.33188518443079706, -0.5270009385421105, -0.0062988022364628971, 0.44482421841482928, -0.50361598226722903], [-0.13367478817164974, 0.52956352860497868, 0.40159551321878212, 0.5940982425430853, -0.73022774144608205]], [[-0.71739139211536829, 0.27691002859906033, 0.69646401576154005, 0.1806909387604041, 0.70624277215985176], [0.99839329244182373, -0.0709143719165376, -0.19181695929454423, -0.46122454854551775, -0.041941858211682337], [-0.96344790060293528, -0.76613140838621085, -0.59939017814879059, 0.36996468249092285, -0.36610232301303436], [-0.2878723543182507, -0.067681013072169005, 0.86359927067637154, 0.40598501231727047, 0.8904540252977583]], [[0.96771747704477773, -0.83162231436659118, -0.567352238422971, -0.66108318531408594, -0.85417222711331897], [-1.3833357851569823, -0.35923075670288551, 0.24470139047371298, 0.61229293916298977, 0.17134880096033506], [0.82857457492426856, 0.38986811676272615, 0.66461467566777699, -0.38747272350531892, 0.4994936556967563], [0.34007573324670587, 0.57313154263691923, -0.77666481796327935, -0.14001929653891237, -1.172239625006346]], [[0.42953542419969298, -0.19834813280197497, -0.57532540799224252, 0.068279826482183725, -1.0734541664022277], [-1.2347702872292821, -0.075980039055161014, -0.31596360555298053, 0.73198945657238779, -0.61795587614073388], [0.65569285868630733, 0.55607886696843678, 0.43428318350940531, 0.080267488057836178, -0.24283648997293328], [0.079147468671380464, 0.021048007295107918, -0.46815887950058876, -0.093754423884499255, -1.0901171008711159]], [[0.49354831498898033, -1.3633485724491097, 0.55376900187839206, -1.282238210536691, 0.051562336610748494], [-0.50531593087886506, -1.0785129426261126, 0.28243298457478117, 0.094014571412508616, 0.60517687367822071], [-0.5919326045374862, -1.1827863665393967, 0.0067305565745261753, -0.09629099266349167, 0.46690548533988818], [0.11346916185678046, 1.3035000712103573, 0.39072099017265743, 0.71213797156920411, -0.2960682793434018]]]])
62952          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62953          self.failUnlessEqual(res.shape,(4, 5, 4, 5),"wrong shape of result.")
62954          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62955       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62956       def test_generalTensorProduct_array_rank4_array_rank4_offset2(self):
62957          arg0=numarray.array([[[[-0.98240418969108201, -0.54304709924260042, -0.35442264599619322], [-0.79619763071978289, -0.84638748001014963, -0.51890495617446897]], [[0.59796663406131301, 0.46009667464135395, -0.25201961444919996], [-0.89789107699939374, 0.4099834945608809, 0.66896327448551318]], [[0.90446667619460697, -0.68665486543187182, -0.2669972149453006], [0.70197673515613457, -0.73039125927738402, -0.10429682595380352]], [[0.88753765017061759, 0.80640591428591546, 0.90571411852263495], [-0.82462795534998801, -0.71198022946671879, 0.53435725126666567]], [[0.33416352730471655, 0.4171576843359559, 0.36703573480924723], [0.58200156962842109, 0.99088109249276335, 0.0049604765696549258]]], [[[-0.78236466161246065, 0.074274434753403673, 0.47705516237888146], [-0.59988417082895662, 0.93188455244788204, 0.60417553677870162]], [[0.71172927489698079, -0.021333171670943285, 0.76483884282722614], [-0.68053969742507658, -0.6726405562037483, 0.99822429558864711]], [[-0.48765919381146428, -0.61934727842229287, 0.69387244085238264], [0.40145438796207422, -0.66882425539747525, 0.63626724578997873]], [[0.69938818106470313, 0.22189731061792117, 0.74870478955311737], [0.94780428825292273, -0.9314599222455533, -0.79669183680919109]], [[-0.39947826253557617, -0.91087142708365043, -0.67451335258312284], [0.86348107284809505, 0.10364645649765603, -0.41828571647993096]]], [[[0.032582643279688961, -0.60257416888695503, 0.7896569671912943], [0.40294328743212171, 0.57220118645155726, -0.8231027587904669]], [[-0.51570698561686057, 0.93921561000793941, -0.82983099969223639], [-0.079258006847544582, 0.83710488958068807, 0.86281944365513552]], [[-0.25364071889194384, -0.59054308533935029, -0.78307162739293679], [-0.50270810942884148, -0.20588515836091781, -0.82746133740593364]], [[-0.64083575957526806, -0.099765189126220122, -0.4863198210966988], [-0.61685248081350563, 0.11331078186975807, -0.75842713616582058]], [[0.97185986677666536, 0.51097072708968949, 0.33179510908752663], [-0.59456654355568861, 0.29015678725738714, 0.97118978891137853]]], [[[-0.27126728826548607, -0.78565993759639063, 0.42494085771226509], [-0.74895851053325879, 0.23336078961517792, -0.73120060403589848]], [[-0.41030921680830512, -0.56131269394118699, 0.031998737270264144], [-0.76027446472230564, 0.75617560446964616, -0.68532601001324833]], [[-0.17014320789203841, 0.54613288702020446, 0.56892119529577023], [-0.93640812995754308, 0.56346692917420427, 0.48905097746390136]], [[-0.98645324083790942, -0.54696998047559542, -0.25262090227474343], [-0.82259645582575014, 0.98597010214749137, 0.84752503984794303]], [[0.028294811022137711, -0.52436403785051033, 0.68800858181502234], [0.020605420785341666, -0.75050022985887455, 0.071743459973619084]]]])
62958          arg1=numarray.array([[[[0.70588742170393592, 0.6352875103317146, -0.43597723415983425, 0.14609486197056842, -0.73960430685474976], [-0.35476093468368997, -0.13315313367321902, 0.40421087122449029, 0.64525267803802699, 0.15313273899919877], [0.95490546616054117, 0.58014509836148398, -0.64540703440579472, 0.47530122831441979, -0.57784158580192679], [-0.27554037762729555, -0.035350828803423218, 0.82463324502631341, -0.34464283726544886, -0.41312839116067068]], [[0.40392236920967961, 0.34962319910119932, -0.19831980450633813, 0.69153830537463645, -0.29094430102867608], [0.1454391606554748, 0.53670650142494258, -0.021270035270837484, -0.17748171951267611, -0.83988713541259208], [0.7755147424728579, -0.14033826449734343, -0.82514758015580969, -0.10897020980250027, -0.45269765011114571], [-0.67325881191588111, 0.86123443917932496, 0.80700744540142444, 0.22140146772376612, 0.076582714074661551]], [[-0.35821059577153735, 0.44880312117823018, -0.8190765290166877, -0.16501902040192018, 0.022193926023702959], [0.75203594986685451, 0.72574031059158051, -0.026138511002685938, 0.28723851832302061, -0.46838969641038686], [-0.91039438274501872, -0.27152275703511375, 0.88480953637185844, -0.54508875945875035, -0.26355516233742038], [-0.16869289225885686, 0.841191332374984, 0.6834197871904244, 0.44105453660826566, 0.8787198966744949]]], [[[0.58661320005716111, 0.98820921926785998, -0.13831428765093645, -0.53680910804473458, 0.47482186565229445], [0.45349291095393207, 0.807044179849286, 0.45514661800018175, 0.10545023045245139, -0.34301255276861387], [0.15431234000079574, 0.70025861211492879, 0.9173994174786837, -0.19934772087428843, 0.68180335483184962], [-0.81574574350218998, 0.77911592229379423, -0.850540404385139, -0.53637737383063167, -0.89732713772797168]], [[0.17046962455804593, 0.082972356361531219, 0.6533251633703554, -0.17709907059905072, -0.84097783216607191], [-0.010183766789225945, -0.93465327049975788, -0.97069535102111337, -0.55097607773903867, -0.20136579396133225], [0.53827383770945847, -0.75552501537178451, -0.47035263982328002, 0.95260668360540213, -0.44742355628448816], [0.10726623394749479, 0.87447955348625461, 0.88624196456455606, -0.1189192682403748, -0.43832376648280014]], [[0.34557852528408795, -0.19517322725412711, 0.41240586807371771, 0.53405540377539262, 0.96306788331063364], [-0.052607321547303743, -0.56303419699957802, -0.34741242414042972, -0.24547600170055706, -0.14491554420950425], [-0.41470507650112332, -0.18283412520621312, 0.83380934845575339, -0.8093786625686783, 0.024649110600003965], [-0.36392401924025775, 0.85070635348781387, -0.92206227741702862, 0.66074270929988166, 0.14153915931628935]]]])
62959          res=generalTensorProduct(arg0,arg1,offset=2)
62960          ref=numarray.array([[[[-1.5765234897732763, -1.7287972133605805, 0.16946194726677913, -0.16039901723083899, 0.71072116437889199], [-0.3221526256323583, 0.022807884199776529, 0.26318801962648369, -0.12956309281743605, 0.99040460661414631], [-1.3998386130088432, -0.2206966740990251, 0.0035495769210489025, -0.44213374919350018, 0.72997299350919043], [1.443639855555586, -2.533013859503976, -1.085028819077944, 0.24687893394224197, 1.0648289286768522]], [[0.47257087698443501, -0.55621664883667798, 0.52240530743044278, 1.213774221438614, -0.70858281003770673], [-0.78130171857467301, -1.5000644298041865, -0.80054155295972795, -0.25299726626159236, -0.048329537313933538], [0.96195585286524521, -0.7100507570695116, -1.4473426258082287, 0.39955145996380237, -1.2665256731043566], [0.10096223103227464, 0.39116802671842682, 1.2023808336318513, 0.65949289454913185, 0.28742482908230016]], [[0.70797417335763946, 0.86815027441213299, -0.65674749303390834, -0.6018267643149362, 0.37201699179799019], [-0.2902610709220747, 0.6251761529237535, 1.451903095888204, 1.1308404343932585, 0.76167800706366773], [0.33266755627329625, 1.7560448214970303, 0.64717159976961525, -0.10104120440785283, 0.66141060361984116], [-0.35490485153578749, -1.0284571508794822, -1.1389482702795601, -0.94008490039834824, -0.98537953295273506]], [[0.20734440170568602, 0.27399526841656896, -1.4194463551303813, 1.3920004249910944, -0.14911400889134308], [0.088725495362105417, 0.67102017551357274, 0.44807299188500549, 0.86387470357767726, -0.61681651063255283], [-0.083754082032539562, 0.018576322024338676, -0.41292179614279895, -1.1060678507348523, -1.347125806392115], [-0.53841001317523685, 0.61449640547202455, 1.5793335527835197, 1.1521778828176013, 1.6186301435218677]], [[0.78494422686673182, 1.1792516064311638, 0.039865472274441038, -0.20852647962402884, -0.91255715725503006], [0.47172869229215697, -0.013453243623864689, -0.58206515074895848, -0.23878840775093962, -0.87099200488783068], [0.92957749936412215, -0.30632919330495534, -0.16313097150863751, 0.73718788226328735, -0.52508469686341974], [-0.80512940773281927, 1.9803767394184075, 1.2416218821841054, -0.28765469582874104, -0.73945420333139567]]], [[[-0.67739835440588614, -0.89036388698115965, 0.87658011928902246, 0.33799159269394208, 0.080947960177543576], [0.33380009168895608, -1.2050374214169581, -1.717798975076108, -1.1059912442693114, -0.475071807138775], [-0.96530683083541358, -1.8284399552277144, 0.3808787055660286, -0.12169178470759828, -0.51832912715597801], [0.45453003718828411, 1.3544302540926383, 0.51981850004870267, 1.1066380373567566, 0.96344275132359691]], [[0.050896947227051181, -0.13519662508715641, -0.86617959559424862, 0.98056533273591295, 0.70068193181306726], [-0.034693936067514752, -0.033718576794290356, 0.26453891583846117, 0.73652832320411876, -0.007113882173516356], [-0.91426416995130566, 0.057362475902372478, 0.75936492508264763, -1.3893338744086363, -0.74162019954380376], [-0.1910523394278259, 0.3306087465592481, 0.15468484647477954, 1.1919054931997506, 1.4231986949669873]], [[-0.50158865150770859, 0.0021148162712845558, -0.46298374051696717, -0.37130327747860636, 1.9221243981505745], [0.76013765688131829, 0.82696682675268085, 0.40881765450180119, 0.24921759414162126, 0.02527194012215217], [-2.1396034369509715, 0.28570685614397356, 2.6531393882572152, -1.7746532845119769, 0.96793725275350873], [-0.19648043829432188, 0.33669839172940652, -1.9486230178012314, 0.6215934240931873, 0.78673646310092826]], [[0.43701391185867922, 1.8727504983319172, -2.0303719457149914, -0.63722988965364613, -0.099106544449251155], [0.8284299913174098, 2.653409993537208, 1.8707448888188363, 1.4356832768264736, -0.45204664841438968], [0.13358713771779629, 1.6844273955263194, 0.67131369085991466, -0.53130289868611036, 0.34142253012905927], [-1.0515513960306078, 0.042341581444289567, 0.37044597044767591, -0.7857116582247976, -0.16901440090521408]], [[-0.028642788946772191, 0.068568889715193121, 0.68306491159136495, -1.2822246148875851, 0.46549637677546485], [-0.085483458701379328, -0.08969732718341128, 0.31325059682197054, -0.15322094226987698, 0.76335150172072996], [-0.11128385857631001, 0.68204995457588524, 0.80724969593433893, 0.54220784531967403, 1.3529960387011659], [0.29607118884601102, -0.93019649789228775, -1.7823630725955661, -1.1133446317349842, -1.3768890110818413]]], [[[-0.45378886536901181, 0.77074272327294691, -0.56284417502393502, -1.2994737832512686, -0.9138432161094483], [0.71485948947648947, 0.499160263016178, -0.080732057141491342, 0.28406310604809704, 0.0070606072302248357], [-0.44356613176491599, -0.11059949307391601, 0.58909238877301928, 0.78167472598940879, 0.044261178320711636], [0.29572647647697836, 0.25824216907682229, 1.003595247921008, -0.62439294785551203, -0.094602890183577232]], [[0.70697241089108609, -0.54894756666182809, 1.6319625491110894, 1.0661886375027778, 0.17907607591477448], [-0.39436976697303394, -1.3616550706767427, -1.3551430053035505, -1.4191983528422385, -0.74553619013014005], [1.0719431827584209, -1.0513823923179859, -0.92341177952463427, 0.21975283277186441, -0.31578860313458856], [-0.50980374590566302, 1.5333547718254819, -0.22072170226490007, 0.53274366374887561, -0.61788800153189349]], [[-0.75301604819315959, -1.0714125994249493, 0.46286540704633466, -0.45180689407764218, -0.52042390747295375], [-0.767151640096978, -0.5988692904188333, 0.18902108196936357, -0.020231073188315823, 1.1577369544132734], [0.1674819914176085, 0.1031630133175617, -1.0961730391804927, 0.94445508917671162, 0.34925780033767467], [1.2887057437588569, -2.4339795695459241, -0.21281950403370886, -0.64132302060002022, -0.20432002467717797]], [[-0.92308427330933929, -1.1124100065050546, 0.54407686095527874, -0.17633955576182339, -0.62640606329010484], [-0.39388959842909393, -0.49787031780196161, -0.37146065532322953, -0.47678738302768231, 0.51212486690919556], [0.033763751846895118, -0.60462898298265122, -1.1859592721121268, 0.81613236332313532, 0.053672559422998783], [1.1171416751992804, -1.4990655707149942, 0.38306946983103923, -0.19945659055711662, 0.22627277751419606]], [[0.80986830944661237, 0.19193694312316756, -0.12448183137798657, 1.2270384533510348, -0.4510988551621693], [-0.34461920618334574, -0.91221831157518729, -0.51637686683870343, 0.17074114008785529, -0.43096794808241035], [0.68391274450628159, -0.41111661905215757, -0.62743986326104551, -0.16574169556112361, -1.3916040890442449], [-0.50507379439393107, 1.3015099463834616, 1.3078950006305294, 0.85063824587270809, 0.47298305098817217]]], [[[-1.3133033567134356, -0.83435730642877493, -0.11948007646309936, -0.68284988573329652, -0.81742410417431777], [-0.0020172452761388765, -0.48801508401809002, -0.41742548592641837, 0.058401855428047392, 0.73516147560274059], [-0.94191818048411435, -0.72958348725827005, -0.20718292826567963, 0.68847175489251944, -0.23265641323237704], [1.4341059776481424, -1.3110845671119922, 0.95072964042405883, -0.002196005847771576, 0.8915839320899549]], [[-1.0817371722576954, -0.9973624017945657, 0.58054838982853041, -0.54519149630654407, -1.1894499592734862], [-0.22843759539522368, -1.1578785445536142, -0.99671042926496678, -0.48451380632781704, 0.60144983322594892], [-0.28232626558388069, -1.1463509621628307, -0.86828072286684255, 1.2752889012694708, -0.39081590174738151], [1.4362768782796809, -0.95609301860557516, 1.1792423915814154, -0.10370612679114088, 0.4084061671082016]], [[-0.38755011925079541, -0.63588014543347138, 0.19921283976809195, 0.92299520516802369, -0.46792996899757749], [0.11151813714007938, -0.82906414641931914, -1.2383208606179283, -0.57254941348299104, -0.61435561844611442], [-0.30089098079728693, -1.500682566538718, -0.55375486155129761, -0.12288827638312705, -1.1773592816882219], [0.22955410749621766, 1.134143330892923, 1.5341250923265748, 1.1888764613461307, 1.2745410469519409]], [[-0.84834839405575047, -1.8277952031452123, 1.8529222076077554, 0.23890901874645987, 0.47957457773097079], [-0.34724435448600721, -2.4081476193184308, -2.0064172367525877, -1.4500328600285077, 0.38746049650696207], [-1.0838560346537858, -1.9028446990917485, 0.35274458468600717, 0.14569756528072464, -0.096899261547597149], [1.1510315465443757, 0.29360767634546248, -0.63552837288345188, 0.99142176695614259, 0.56958235761388631]], [[-0.52933845877769958, 0.0875151982069102, -0.9354590865912602, -0.31185189569884064, 0.85693515877672799], [0.44431932849577221, 0.89181138876436905, 0.717567794210064, 0.70701412096678828, 0.25614375493454405], [-1.4365396655181055, 0.47152711628038196, 1.454896134121858, -1.0815439310709873, 0.39130897513159146], [0.10575290281521875, -0.45306423472019802, -0.67843664138293924, 0.30320335946176247, 0.87334701224021649]]]])
62961          self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.")
62962          self.failUnlessEqual(res.shape,(4, 5, 4, 5),"wrong shape of result.")
62963          self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62964       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62965       def test_generalTensorProduct_array_rank2_Symbol_rank0_offset0(self):
62966          arg0=numarray.array([[0.67876633525186181, -0.7766915666267793, -0.98848920524144135, -0.43675423955218173, 0.35593281580065006], [-0.61512597053615559, -0.72627878801603307, 0.40864417122786634, 0.0079889064441724944, -0.91655553660671085], [0.072566114694826878, -0.94794958404274809, -0.65978594504545685, 0.30029035792900038, -0.61108433422247388], [0.53686032371257864, -0.4570165016567258, 0.24109209487185845, 0.77888657905385372, -0.025677679196495218]])
62967          arg1=Symbol(shape=())
62968          res=generalTensorProduct(arg0,arg1,offset=0)
62969          s1=numarray.array(-0.0116337448509)
62970          sub=res.substitute({arg1:s1})
62971          ref=numarray.array([[-0.0078965943576881515, 0.0090358315139674912, 0.011499831201629708, 0.0050810873854909228, -0.0041408315630806171], [0.0071562185923685741, 0.008449342110386086, -0.0047540620228649867, -9.2940899209066949e-05, 0.010662973254545386], [-0.00084421566317942906, 0.011028203592252718, 0.0076757813408566628, -0.0034935014053259143, 0.0071091992267151433], [-0.0062456960266338646, 0.0053168133729168763, -0.0028048039173037523, -0.0090613677284885896, 0.00029872756813481696]])
62972          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62973          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62974          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62975       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62976       def test_generalTensorProduct_array_rank3_Symbol_rank1_offset1(self):
62977          arg0=numarray.array([[[-0.70690454319102569, 0.49099418825880581, 0.10003063509787768], [0.61267580744655592, -0.62107912921319008, 0.28965095544508768], [0.62160563043681427, 0.2066421780053771, 0.51735454795202318], [-0.18347385363717561, 0.86719354570492957, 0.85312719898655831], [-0.75033333118896617, 0.044491518098130678, 0.79174896004812534]], [[-0.3377095083706545, -0.40420412478891454, -0.31501051823058823], [-0.44738275130453076, 0.18798454776288298, -0.092577940408266057], [0.27525652806446144, 0.55173412300041491, 0.21082341879296274], [-0.6944317822520556, -0.81269378381816337, -0.54021919362087312], [0.30081168237942535, -0.90873880490240544, -0.25084101008910231]], [[0.1608404859733279, -0.21082186558542615, -0.092462829185575357], [-0.23710652044804381, 0.61641412775711202, -0.93282906496598272], [-0.41202867749808414, -0.82887269254529228, -0.9302438998511231], [-0.7959177894204168, 0.55308519684956803, 0.53763815496881828], [-0.44684401384333361, -0.9526203901273822, 0.50520455659568686]], [[0.37798542690035886, 0.58440488625668485, -0.35108725443223143], [0.57927768887653186, -0.40451307446551188, 0.8490623167400313], [0.33870010715806043, 0.63618655757439924, 0.66436299858966752], [-0.26111240852588979, 0.030268759758270924, 0.91016145632168], [0.11837585074448431, 0.020098522879374636, 0.58199018257838953]]])
62978          arg1=Symbol(shape=(3,))
62979          res=generalTensorProduct(arg0,arg1,offset=1)
62980          s1=numarray.array([-0.45243483271226204, 0.82711902268858939, 0.67741792935860068])
62981          sub=res.substitute({arg1:s1})
62982          ref=numarray.array([[0.79370141758100043, -0.59468748834167484, 0.24014688351628324, 1.3782059008997007, 0.91262165722979827], [-0.39492714872303114, 0.29518317897535762, 0.47462971119127639, -0.72396352852590917, -1.0576570330380832], [-0.30978059207863479, -0.014792033798976534, -1.129324142050439, 1.1817739450740357, -0.24352802479211855], [0.074525824066050184, -0.021495826575021804, 0.82301368427395638, 0.75973190498320453, 0.35731709676200674]])
62983          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62984          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62985          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62986       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62987       def test_generalTensorProduct_array_rank4_Symbol_rank2_offset2(self):
62988          arg0=numarray.array([[[[-0.1287512734937406, 0.38965603798852699, -0.81615331910293243], [-0.32213335469744386, 0.91505495292377992, -0.95646267503485327]], [[0.96218756601327637, -0.055430826139494682, -0.46351896240875257], [0.47753619799966462, 0.73307155660329237, -0.066814879069004407]], [[0.46941579870534467, 0.49016480366044424, 0.79505467863241064], [0.26450570615544811, -0.5716249578295407, -0.89532541427436096]], [[-0.7669775352551127, 0.09221523427443401, 0.9663944257321071], [0.3315794010909161, 0.33892882989591966, 0.65480329661405312]], [[-0.98542054029597437, -0.41741044293863827, 0.26008562116618639], [0.50072883078344255, -0.85522766916717674, -0.27097293590845073]]], [[[0.99095942455659558, 0.13583444626736618, -0.80458855887089098], [-0.25918811076446446, 0.16371363657749316, 0.0086402800929850088]], [[0.92305974282631276, -0.35857716081830127, -0.19797389603406867], [-0.35983171701164762, -0.17043823512896417, -0.23999224694667043]], [[-0.017967447453594243, -0.77769114693675578, 0.073131206909697877], [0.51071625864906389, 0.21995094256327841, -0.64976516550440699]], [[0.24015280647666248, 0.45070955251702749, 0.68902073111408813], [0.31062789748501585, -0.69994695100587645, -0.55832602763185135]], [[-0.88503505674197624, 0.6776064007123499, -0.42043494917887547], [-0.89682537018064856, 0.52206040598701642, -0.14844972092883091]]], [[[0.71724995310622108, 0.75347713224935786, -0.48577044122018997], [-0.097024811722049575, -0.24123823723994908, -0.29921557743117488]], [[-0.29587129977965643, 0.7587016903803101, 0.72085697914065983], [-0.52617785771384584, -0.9440376952247731, 0.85724055152772993]], [[0.42160521150589658, -0.4763521096781691, 0.32773623527179496], [0.055301223282496759, -0.65157155457936011, -0.24859295314642149]], [[-0.34703794546474831, 0.96472883940009946, 0.98142934449415553], [0.7790977353875197, 0.96462516103134277, 0.93098721361548775]], [[0.77145904383937869, -0.20553321018703374, -0.97346905107835258], [0.71604444486105279, 0.16684419916274829, 0.79326096379683042]]], [[[-0.09948467783584003, -0.30637367097111157, -0.64277280540216619], [0.25577436775375428, 0.19804859823022314, 0.51430540421485449]], [[-0.15477604842138715, -0.10692827119007964, 0.86378256424568689], [0.65682549686934877, -0.0023985239975474748, 0.20709565355557635]], [[-0.96162955463668398, -0.56814981703345802, 0.97704358126962054], [-0.275321031133404, 0.55262621738368711, 0.41652366223331438]], [[-0.10154357179442952, 0.56136958348956512, -0.88699965088263344], [0.96549270303922485, -0.22028095391746616, -0.12567775696266925]], [[-0.60896683273321406, 0.0041452846005074484, -0.36483898435005946], [-0.89812605135651524, 0.25458244454785883, -0.99570388829572432]]]])
62989          arg1=Symbol(shape=(2, 3))
62990          res=generalTensorProduct(arg0,arg1,offset=2)
62991          s1=numarray.array([[0.48290454056878263, -0.90094742430234254, 0.33524097434874323], [-0.14934541173855642, 0.028913249802327234, -0.57338806754401994]])
62992          sub=res.substitute({arg1:s1})
62993          ref=numarray.array([[-0.063851576432814916, 0.34738295127822744, 0.50894386871511976, -0.54465972832525134, 0.043255850655711789], [0.12491587360067508, 0.88885993204573999, 1.0191528100604019, 0.19440214122757382, -0.94467169518056282], [-0.3162483077548861, -1.025011583954067, 0.85807609000837215, -1.3300220160723202, -0.32559133724435552], [-0.31486789599729431, 0.094260602440172467, 0.19330933301207692, -0.93065777673577743, 0.29230003044300756]])
62994          self.failUnless(isinstance(res,Symbol),"wrong type of result.")
62995          self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.")
62996          self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
62997       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62998       def test_generalTensorProduct_array_rank2_Symbol_rank1_offset0(self):
62999          arg0=numarray.array([[-0.90637033812215062, -0.28028659772407849, 0.57332829255036932, 0.7538162367042871, 0.5231216923174804], [0.85656133529090495, 0.81979190110554634, -0.74770789479698485, 0.3684984455808753, 0.03027427210207434], [-0.98450090479521313, -0.26694646573031844, -0.019200332829135691, 0.59326299611262523, -0.49225025339778616], [0.48736077345018858, 0.24139057600068825, 0.43108330401243888, 0.96306706415885235, -0.72743774903601444]])
63000          arg1=Symbol(shape=(2,))
63001          res=generalTensorProduct(arg0,arg1,offset=0)
63002          s1=numarray.array([-0.54724138375704956, -0.66388211664640151])
63003          sub=res.substitute({arg1:s1})
63004          ref=numarray.array([[[0.49600335803031059, 0.60172305853804797], [0.15338442558708021, 0.1860772597646797], [-0.31374896816233061, -0.3806224003916065], [-0.41251944047258571, -0.50044511878566689], [-0.28627383877714752, -0.34729113635937647]], [[-0.46874581039738089, -0.568655752310394], [-0.44862405435382152, -0.54424518251552756], [0.40917670299477243, 0.4963898998310472], [-0.20165759927200003, -0.24463952803314029], [-0.016567334557376603, -0.020098547843054215]], [[0.53875963745019972, 0.65359254451574356], [0.14608415329531327, 0.17722098470031988], [0.010507216706012122, 0.012746757598921993], [-0.32465806292452615, -0.39385669358723552], [0.26937970982416276, 0.32679614014544978]], [[-0.26670398405178714, -0.32355010184853855], [-0.13209891283652789, -0.16025488653383096], [-0.23590662380232794, -0.28618849631870213], [-0.52703015284112964, -0.63936300102621468], [0.39808404037958189, 0.48293291255852311]]])