Parent Directory
|
Revision Log
|
Patch
revision 395 by gross, Wed Dec 21 02:41:59 2005 UTC | revision 396 by gross, Wed Dec 21 05:08:25 2005 UTC | |
---|---|---|
# | Line 23025 class Test_util_binary_no_tagged_data(Te | Line 23025 class Test_util_binary_no_tagged_data(Te |
23025 | self.failUnless(isinstance(res,Data),"wrong type of result.") | self.failUnless(isinstance(res,Data),"wrong type of result.") |
23026 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") |
23027 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") |
23028 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23029 | def test_maximum_float_rank0_float_rank0(self): | |
23030 | arg0=0.190833616561 | |
23031 | arg1=0.400555937829 | |
23032 | res=maximum(arg0,arg1) | |
23033 | ref=0.400555937829 | |
23034 | self.failUnless(isinstance(res,float),"wrong type of result.") | |
23035 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23036 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23037 | def test_maximum_float_rank0_array_rank0(self): | |
23038 | arg0=-0.607520185637 | |
23039 | arg1=numarray.array(-0.822580587394) | |
23040 | res=maximum(arg0,arg1) | |
23041 | ref=numarray.array(-0.607520185637) | |
23042 | if isinstance(res,numarray.NumArray): | |
23043 | self.failUnlessEqual(res.shape,(),"wrong shape of result.") | |
23044 | else: | |
23045 | self.failUnless(isinstance(res,float),"wrong type of result.") | |
23046 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23047 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23048 | def test_maximum_float_rank0_Symbol_rank0(self): | |
23049 | arg0=0.516035627407 | |
23050 | arg1=Symbol(shape=()) | |
23051 | res=maximum(arg0,arg1) | |
23052 | s1=numarray.array(-0.1743874735) | |
23053 | sub=res.substitute({arg1:s1}) | |
23054 | ref=numarray.array(0.516035627407) | |
23055 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23056 | self.failUnlessEqual(res.getShape(),(),"wrong shape of result.") | |
23057 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23058 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23059 | def test_maximum_float_rank0_constData_rank0(self): | |
23060 | arg0=0.66510948385 | |
23061 | arg1=Data(0.447127953255,self.functionspace) | |
23062 | res=maximum(arg0,arg1) | |
23063 | ref=Data(0.66510948385,self.functionspace) | |
23064 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23065 | self.failUnlessEqual(res.getShape(),(),"wrong shape of result.") | |
23066 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23067 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23068 | def test_maximum_float_rank0_expandedData_rank0(self): | |
23069 | arg0=-0.626379875424 | |
23070 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23071 | arg1=msk_arg1*(-0.808319082591)+(1.-msk_arg1)*(-0.732167960529) | |
23072 | res=maximum(arg0,arg1) | |
23073 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23074 | ref=msk_ref*(-0.626379875424)+(1.-msk_ref)*(-0.626379875424) | |
23075 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23076 | self.failUnlessEqual(res.getShape(),(),"wrong shape of result.") | |
23077 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23078 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23079 | def test_maximum_float_rank0_array_rank1(self): | |
23080 | arg0=-0.34068193517 | |
23081 | arg1=numarray.array([-0.28498591942826468, -0.9244388369769494]) | |
23082 | res=maximum(arg0,arg1) | |
23083 | ref=numarray.array([-0.28498591942826468, -0.34068193517048506]) | |
23084 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23085 | self.failUnlessEqual(res.shape,(2,),"wrong shape of result.") | |
23086 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23087 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23088 | def test_maximum_float_rank0_Symbol_rank1(self): | |
23089 | arg0=0.954576259921 | |
23090 | arg1=Symbol(shape=(2,)) | |
23091 | res=maximum(arg0,arg1) | |
23092 | s1=numarray.array([0.0049640892542059945, 0.29380146783316974]) | |
23093 | sub=res.substitute({arg1:s1}) | |
23094 | ref=numarray.array([0.95457625992145734, 0.95457625992145734]) | |
23095 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23096 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
23097 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23098 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23099 | def test_maximum_float_rank0_constData_rank1(self): | |
23100 | arg0=0.133219946847 | |
23101 | arg1=Data(numarray.array([0.73105505422959327, -0.57302577924904785]),self.functionspace) | |
23102 | res=maximum(arg0,arg1) | |
23103 | ref=Data(numarray.array([0.73105505422959327, 0.13321994684664973]),self.functionspace) | |
23104 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23105 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
23106 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23107 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23108 | def test_maximum_float_rank0_expandedData_rank1(self): | |
23109 | arg0=-0.989795574687 | |
23110 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23111 | arg1=msk_arg1*numarray.array([-0.12744166984605543, 0.1251383582008796])+(1.-msk_arg1)*numarray.array([-0.75971755196106439, -0.044294049795981616]) | |
23112 | res=maximum(arg0,arg1) | |
23113 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23114 | ref=msk_ref*numarray.array([-0.12744166984605543, 0.1251383582008796])+(1.-msk_ref)*numarray.array([-0.75971755196106439, -0.044294049795981616]) | |
23115 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23116 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
23117 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23118 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23119 | def test_maximum_float_rank0_array_rank2(self): | |
23120 | arg0=-0.918302739699 | |
23121 | arg1=numarray.array([[0.19183086796477156, 0.41569819970182253, -0.57007179868513158, 0.18371653862222859, -0.95803703880242908], [-0.99708943520039761, -0.33564912838654082, 0.22798896799780199, -0.32560020734492867, -0.83553942115001578], [0.90329116559065703, -0.4744523361429227, -0.48030437204982679, -0.25285363526704185, 0.4839054158389946], [-0.75326661018214147, -0.89189805199917815, -0.29494941406721664, 0.33826278929980447, 0.52219823679588995]]) | |
23122 | res=maximum(arg0,arg1) | |
23123 | ref=numarray.array([[0.19183086796477156, 0.41569819970182253, -0.57007179868513158, 0.18371653862222859, -0.91830273969888498], [-0.91830273969888498, -0.33564912838654082, 0.22798896799780199, -0.32560020734492867, -0.83553942115001578], [0.90329116559065703, -0.4744523361429227, -0.48030437204982679, -0.25285363526704185, 0.4839054158389946], [-0.75326661018214147, -0.89189805199917815, -0.29494941406721664, 0.33826278929980447, 0.52219823679588995]]) | |
23124 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23125 | self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.") | |
23126 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23127 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23128 | def test_maximum_float_rank0_Symbol_rank2(self): | |
23129 | arg0=-0.277418552647 | |
23130 | arg1=Symbol(shape=(4, 5)) | |
23131 | res=maximum(arg0,arg1) | |
23132 | s1=numarray.array([[-0.99289072506960552, 0.19782624907337709, 0.95613086199918595, 0.44091386643316266, -0.37059163780321391], [0.84363308798978487, -0.51183523461403269, -0.57551129897501507, 0.19000742902371703, -0.074561874521030802], [0.35669726023155235, -0.21740764792612688, -0.02741866226550882, 0.7913626340003177, -0.55431312092720475], [-0.79982049514168496, 0.49589465225392826, -0.21107892173219511, -0.28843484560692079, -0.85036340359415541]]) | |
23133 | sub=res.substitute({arg1:s1}) | |
23134 | ref=numarray.array([[-0.2774185526470867, 0.19782624907337709, 0.95613086199918595, 0.44091386643316266, -0.2774185526470867], [0.84363308798978487, -0.2774185526470867, -0.2774185526470867, 0.19000742902371703, -0.074561874521030802], [0.35669726023155235, -0.21740764792612688, -0.02741866226550882, 0.7913626340003177, -0.2774185526470867], [-0.2774185526470867, 0.49589465225392826, -0.21107892173219511, -0.2774185526470867, -0.2774185526470867]]) | |
23135 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23136 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
23137 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23138 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23139 | def test_maximum_float_rank0_constData_rank2(self): | |
23140 | arg0=-0.711360717248 | |
23141 | arg1=Data(numarray.array([[-0.49649726218321621, -0.1862706537495149, 0.6559357060844726, -0.60255638663804834, -0.72898391055117684], [0.877046256493895, -0.62092354207162237, -0.42516414792107171, -0.06686623727516694, 0.93735063523149598], [0.64862166841681268, 0.45648573520660918, -0.63173946887266208, 0.070770417261089902, 0.27864121106526873], [-0.25951227165524937, 0.85373113390321809, 0.5672699499488485, 0.22967921637760402, 0.88510133022334969]]),self.functionspace) | |
23142 | res=maximum(arg0,arg1) | |
23143 | ref=Data(numarray.array([[-0.49649726218321621, -0.1862706537495149, 0.6559357060844726, -0.60255638663804834, -0.71136071724766237], [0.877046256493895, -0.62092354207162237, -0.42516414792107171, -0.06686623727516694, 0.93735063523149598], [0.64862166841681268, 0.45648573520660918, -0.63173946887266208, 0.070770417261089902, 0.27864121106526873], [-0.25951227165524937, 0.85373113390321809, 0.5672699499488485, 0.22967921637760402, 0.88510133022334969]]),self.functionspace) | |
23144 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23145 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
23146 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23147 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23148 | def test_maximum_float_rank0_expandedData_rank2(self): | |
23149 | arg0=0.959635515709 | |
23150 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23151 | arg1=msk_arg1*numarray.array([[-0.0064259026939066377, -0.7701474037173317, -0.19596310110827386, -0.73984521228212596, -0.61313716616198133], [0.43189572076819838, 0.088536215133996565, 0.067634491583320466, -0.70571296121285232, -0.21462215163400677], [-0.29878468443140771, 0.49093472354971013, 0.86357875479621882, 0.021213198562558766, -0.68952176426127321], [-0.64172570311955179, -0.10403523776207346, -0.1560226988237976, 0.18544285896364587, -0.99033629867964823]])+(1.-msk_arg1)*numarray.array([[0.59197813276731015, 0.69989892013318467, 0.37778322838437939, -0.96988982584154027, -0.12556098215489531], [-0.57102119315921684, -0.97261687381790707, 0.59394598916500385, -0.95926160849480113, -0.74824572871782435], [0.3774569754088497, -0.71634815703797106, -0.64965181170462061, -0.88835061435822782, 0.049571630549325674], [0.056229799936159397, 0.69426319270729175, 0.32265901320206658, -0.26876155184504102, 0.5465577920078144]]) | |
23152 | res=maximum(arg0,arg1) | |
23153 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23154 | ref=msk_ref*numarray.array([[0.95963551570949646, 0.95963551570949646, 0.95963551570949646, 0.95963551570949646, 0.95963551570949646], [0.95963551570949646, 0.95963551570949646, 0.95963551570949646, 0.95963551570949646, 0.95963551570949646], [0.95963551570949646, 0.95963551570949646, 0.95963551570949646, 0.95963551570949646, 0.95963551570949646], [0.95963551570949646, 0.95963551570949646, 0.95963551570949646, 0.95963551570949646, 0.95963551570949646]])+(1.-msk_ref)*numarray.array([[0.95963551570949646, 0.95963551570949646, 0.95963551570949646, 0.95963551570949646, 0.95963551570949646], [0.95963551570949646, 0.95963551570949646, 0.95963551570949646, 0.95963551570949646, 0.95963551570949646], [0.95963551570949646, 0.95963551570949646, 0.95963551570949646, 0.95963551570949646, 0.95963551570949646], [0.95963551570949646, 0.95963551570949646, 0.95963551570949646, 0.95963551570949646, 0.95963551570949646]]) | |
23155 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23156 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
23157 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23158 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23159 | def test_maximum_float_rank0_array_rank3(self): | |
23160 | arg0=0.417103350623 | |
23161 | arg1=numarray.array([[[-0.45176533427754739, -0.55230637452486797], [-0.2772690226072374, -0.43884388551060138]], [[0.43650997405556069, -0.91050440106967101], [-0.0097638249506593056, -0.99719694387315783]], [[-0.88346341044578236, -0.42616345838712633], [0.47323800588958997, 0.31718901666579002]], [[0.72726350287088914, 0.18527925932004718], [0.95182455621773032, 0.5402040160782311]], [[-0.60062553156664, 0.18455913185890904], [-0.041559661168358408, 0.65568567006769984]], [[0.46551889127092827, -0.88399518601736693], [-0.45129696041660194, -0.97227033198060986]]]) | |
23162 | res=maximum(arg0,arg1) | |
23163 | ref=numarray.array([[[0.41710335062270154, 0.41710335062270154], [0.41710335062270154, 0.41710335062270154]], [[0.43650997405556069, 0.41710335062270154], [0.41710335062270154, 0.41710335062270154]], [[0.41710335062270154, 0.41710335062270154], [0.47323800588958997, 0.41710335062270154]], [[0.72726350287088914, 0.41710335062270154], [0.95182455621773032, 0.5402040160782311]], [[0.41710335062270154, 0.41710335062270154], [0.41710335062270154, 0.65568567006769984]], [[0.46551889127092827, 0.41710335062270154], [0.41710335062270154, 0.41710335062270154]]]) | |
23164 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23165 | self.failUnlessEqual(res.shape,(6, 2, 2),"wrong shape of result.") | |
23166 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23167 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23168 | def test_maximum_float_rank0_Symbol_rank3(self): | |
23169 | arg0=-0.954672923464 | |
23170 | arg1=Symbol(shape=(6, 2, 2)) | |
23171 | res=maximum(arg0,arg1) | |
23172 | s1=numarray.array([[[0.3483462792197054, 0.45601206615028178], [0.64107739105983463, -0.95807507362286382]], [[0.026145251253471224, 0.14711601575188804], [-0.7393117552767503, -0.11682100905814674]], [[-0.88508316018799715, -0.1024334575510879], [0.91416954091266844, 0.3902047430084068]], [[0.63664321883211761, -0.22396125684499824], [0.50607888063060558, -0.8696015456531343]], [[-0.37313751414078422, -0.54165981780497363], [0.47720240432367467, -0.76737664842694775]], [[-0.68132241809142768, 0.73233776988106447], [0.86973993037218422, 0.7595371330514924]]]) | |
23173 | sub=res.substitute({arg1:s1}) | |
23174 | ref=numarray.array([[[0.3483462792197054, 0.45601206615028178], [0.64107739105983463, -0.95467292346444288]], [[0.026145251253471224, 0.14711601575188804], [-0.7393117552767503, -0.11682100905814674]], [[-0.88508316018799715, -0.1024334575510879], [0.91416954091266844, 0.3902047430084068]], [[0.63664321883211761, -0.22396125684499824], [0.50607888063060558, -0.8696015456531343]], [[-0.37313751414078422, -0.54165981780497363], [0.47720240432367467, -0.76737664842694775]], [[-0.68132241809142768, 0.73233776988106447], [0.86973993037218422, 0.7595371330514924]]]) | |
23175 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23176 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
23177 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23178 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23179 | def test_maximum_float_rank0_constData_rank3(self): | |
23180 | arg0=-0.143403966016 | |
23181 | arg1=Data(numarray.array([[[0.95668360633256144, -0.1800322431671213], [-0.42783838761912918, -0.89612594522855216]], [[0.60799134259365384, 0.37935166549606292], [-0.16348477876382117, 0.055255205348395009]], [[-0.84148244802025407, -0.08342603479235744], [-0.073128933987135269, 0.91858564423034572]], [[-0.44722942409971833, 0.12566700748073134], [-0.84487161060035754, 0.69960515111291777]], [[0.28894841908227131, -0.28216896408608538], [-0.4241999876693332, 0.41787923950246331]], [[-0.74860509777465034, 0.95471157706396692], [0.3975080494679184, -0.47708712009131093]]]),self.functionspace) | |
23182 | res=maximum(arg0,arg1) | |
23183 | ref=Data(numarray.array([[[0.95668360633256144, -0.14340396601550798], [-0.14340396601550798, -0.14340396601550798]], [[0.60799134259365384, 0.37935166549606292], [-0.14340396601550798, 0.055255205348395009]], [[-0.14340396601550798, -0.08342603479235744], [-0.073128933987135269, 0.91858564423034572]], [[-0.14340396601550798, 0.12566700748073134], [-0.14340396601550798, 0.69960515111291777]], [[0.28894841908227131, -0.14340396601550798], [-0.14340396601550798, 0.41787923950246331]], [[-0.14340396601550798, 0.95471157706396692], [0.3975080494679184, -0.14340396601550798]]]),self.functionspace) | |
23184 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23185 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
23186 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23187 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23188 | def test_maximum_float_rank0_expandedData_rank3(self): | |
23189 | arg0=-0.801969488354 | |
23190 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23191 | arg1=msk_arg1*numarray.array([[[-0.9889605718250738, -0.37340300276544558], [-0.23838119100250488, 0.20477150811741951]], [[-0.20467295181293843, 0.35301722647248601], [-0.095474828781975996, -0.8510749109672644]], [[-0.70425456344214243, -0.46755265678910085], [0.66251795702833483, -0.92448552384625948]], [[-0.66717945104318677, -0.78744474882359006], [-0.16257558572897457, -0.26356489046284248]], [[-0.27934849406098761, 0.93892978662484139], [-0.18468624033742786, -0.70668348468539377]], [[-0.41995260750527241, -0.046679843759030781], [0.13620169917808034, 0.46624408802032424]]])+(1.-msk_arg1)*numarray.array([[[-0.56084457456829484, 0.032990993182650197], [0.42149270935344574, 0.1750548418363671]], [[-0.78410663312115148, -0.74664526632471984], [0.88029830669181575, -0.60878924835930359]], [[0.054733122499459386, 0.19985918328880037], [0.60155025489305403, 0.19928445576334952]], [[-0.086860661257179173, -0.14114143266705215], [0.57480201913819329, 0.38294532940281845]], [[0.39095132070017913, 0.096587125583033284], [0.50661117336330563, -0.043716480204347041]], [[0.74636288223324332, 0.82758235657560153], [-0.88560450972740812, -0.97248750693241459]]]) | |
23192 | res=maximum(arg0,arg1) | |
23193 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23194 | ref=msk_ref*numarray.array([[[-0.80196948835439708, -0.37340300276544558], [-0.23838119100250488, 0.20477150811741951]], [[-0.20467295181293843, 0.35301722647248601], [-0.095474828781975996, -0.80196948835439708]], [[-0.70425456344214243, -0.46755265678910085], [0.66251795702833483, -0.80196948835439708]], [[-0.66717945104318677, -0.78744474882359006], [-0.16257558572897457, -0.26356489046284248]], [[-0.27934849406098761, 0.93892978662484139], [-0.18468624033742786, -0.70668348468539377]], [[-0.41995260750527241, -0.046679843759030781], [0.13620169917808034, 0.46624408802032424]]])+(1.-msk_ref)*numarray.array([[[-0.56084457456829484, 0.032990993182650197], [0.42149270935344574, 0.1750548418363671]], [[-0.78410663312115148, -0.74664526632471984], [0.88029830669181575, -0.60878924835930359]], [[0.054733122499459386, 0.19985918328880037], [0.60155025489305403, 0.19928445576334952]], [[-0.086860661257179173, -0.14114143266705215], [0.57480201913819329, 0.38294532940281845]], [[0.39095132070017913, 0.096587125583033284], [0.50661117336330563, -0.043716480204347041]], [[0.74636288223324332, 0.82758235657560153], [-0.80196948835439708, -0.80196948835439708]]]) | |
23195 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23196 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
23197 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23198 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23199 | def test_maximum_float_rank0_array_rank4(self): | |
23200 | arg0=0.270905406087 | |
23201 | arg1=numarray.array([[[[-0.95360288151815653, -0.64078885487275894, 0.96879725589600185, 0.37349635624215671], [-0.23784772076621397, 0.65332164004684334, -0.2721768925317285, 0.22325285780446613], [0.065576671186904578, -0.0042823363828001781, 0.15081972618097739, -0.96500711704114939]], [[0.52806648530122047, -0.25468561493618047, 0.55916471457602035, 0.48281251134172609], [0.55407748333919904, -0.11022873429516356, -0.43913854875915792, -0.12104124446879827], [-0.17051966474671065, 0.390161734069155, -0.40998699913604164, -0.63105941814244515]]], [[[-0.94813299631664916, 0.33923647049967887, -0.6464524838010095, 0.099997153482365375], [-0.19694004792045505, -0.21476580508277232, 0.50450751987287878, 0.0044718532670784406], [-0.35156116891903766, 0.93361770074048556, 0.64503353549824793, 0.31429197499208672]], [[0.67485265775424352, -0.0069832167465539996, -0.27581854606767786, -0.049974746554111604], [0.88520110268538477, 0.59559353742053656, -0.88876809828391945, 0.14398781431221419], [0.49156586086617393, 0.34186756327969836, -0.39488984681038053, -0.49978462106847665]]], [[[0.4711536016262412, -0.84357230970236885, -0.60522103581380593, 0.74011510067186914], [0.058929816244633448, -0.51830971900097267, -0.92512610450551414, 0.79105987068184391], [-0.08685194216427039, 0.9276912197047904, 0.75649609887119307, -0.2819853018873526]], [[-0.23960953208469071, -0.026232616293173194, -0.60625185640538937, 0.41226223746307045], [-0.48188248446866555, -0.57075257849297079, -0.98430513472426018, 0.0026142817361640702], [-0.25427236937723752, -0.83104284375176407, -0.76917008485860205, 0.63675334398029215]]]]) | |
23202 | res=maximum(arg0,arg1) | |
23203 | ref=numarray.array([[[[0.27090540608696001, 0.27090540608696001, 0.96879725589600185, 0.37349635624215671], [0.27090540608696001, 0.65332164004684334, 0.27090540608696001, 0.27090540608696001], [0.27090540608696001, 0.27090540608696001, 0.27090540608696001, 0.27090540608696001]], [[0.52806648530122047, 0.27090540608696001, 0.55916471457602035, 0.48281251134172609], [0.55407748333919904, 0.27090540608696001, 0.27090540608696001, 0.27090540608696001], [0.27090540608696001, 0.390161734069155, 0.27090540608696001, 0.27090540608696001]]], [[[0.27090540608696001, 0.33923647049967887, 0.27090540608696001, 0.27090540608696001], [0.27090540608696001, 0.27090540608696001, 0.50450751987287878, 0.27090540608696001], [0.27090540608696001, 0.93361770074048556, 0.64503353549824793, 0.31429197499208672]], [[0.67485265775424352, 0.27090540608696001, 0.27090540608696001, 0.27090540608696001], [0.88520110268538477, 0.59559353742053656, 0.27090540608696001, 0.27090540608696001], [0.49156586086617393, 0.34186756327969836, 0.27090540608696001, 0.27090540608696001]]], [[[0.4711536016262412, 0.27090540608696001, 0.27090540608696001, 0.74011510067186914], [0.27090540608696001, 0.27090540608696001, 0.27090540608696001, 0.79105987068184391], [0.27090540608696001, 0.9276912197047904, 0.75649609887119307, 0.27090540608696001]], [[0.27090540608696001, 0.27090540608696001, 0.27090540608696001, 0.41226223746307045], [0.27090540608696001, 0.27090540608696001, 0.27090540608696001, 0.27090540608696001], [0.27090540608696001, 0.27090540608696001, 0.27090540608696001, 0.63675334398029215]]]]) | |
23204 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23205 | self.failUnlessEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.") | |
23206 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23207 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23208 | def test_maximum_float_rank0_Symbol_rank4(self): | |
23209 | arg0=0.353401580302 | |
23210 | arg1=Symbol(shape=(3, 2, 3, 4)) | |
23211 | res=maximum(arg0,arg1) | |
23212 | s1=numarray.array([[[[-0.074589175407685948, 0.90104233790371513, 0.51151358320482165, 0.34042635800176368], [-0.77069325275751432, 0.71809715519512718, 0.76053478594611623, 0.45758260571055409], [-0.71024122512929955, -0.72118531031641853, 0.50390667571259962, 0.50204805556941356]], [[0.42183042301612583, -0.66538505104501611, -0.017057666144933759, -0.051306118703368098], [0.31222165692460968, -0.70310368247319088, -0.56746371028474152, 0.94129894601728492], [0.11142483414811877, -0.93362210033321413, 0.45587886579292758, 0.44507434385519118]]], [[[-0.0097583613027334426, 0.85209277666498373, 0.46992517586499605, 0.66074063590208398], [-0.17277498356081411, -0.09932228691815137, -0.50321737390269261, 0.95425990318493614], [-0.70104206593764151, 0.28297161453347353, -0.96791368879574313, -0.48721758409606686]], [[-0.046150958046365709, 0.10237443745619701, -0.13905807947799942, -0.39720574385032692], [0.65752541777313112, 0.50685244861699741, -0.56200626604121928, 0.39118546164001455], [-0.52590955373082471, 0.065148720258848991, -0.45477254310198667, -0.52903327237098385]]], [[[0.077120492993482559, -0.45795355685591566, 0.49594295266032584, -0.080271954488129849], [-0.67763184010244304, -0.41492698239532411, 0.15548079600238562, -0.092486466219969587], [-0.2018432259717875, 0.10685915175149963, -0.99636262057444425, 0.83639721625518804]], [[0.76208463161351037, 0.62163409104824519, -0.21443990356109865, -0.71119347731782123], [0.56204308504316747, 0.48054590873774083, 0.29921579200350279, 0.16272132140533691], [0.75211547917892352, 0.38904318222092527, 0.57327591456049376, 0.63678554842892932]]]]) | |
23213 | sub=res.substitute({arg1:s1}) | |
23214 | ref=numarray.array([[[[0.35340158030175606, 0.90104233790371513, 0.51151358320482165, 0.35340158030175606], [0.35340158030175606, 0.71809715519512718, 0.76053478594611623, 0.45758260571055409], [0.35340158030175606, 0.35340158030175606, 0.50390667571259962, 0.50204805556941356]], [[0.42183042301612583, 0.35340158030175606, 0.35340158030175606, 0.35340158030175606], [0.35340158030175606, 0.35340158030175606, 0.35340158030175606, 0.94129894601728492], [0.35340158030175606, 0.35340158030175606, 0.45587886579292758, 0.44507434385519118]]], [[[0.35340158030175606, 0.85209277666498373, 0.46992517586499605, 0.66074063590208398], [0.35340158030175606, 0.35340158030175606, 0.35340158030175606, 0.95425990318493614], [0.35340158030175606, 0.35340158030175606, 0.35340158030175606, 0.35340158030175606]], [[0.35340158030175606, 0.35340158030175606, 0.35340158030175606, 0.35340158030175606], [0.65752541777313112, 0.50685244861699741, 0.35340158030175606, 0.39118546164001455], [0.35340158030175606, 0.35340158030175606, 0.35340158030175606, 0.35340158030175606]]], [[[0.35340158030175606, 0.35340158030175606, 0.49594295266032584, 0.35340158030175606], [0.35340158030175606, 0.35340158030175606, 0.35340158030175606, 0.35340158030175606], [0.35340158030175606, 0.35340158030175606, 0.35340158030175606, 0.83639721625518804]], [[0.76208463161351037, 0.62163409104824519, 0.35340158030175606, 0.35340158030175606], [0.56204308504316747, 0.48054590873774083, 0.35340158030175606, 0.35340158030175606], [0.75211547917892352, 0.38904318222092527, 0.57327591456049376, 0.63678554842892932]]]]) | |
23215 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23216 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
23217 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23218 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23219 | def test_maximum_float_rank0_constData_rank4(self): | |
23220 | arg0=-0.309869238816 | |
23221 | arg1=Data(numarray.array([[[[-0.82719032260804259, 0.55581165940832689, 0.28993332944093009, -0.86289948135541761], [0.48402181856866533, -0.32199675516574411, 0.12059109046218897, -0.7225649933438465], [-0.83246155788795284, 0.81949583430522099, 0.917821601053878, -0.38511162370320817]], [[0.040807935475384971, 0.064255792480005569, -0.31189093961899572, -0.84263132870438207], [-0.019662050520152574, 0.44586496426970701, -0.91681580233687932, -0.18241240078470145], [-0.5433480154993422, -0.59905565233432823, -0.92180233099065312, 0.86950034082755967]]], [[[0.59960822306615458, 0.13652846774954908, 0.43957232336106244, -0.43425247806437417], [-0.96917998667692262, 0.55216812010001926, 0.71335421685640177, 0.58559993798062027], [0.70518632845671458, -0.51213306047690121, 0.49991004029291486, -0.88896060694390422]], [[-0.01327086420919299, 0.94285928205783565, 0.36084019612625773, 0.75948720217972943], [0.15534832801909948, -0.087517839294278144, -0.82737480559591559, -0.17830159519382138], [-0.53216202742506535, 0.14079322663297011, 0.51872828089506218, -0.87286763824554892]]], [[[0.63517519655793753, 0.83248640824649534, -0.96421638668998866, -0.21027115956215714], [-0.65484094298333928, -0.20529300129283179, 0.30264230449111329, 0.57118632679487069], [0.94473501747170197, -0.073741122006270921, -0.16445760290671507, -0.94122715459958095]], [[-0.47320172714174435, 0.52414108821599092, -0.58822269419300688, 0.65154104107711608], [0.79073955181970002, 0.66222126451513996, 0.50406761329019711, 0.80692979137230991], [-0.44007779482511467, 0.83184141637396403, -0.59153030329212752, 0.67780297389993294]]]]),self.functionspace) | |
23222 | res=maximum(arg0,arg1) | |
23223 | ref=Data(numarray.array([[[[-0.30986923881604533, 0.55581165940832689, 0.28993332944093009, -0.30986923881604533], [0.48402181856866533, -0.30986923881604533, 0.12059109046218897, -0.30986923881604533], [-0.30986923881604533, 0.81949583430522099, 0.917821601053878, -0.30986923881604533]], [[0.040807935475384971, 0.064255792480005569, -0.30986923881604533, -0.30986923881604533], [-0.019662050520152574, 0.44586496426970701, -0.30986923881604533, -0.18241240078470145], [-0.30986923881604533, -0.30986923881604533, -0.30986923881604533, 0.86950034082755967]]], [[[0.59960822306615458, 0.13652846774954908, 0.43957232336106244, -0.30986923881604533], [-0.30986923881604533, 0.55216812010001926, 0.71335421685640177, 0.58559993798062027], [0.70518632845671458, -0.30986923881604533, 0.49991004029291486, -0.30986923881604533]], [[-0.01327086420919299, 0.94285928205783565, 0.36084019612625773, 0.75948720217972943], [0.15534832801909948, -0.087517839294278144, -0.30986923881604533, -0.17830159519382138], [-0.30986923881604533, 0.14079322663297011, 0.51872828089506218, -0.30986923881604533]]], [[[0.63517519655793753, 0.83248640824649534, -0.30986923881604533, -0.21027115956215714], [-0.30986923881604533, -0.20529300129283179, 0.30264230449111329, 0.57118632679487069], [0.94473501747170197, -0.073741122006270921, -0.16445760290671507, -0.30986923881604533]], [[-0.30986923881604533, 0.52414108821599092, -0.30986923881604533, 0.65154104107711608], [0.79073955181970002, 0.66222126451513996, 0.50406761329019711, 0.80692979137230991], [-0.30986923881604533, 0.83184141637396403, -0.30986923881604533, 0.67780297389993294]]]]),self.functionspace) | |
23224 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23225 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
23226 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23227 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23228 | def test_maximum_float_rank0_expandedData_rank4(self): | |
23229 | arg0=-0.246649004468 | |
23230 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23231 | arg1=msk_arg1*numarray.array([[[[-0.59710738457463131, 0.081437393836007343, -0.56546756227867667, 0.71443872053420754], [-0.57457972849842576, 0.99714958865565517, -0.39999443875374929, -0.68094907708339836], [0.34526888607366546, -0.29241451792195905, 0.96907276723625935, -0.2966708791455217]], [[-0.76911685555342713, 0.21001220920747699, 0.7216150128564951, 0.57784624578115795], [0.59505769173662104, -0.11354294660473241, -0.66879018252488964, 0.78630853516684396], [0.3616307103083698, -0.79300540303062417, 0.74450579924491178, -0.054555970573139767]]], [[[0.96283128026153286, -0.87620458144557722, 0.72154059555131611, 0.0082452389660727654], [-0.046764826200485832, -0.53421181085747382, -0.19205291797994817, 0.15732232154864123], [-0.64350186911984397, 0.86535072837345894, -0.089737099310619683, -0.68915912536904322]], [[-0.50600653327166056, 0.87271444603618842, 0.42777020885243378, 0.63522958101972282], [-0.62649776548253322, 0.4567028350414013, 0.97523051451214271, 0.81579778175168283], [0.20125503319935079, -0.46379240558699131, -0.31245213377702896, 0.2704000376928466]]], [[[-0.52356266147432984, 0.17857675536580886, 0.3664267659935363, -0.88731256350709842], [-0.37314717051082713, 0.54211837452172662, -0.72485428615154301, -0.60715112600284726], [-0.99925424756131687, -0.16075147245083277, -0.0025301737170317917, 0.14075502002330875]], [[-0.72510015564658348, -0.070820851711875132, -0.05397335487409638, 0.31296807923888648], [0.66626010161325921, -0.7189380142049282, -0.62806927909760879, 0.23068004843743117], [-0.70574206651459992, -0.10745983979108953, -0.16531954799426085, -0.43129597709381007]]]])+(1.-msk_arg1)*numarray.array([[[[0.87166570761445938, 0.7318590182568474, -0.80737962090297621, 0.53766528032150029], [-0.29770111995100423, -0.041729104475766832, 0.95558043277951188, 0.87068423363682523], [0.26116387820103548, 0.76929801350975846, -0.34600777484521661, 0.20956877787614303]], [[-0.27623529169912397, 0.74714116143240372, 0.67467631548270068, 0.80485965465015274], [-0.80196951310483411, 0.54024415368197976, -0.45263989703849994, -0.77389469864887639], [-0.11922685978923897, 0.39196315394661263, 0.17728969359335789, -0.38647232675584942]]], [[[0.96589541331221995, -0.80607305323690448, -0.7174848711693449, 0.37455766619796327], [0.91224675515514875, -0.8324612503371378, -0.95542285313177433, -0.11861636937415732], [0.47029221874868399, -0.40274109861783103, 0.9175933763798334, -0.43517134542523084]], [[-0.47437396776048946, -0.62388433551176026, -0.93178844269694805, 0.16109167169456717], [0.41540675061264087, 0.56983043087032437, 0.79225905558275778, -0.70471106926370264], [0.57876248922509843, -0.92178848481156983, -0.20102218593254717, -0.51116400848044763]]], [[[0.43214438484520512, -0.44676797608176422, -0.96373941940887264, -0.97610643146800369], [0.1482565940064382, -0.15856386047336768, -0.97338314492097022, -0.77655581838335452], [0.14918854112868329, 0.35190145831475594, 0.76106715747610876, 0.87042812467135966]], [[0.5937340223957881, 0.93249676000364778, 0.62934483950694187, -0.79475089188750059], [-0.7844570636858641, 0.063504498696464129, 0.80077845206462461, -0.17147808526676922], [0.77647533980748817, -0.41826398787923291, -0.93662968561496873, 0.5899829279078268]]]]) | |
23232 | res=maximum(arg0,arg1) | |
23233 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23234 | ref=msk_ref*numarray.array([[[[-0.24664900446763838, 0.081437393836007343, -0.24664900446763838, 0.71443872053420754], [-0.24664900446763838, 0.99714958865565517, -0.24664900446763838, -0.24664900446763838], [0.34526888607366546, -0.24664900446763838, 0.96907276723625935, -0.24664900446763838]], [[-0.24664900446763838, 0.21001220920747699, 0.7216150128564951, 0.57784624578115795], [0.59505769173662104, -0.11354294660473241, -0.24664900446763838, 0.78630853516684396], [0.3616307103083698, -0.24664900446763838, 0.74450579924491178, -0.054555970573139767]]], [[[0.96283128026153286, -0.24664900446763838, 0.72154059555131611, 0.0082452389660727654], [-0.046764826200485832, -0.24664900446763838, -0.19205291797994817, 0.15732232154864123], [-0.24664900446763838, 0.86535072837345894, -0.089737099310619683, -0.24664900446763838]], [[-0.24664900446763838, 0.87271444603618842, 0.42777020885243378, 0.63522958101972282], [-0.24664900446763838, 0.4567028350414013, 0.97523051451214271, 0.81579778175168283], [0.20125503319935079, -0.24664900446763838, -0.24664900446763838, 0.2704000376928466]]], [[[-0.24664900446763838, 0.17857675536580886, 0.3664267659935363, -0.24664900446763838], [-0.24664900446763838, 0.54211837452172662, -0.24664900446763838, -0.24664900446763838], [-0.24664900446763838, -0.16075147245083277, -0.0025301737170317917, 0.14075502002330875]], [[-0.24664900446763838, -0.070820851711875132, -0.05397335487409638, 0.31296807923888648], [0.66626010161325921, -0.24664900446763838, -0.24664900446763838, 0.23068004843743117], [-0.24664900446763838, -0.10745983979108953, -0.16531954799426085, -0.24664900446763838]]]])+(1.-msk_ref)*numarray.array([[[[0.87166570761445938, 0.7318590182568474, -0.24664900446763838, 0.53766528032150029], [-0.24664900446763838, -0.041729104475766832, 0.95558043277951188, 0.87068423363682523], [0.26116387820103548, 0.76929801350975846, -0.24664900446763838, 0.20956877787614303]], [[-0.24664900446763838, 0.74714116143240372, 0.67467631548270068, 0.80485965465015274], [-0.24664900446763838, 0.54024415368197976, -0.24664900446763838, -0.24664900446763838], [-0.11922685978923897, 0.39196315394661263, 0.17728969359335789, -0.24664900446763838]]], [[[0.96589541331221995, -0.24664900446763838, -0.24664900446763838, 0.37455766619796327], [0.91224675515514875, -0.24664900446763838, -0.24664900446763838, -0.11861636937415732], [0.47029221874868399, -0.24664900446763838, 0.9175933763798334, -0.24664900446763838]], [[-0.24664900446763838, -0.24664900446763838, -0.24664900446763838, 0.16109167169456717], [0.41540675061264087, 0.56983043087032437, 0.79225905558275778, -0.24664900446763838], [0.57876248922509843, -0.24664900446763838, -0.20102218593254717, -0.24664900446763838]]], [[[0.43214438484520512, -0.24664900446763838, -0.24664900446763838, -0.24664900446763838], [0.1482565940064382, -0.15856386047336768, -0.24664900446763838, -0.24664900446763838], [0.14918854112868329, 0.35190145831475594, 0.76106715747610876, 0.87042812467135966]], [[0.5937340223957881, 0.93249676000364778, 0.62934483950694187, -0.24664900446763838], [-0.24664900446763838, 0.063504498696464129, 0.80077845206462461, -0.17147808526676922], [0.77647533980748817, -0.24664900446763838, -0.24664900446763838, 0.5899829279078268]]]]) | |
23235 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23236 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
23237 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23238 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23239 | def test_maximum_array_rank0_float_rank0(self): | |
23240 | arg0=numarray.array(-0.532218032885) | |
23241 | arg1=-0.367677151081 | |
23242 | res=maximum(arg0,arg1) | |
23243 | ref=numarray.array(-0.367677151081) | |
23244 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23245 | self.failUnlessEqual(res.shape,(),"wrong shape of result.") | |
23246 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23247 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23248 | def test_maximum_array_rank1_float_rank0(self): | |
23249 | arg0=numarray.array([0.53113072385818016, -0.91297296718973731]) | |
23250 | arg1=0.192754148616 | |
23251 | res=maximum(arg0,arg1) | |
23252 | ref=numarray.array([0.53113072385818016, 0.19275414861572537]) | |
23253 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23254 | self.failUnlessEqual(res.shape,(2,),"wrong shape of result.") | |
23255 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23256 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23257 | def test_maximum_array_rank2_float_rank0(self): | |
23258 | arg0=numarray.array([[-0.83224495764259587, 0.67546682831068661, 0.79825688470140466, -0.51659524388186018, -0.57330212318607887], [0.43871883762893171, -0.51383061657367102, 0.046022377444661977, -0.97181480474218085, -0.064914882677348462], [0.54107834535109811, 0.52030930437850165, -0.46403217495914517, -0.40333646983529814, 0.14402492053142035], [-0.06466356036920895, -0.72560803049513556, -0.71248570650624976, 0.29239946340327383, 0.23126053673271052]]) | |
23259 | arg1=0.436559137295 | |
23260 | res=maximum(arg0,arg1) | |
23261 | ref=numarray.array([[0.43655913729458451, 0.67546682831068661, 0.79825688470140466, 0.43655913729458451, 0.43655913729458451], [0.43871883762893171, 0.43655913729458451, 0.43655913729458451, 0.43655913729458451, 0.43655913729458451], [0.54107834535109811, 0.52030930437850165, 0.43655913729458451, 0.43655913729458451, 0.43655913729458451], [0.43655913729458451, 0.43655913729458451, 0.43655913729458451, 0.43655913729458451, 0.43655913729458451]]) | |
23262 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23263 | self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.") | |
23264 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23265 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23266 | def test_maximum_array_rank3_float_rank0(self): | |
23267 | arg0=numarray.array([[[0.14602536321923187, 0.3890404886953438], [0.96763189489480217, 0.31878780255153472]], [[-0.80681415429363024, 0.81150006186927182], [0.085441963781010877, 0.28294027876384797]], [[-0.90676678758245544, 0.035304671448607161], [-0.24178422686744017, -0.020920873167083132]], [[-0.85375981355743735, -0.44307345060683789], [0.0374669536660035, -0.0058344936858338858]], [[0.31755388514905247, 0.33655876978208488], [-0.60668072237969684, -0.046438959267768309]], [[-0.74363599042485151, -0.8956664888069259], [-0.53199684552981585, 0.75892708027917499]]]) | |
23268 | arg1=-0.149468998389 | |
23269 | res=maximum(arg0,arg1) | |
23270 | ref=numarray.array([[[0.14602536321923187, 0.3890404886953438], [0.96763189489480217, 0.31878780255153472]], [[-0.1494689983892894, 0.81150006186927182], [0.085441963781010877, 0.28294027876384797]], [[-0.1494689983892894, 0.035304671448607161], [-0.1494689983892894, -0.020920873167083132]], [[-0.1494689983892894, -0.1494689983892894], [0.0374669536660035, -0.0058344936858338858]], [[0.31755388514905247, 0.33655876978208488], [-0.1494689983892894, -0.046438959267768309]], [[-0.1494689983892894, -0.1494689983892894], [-0.1494689983892894, 0.75892708027917499]]]) | |
23271 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23272 | self.failUnlessEqual(res.shape,(6, 2, 2),"wrong shape of result.") | |
23273 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23274 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23275 | def test_maximum_array_rank4_float_rank0(self): | |
23276 | arg0=numarray.array([[[[0.2890956567711751, 0.0047389611017556454, 0.87892527211444582, -0.65150693309569196], [0.41621480995390114, -0.43854307594957254, -0.59815785643830077, -0.67517272581107557], [0.29083357354248873, -0.34488587447865737, -0.3534529402795854, -0.76014085074946847]], [[-0.19051880582497072, 0.85284977603728396, 0.31270253036076934, 0.37421013369344447], [0.71318255965443345, 0.92162734459590911, 0.67934988220751147, -0.42337007079808697], [0.42833893416405266, 0.30720360302238192, 0.27000152473334049, 0.95393479511777279]]], [[[-0.098035752002608278, 0.13176090528152407, 0.62934363744184929, -0.053289126771334905], [0.81346047837084501, -0.45301649520463716, -0.96631411831608749, -0.071951542993987649], [0.99690192197172367, -0.025819634205427322, 0.87468585164061108, 0.60501309254424518]], [[-0.88303485657993463, 0.46312758028512135, -0.77275723545859076, -0.067439349816685201], [0.14089517815207553, 0.56655437330646286, 0.35573146108388021, -0.9370989113947783], [-0.33072965554665301, -0.81929016865935234, -0.981755182164328, -0.80123180974034836]]], [[[0.32559736893252644, -0.15298445424344309, 0.5756357845038651, 0.54846826957121642], [0.49314026154864776, 0.40147202599848408, 0.65052530484204629, 0.78030715854096466], [0.11772129008710874, 0.97339684272768734, -0.46213970918704739, 0.64480146515364178]], [[-0.489873441461109, 0.67676986710802556, 0.57320598982638238, -0.081510204873377567], [0.14129642797645747, -0.88117171552134099, 0.62120016125873723, 0.62570138942740905], [-0.4571545505832082, 0.18504471982789994, 0.269612515446229, -0.92783580872646998]]]]) | |
23277 | arg1=0.44439427692 | |
23278 | res=maximum(arg0,arg1) | |
23279 | ref=numarray.array([[[[0.44439427692047384, 0.44439427692047384, 0.87892527211444582, 0.44439427692047384], [0.44439427692047384, 0.44439427692047384, 0.44439427692047384, 0.44439427692047384], [0.44439427692047384, 0.44439427692047384, 0.44439427692047384, 0.44439427692047384]], [[0.44439427692047384, 0.85284977603728396, 0.44439427692047384, 0.44439427692047384], [0.71318255965443345, 0.92162734459590911, 0.67934988220751147, 0.44439427692047384], [0.44439427692047384, 0.44439427692047384, 0.44439427692047384, 0.95393479511777279]]], [[[0.44439427692047384, 0.44439427692047384, 0.62934363744184929, 0.44439427692047384], [0.81346047837084501, 0.44439427692047384, 0.44439427692047384, 0.44439427692047384], [0.99690192197172367, 0.44439427692047384, 0.87468585164061108, 0.60501309254424518]], [[0.44439427692047384, 0.46312758028512135, 0.44439427692047384, 0.44439427692047384], [0.44439427692047384, 0.56655437330646286, 0.44439427692047384, 0.44439427692047384], [0.44439427692047384, 0.44439427692047384, 0.44439427692047384, 0.44439427692047384]]], [[[0.44439427692047384, 0.44439427692047384, 0.5756357845038651, 0.54846826957121642], [0.49314026154864776, 0.44439427692047384, 0.65052530484204629, 0.78030715854096466], [0.44439427692047384, 0.97339684272768734, 0.44439427692047384, 0.64480146515364178]], [[0.44439427692047384, 0.67676986710802556, 0.57320598982638238, 0.44439427692047384], [0.44439427692047384, 0.44439427692047384, 0.62120016125873723, 0.62570138942740905], [0.44439427692047384, 0.44439427692047384, 0.44439427692047384, 0.44439427692047384]]]]) | |
23280 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23281 | self.failUnlessEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.") | |
23282 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23283 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23284 | def test_maximum_array_rank0_array_rank0(self): | |
23285 | arg0=numarray.array(-0.595911728088) | |
23286 | arg1=numarray.array(-0.259958577128) | |
23287 | res=maximum(arg0,arg1) | |
23288 | ref=numarray.array(-0.259958577128) | |
23289 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23290 | self.failUnlessEqual(res.shape,(),"wrong shape of result.") | |
23291 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23292 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23293 | def test_maximum_array_rank1_array_rank0(self): | |
23294 | arg0=numarray.array([0.70448785703212291, 0.83900014998124073]) | |
23295 | arg1=numarray.array(-0.728326601622) | |
23296 | res=maximum(arg0,arg1) | |
23297 | ref=numarray.array([0.70448785703212291, 0.83900014998124073]) | |
23298 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23299 | self.failUnlessEqual(res.shape,(2,),"wrong shape of result.") | |
23300 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23301 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23302 | def test_maximum_array_rank2_array_rank0(self): | |
23303 | arg0=numarray.array([[0.58907572104688044, -0.30767970415015888, -0.78138846520643046, -0.15168954291983616, 0.31446212443091293], [0.074998472598995392, -0.9250742963204186, 0.45334932675665041, -0.95916572344077733, -0.99342314865250936], [-0.79251531920902263, 0.44321789574157977, 0.62908133704628444, 0.24472622296386093, 0.29465980693370675], [-0.5523390670941164, -0.096556923965434915, -0.97293609728291464, 0.4811104330547229, 0.11676047360942654]]) | |
23304 | arg1=numarray.array(-0.637835089534) | |
23305 | res=maximum(arg0,arg1) | |
23306 | ref=numarray.array([[0.58907572104688044, -0.30767970415015888, -0.63783508953404722, -0.15168954291983616, 0.31446212443091293], [0.074998472598995392, -0.63783508953404722, 0.45334932675665041, -0.63783508953404722, -0.63783508953404722], [-0.63783508953404722, 0.44321789574157977, 0.62908133704628444, 0.24472622296386093, 0.29465980693370675], [-0.5523390670941164, -0.096556923965434915, -0.63783508953404722, 0.4811104330547229, 0.11676047360942654]]) | |
23307 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23308 | self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.") | |
23309 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23310 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23311 | def test_maximum_array_rank3_array_rank0(self): | |
23312 | arg0=numarray.array([[[0.26078403166817066, -0.88883099092846662], [0.2962776357981165, 0.33765471443325268]], [[0.61994569524479037, -0.86070803156387798], [0.40887497854892496, -0.95032693825538606]], [[-0.6230603384583091, 0.84641044210513128], [0.072929215696905469, 0.63605426925408093]], [[0.82476138834838242, -0.87239621000692358], [0.9136576981759601, 0.012874827321107896]], [[0.6527601185704035, 0.45834972014119924], [-0.20281376602514722, 0.78801993661046477]], [[-0.84382527553821407, 0.69859016456466971], [0.95609346718482136, -0.9642394043877307]]]) | |
23313 | arg1=numarray.array(-0.0639685246813) | |
23314 | res=maximum(arg0,arg1) | |
23315 | ref=numarray.array([[[0.26078403166817066, -0.063968524681262906], [0.2962776357981165, 0.33765471443325268]], [[0.61994569524479037, -0.063968524681262906], [0.40887497854892496, -0.063968524681262906]], [[-0.063968524681262906, 0.84641044210513128], [0.072929215696905469, 0.63605426925408093]], [[0.82476138834838242, -0.063968524681262906], [0.9136576981759601, 0.012874827321107896]], [[0.6527601185704035, 0.45834972014119924], [-0.063968524681262906, 0.78801993661046477]], [[-0.063968524681262906, 0.69859016456466971], [0.95609346718482136, -0.063968524681262906]]]) | |
23316 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23317 | self.failUnlessEqual(res.shape,(6, 2, 2),"wrong shape of result.") | |
23318 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23319 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23320 | def test_maximum_array_rank4_array_rank0(self): | |
23321 | arg0=numarray.array([[[[-0.49178507725843357, -0.95412613874160401, -0.89953408681402758, -0.4182783638072558], [-0.12851206262547121, 0.97771672278447719, 0.095498689842355322, -0.63677823186616767], [-0.31171543678709579, -0.24066261014019164, 0.8884558662985651, -0.86534369235026132]], [[0.41073749486304023, -0.75082798331554312, -0.021514401962046348, -0.4552145355922177], [0.025376418086104691, 0.94693831924338046, 0.72528013847070816, 0.5590032330140231], [-0.63961957547864201, 0.38553731067491559, 0.47766722193193556, 0.22722302846704578]]], [[[-0.8552086040279212, -0.028628848798257334, 0.39615293686569841, 0.60472409304678898], [-0.76179395489150892, 0.34743550408059365, 0.84900306720985297, -0.32754549604906047], [0.96774618220062791, -0.17510456094746396, -0.83577780367198806, -0.28595508510654843]], [[-0.72033121788336163, -0.96380753221847604, 0.64121075422201179, 0.50807412144193731], [-0.22520904548844145, -0.79626857735444134, 0.6727388150821505, -0.97429723888611686], [-0.3912584771763985, 0.017073154831940274, -0.78645964556472814, 0.063579858350630403]]], [[[0.49275761913585359, 0.68061912084321108, 0.27488873542534376, -0.91020336944963454], [0.38754903931740148, -0.095266564605377857, -0.34983002073831537, -0.98686346316121343], [-0.57870251452427079, 0.019782802975875313, -0.99030465294393522, 0.36519674435393079]], [[0.36201122081142789, 0.89247761722577512, 0.88862029406919207, 0.65118385314611027], [0.62444020668337985, 0.29010577239708102, 0.50090883083435256, -0.86322012454452723], [-0.25882379276404111, 0.50333245341748101, -0.98127424266544994, 0.32881151993132085]]]]) | |
23322 | arg1=numarray.array(0.54009693064) | |
23323 | res=maximum(arg0,arg1) | |
23324 | ref=numarray.array([[[[0.54009693064018083, 0.54009693064018083, 0.54009693064018083, 0.54009693064018083], [0.54009693064018083, 0.97771672278447719, 0.54009693064018083, 0.54009693064018083], [0.54009693064018083, 0.54009693064018083, 0.8884558662985651, 0.54009693064018083]], [[0.54009693064018083, 0.54009693064018083, 0.54009693064018083, 0.54009693064018083], [0.54009693064018083, 0.94693831924338046, 0.72528013847070816, 0.5590032330140231], [0.54009693064018083, 0.54009693064018083, 0.54009693064018083, 0.54009693064018083]]], [[[0.54009693064018083, 0.54009693064018083, 0.54009693064018083, 0.60472409304678898], [0.54009693064018083, 0.54009693064018083, 0.84900306720985297, 0.54009693064018083], [0.96774618220062791, 0.54009693064018083, 0.54009693064018083, 0.54009693064018083]], [[0.54009693064018083, 0.54009693064018083, 0.64121075422201179, 0.54009693064018083], [0.54009693064018083, 0.54009693064018083, 0.6727388150821505, 0.54009693064018083], [0.54009693064018083, 0.54009693064018083, 0.54009693064018083, 0.54009693064018083]]], [[[0.54009693064018083, 0.68061912084321108, 0.54009693064018083, 0.54009693064018083], [0.54009693064018083, 0.54009693064018083, 0.54009693064018083, 0.54009693064018083], [0.54009693064018083, 0.54009693064018083, 0.54009693064018083, 0.54009693064018083]], [[0.54009693064018083, 0.89247761722577512, 0.88862029406919207, 0.65118385314611027], [0.62444020668337985, 0.54009693064018083, 0.54009693064018083, 0.54009693064018083], [0.54009693064018083, 0.54009693064018083, 0.54009693064018083, 0.54009693064018083]]]]) | |
23325 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23326 | self.failUnlessEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.") | |
23327 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23328 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23329 | def test_maximum_array_rank0_Symbol_rank0(self): | |
23330 | arg0=numarray.array(-0.12010332885) | |
23331 | arg1=Symbol(shape=()) | |
23332 | res=maximum(arg0,arg1) | |
23333 | s1=numarray.array(-0.246027149377) | |
23334 | sub=res.substitute({arg1:s1}) | |
23335 | ref=numarray.array(-0.12010332885) | |
23336 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23337 | self.failUnlessEqual(res.getShape(),(),"wrong shape of result.") | |
23338 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23339 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23340 | def test_maximum_array_rank1_Symbol_rank0(self): | |
23341 | arg0=numarray.array([-0.95932830843055505, 0.18950193862059872]) | |
23342 | arg1=Symbol(shape=()) | |
23343 | res=maximum(arg0,arg1) | |
23344 | s1=numarray.array(-0.920292144762) | |
23345 | sub=res.substitute({arg1:s1}) | |
23346 | ref=numarray.array([-0.92029214476235244, 0.18950193862059872]) | |
23347 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23348 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
23349 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23350 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23351 | def test_maximum_array_rank2_Symbol_rank0(self): | |
23352 | arg0=numarray.array([[0.30088865432610801, -0.49045308105451935, 0.49998687647978324, -0.5043343548276058, -0.76352630779203201], [-0.65678898472721525, -0.38338721730936975, 0.72073131734926532, 0.34776513180427382, 0.94312963079951628], [0.96205564096436347, 0.15762892075645407, 0.48298080817733147, -0.60009884409183911, 0.35402981599768824], [0.44909106753608219, -0.02511293307884066, 0.69859396147005937, -0.42889283801171785, -0.58611648158759833]]) | |
23353 | arg1=Symbol(shape=()) | |
23354 | res=maximum(arg0,arg1) | |
23355 | s1=numarray.array(0.373183154648) | |
23356 | sub=res.substitute({arg1:s1}) | |
23357 | ref=numarray.array([[0.37318315464849028, 0.37318315464849028, 0.49998687647978324, 0.37318315464849028, 0.37318315464849028], [0.37318315464849028, 0.37318315464849028, 0.72073131734926532, 0.37318315464849028, 0.94312963079951628], [0.96205564096436347, 0.37318315464849028, 0.48298080817733147, 0.37318315464849028, 0.37318315464849028], [0.44909106753608219, 0.37318315464849028, 0.69859396147005937, 0.37318315464849028, 0.37318315464849028]]) | |
23358 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23359 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
23360 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23361 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23362 | def test_maximum_array_rank3_Symbol_rank0(self): | |
23363 | arg0=numarray.array([[[0.36396791109765414, -0.08330143784202626], [-0.20497744418340713, -0.63338393016692551]], [[-0.60496788043358785, -0.34910307601449686], [0.89311096736079221, 0.83537010849383497]], [[0.17354190245914469, -0.37208307861539325], [0.36343762172766292, 0.1496343652379688]], [[-0.95049259704684275, 0.20280821539940397], [0.18376026656017297, 0.34535160775388185]], [[-0.52413579876018224, -0.064824980130857357], [-0.5543617242149792, 0.11168558960890507]], [[-0.088753737311743963, 0.67201033300979862], [0.95061730590983862, 0.25784978966847749]]]) | |
23364 | arg1=Symbol(shape=()) | |
23365 | res=maximum(arg0,arg1) | |
23366 | s1=numarray.array(0.248549928852) | |
23367 | sub=res.substitute({arg1:s1}) | |
23368 | ref=numarray.array([[[0.36396791109765414, 0.24854992885239846], [0.24854992885239846, 0.24854992885239846]], [[0.24854992885239846, 0.24854992885239846], [0.89311096736079221, 0.83537010849383497]], [[0.24854992885239846, 0.24854992885239846], [0.36343762172766292, 0.24854992885239846]], [[0.24854992885239846, 0.24854992885239846], [0.24854992885239846, 0.34535160775388185]], [[0.24854992885239846, 0.24854992885239846], [0.24854992885239846, 0.24854992885239846]], [[0.24854992885239846, 0.67201033300979862], [0.95061730590983862, 0.25784978966847749]]]) | |
23369 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23370 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
23371 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23372 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23373 | def test_maximum_array_rank4_Symbol_rank0(self): | |
23374 | arg0=numarray.array([[[[-0.99783734493539167, 0.93221628541660539, 0.91739007036958187, 0.17412987360539578], [0.8826971153609402, -0.10363858424513261, 0.34548814341091938, 0.51215656416203448], [0.016658545625886534, -0.012842449639625553, 0.17979122131168523, -0.67861237363219296]], [[0.51887494070803042, -0.073449427073168261, -0.069672952502191521, -0.82912309601618817], [0.87934065402431805, 0.80987886911230911, -0.18655551854370866, 0.76437067323631447], [0.7010984626936092, -0.65985831916807891, 0.68992206191709848, -0.82979817139792522]]], [[[0.51819922997563461, -0.54837890985730309, 0.44640834054324952, 0.3450034673133926], [-0.36058576044087731, 0.94431157210331707, -0.65233922911878395, 0.87237679742723495], [0.85356174139175089, 0.93268981921785055, 0.23511863710669312, -0.30862863582106992]], [[0.77404557587572698, 0.14724927186620507, 0.049443973895827664, 0.53935418395973755], [-0.69201435596394956, 0.17137097192210682, -0.67144154924437993, -0.70573887285393155], [-0.85460956391237519, -0.48604945173485148, 0.79847177238289135, -0.43722683723280498]]], [[[-0.70029815629498615, -0.0043327746067951534, 0.70002045844916161, 0.18344272718592047], [-0.10153380140243762, 0.095685144607773331, 0.65073337631981665, -0.23902831769201138], [-0.35840578736462159, 0.35575178107307925, -0.84190506332471604, -0.10043141709420578]], [[0.54995532515267564, -0.71750031361308975, 0.88839972599875372, -0.6533637185735155], [-0.017870534911850644, -0.87771051574766523, 0.37553987141326695, -0.11186989630308597], [0.59008553423755838, -0.58524730169973482, 0.91504377758136068, -0.5599777283515941]]]]) | |
23375 | arg1=Symbol(shape=()) | |
23376 | res=maximum(arg0,arg1) | |
23377 | s1=numarray.array(-0.856304315214) | |
23378 | sub=res.substitute({arg1:s1}) | |
23379 | ref=numarray.array([[[[-0.85630431521365979, 0.93221628541660539, 0.91739007036958187, 0.17412987360539578], [0.8826971153609402, -0.10363858424513261, 0.34548814341091938, 0.51215656416203448], [0.016658545625886534, -0.012842449639625553, 0.17979122131168523, -0.67861237363219296]], [[0.51887494070803042, -0.073449427073168261, -0.069672952502191521, -0.82912309601618817], [0.87934065402431805, 0.80987886911230911, -0.18655551854370866, 0.76437067323631447], [0.7010984626936092, -0.65985831916807891, 0.68992206191709848, -0.82979817139792522]]], [[[0.51819922997563461, -0.54837890985730309, 0.44640834054324952, 0.3450034673133926], [-0.36058576044087731, 0.94431157210331707, -0.65233922911878395, 0.87237679742723495], [0.85356174139175089, 0.93268981921785055, 0.23511863710669312, -0.30862863582106992]], [[0.77404557587572698, 0.14724927186620507, 0.049443973895827664, 0.53935418395973755], [-0.69201435596394956, 0.17137097192210682, -0.67144154924437993, -0.70573887285393155], [-0.85460956391237519, -0.48604945173485148, 0.79847177238289135, -0.43722683723280498]]], [[[-0.70029815629498615, -0.0043327746067951534, 0.70002045844916161, 0.18344272718592047], [-0.10153380140243762, 0.095685144607773331, 0.65073337631981665, -0.23902831769201138], [-0.35840578736462159, 0.35575178107307925, -0.84190506332471604, -0.10043141709420578]], [[0.54995532515267564, -0.71750031361308975, 0.88839972599875372, -0.6533637185735155], [-0.017870534911850644, -0.85630431521365979, 0.37553987141326695, -0.11186989630308597], [0.59008553423755838, -0.58524730169973482, 0.91504377758136068, -0.5599777283515941]]]]) | |
23380 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23381 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
23382 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23383 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23384 | def test_maximum_array_rank0_constData_rank0(self): | |
23385 | arg0=numarray.array(0.275719067126) | |
23386 | arg1=Data(0.379978099496,self.functionspace) | |
23387 | res=maximum(arg0,arg1) | |
23388 | ref=Data(0.379978099496,self.functionspace) | |
23389 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23390 | self.failUnlessEqual(res.getShape(),(),"wrong shape of result.") | |
23391 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23392 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23393 | def test_maximum_array_rank1_constData_rank0(self): | |
23394 | arg0=numarray.array([0.23412985120029073, 0.96842799591312634]) | |
23395 | arg1=Data(0.0282351777389,self.functionspace) | |
23396 | res=maximum(arg0,arg1) | |
23397 | ref=Data(numarray.array([0.23412985120029073, 0.96842799591312634]),self.functionspace) | |
23398 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23399 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
23400 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23401 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23402 | def test_maximum_array_rank2_constData_rank0(self): | |
23403 | arg0=numarray.array([[0.75083228363058563, 0.14021129209291994, 0.66454891543379668, 0.52438137383900618, 0.59989233019891586], [-0.64926806752121502, -0.31973316364062088, -0.15677459149134809, 0.94726185071047286, 0.77006499756531577], [0.96436511217108922, 0.10798486901631477, 0.49614119848238003, -0.58809677000944571, 0.40684393221640747], [-0.33426541098798523, -0.99641768740611458, 0.019371391555169426, 0.41032148071109376, 0.55944773037045037]]) | |
23404 | arg1=Data(0.0504551040829,self.functionspace) | |
23405 | res=maximum(arg0,arg1) | |
23406 | ref=Data(numarray.array([[0.75083228363058563, 0.14021129209291994, 0.66454891543379668, 0.52438137383900618, 0.59989233019891586], [0.050455104082914204, 0.050455104082914204, 0.050455104082914204, 0.94726185071047286, 0.77006499756531577], [0.96436511217108922, 0.10798486901631477, 0.49614119848238003, 0.050455104082914204, 0.40684393221640747], [0.050455104082914204, 0.050455104082914204, 0.050455104082914204, 0.41032148071109376, 0.55944773037045037]]),self.functionspace) | |
23407 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23408 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
23409 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23410 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23411 | def test_maximum_array_rank3_constData_rank0(self): | |
23412 | arg0=numarray.array([[[0.68078035361717415, 0.77513835622840355], [0.88778377916351281, -0.59991037059023289]], [[-0.31479263876172614, 0.52689690629824115], [-0.32445682623377969, 0.70068635269972779]], [[0.7068855302553303, -0.90632512202385662], [-0.69310089072096459, 0.21580652641517606]], [[0.18682929631820056, 0.98487526483307875], [-0.80732797686141189, -0.74387425497735205]], [[-0.94959049904561454, -0.26401122319745207], [0.97666196551554485, 0.13397037446463989]], [[-0.32237452231000963, 0.23366086287779164], [-0.66314084754224023, 0.061657994330439836]]]) | |
23413 | arg1=Data(0.887177842883,self.functionspace) | |
23414 | res=maximum(arg0,arg1) | |
23415 | ref=Data(numarray.array([[[0.88717784288295465, 0.88717784288295465], [0.88778377916351281, 0.88717784288295465]], [[0.88717784288295465, 0.88717784288295465], [0.88717784288295465, 0.88717784288295465]], [[0.88717784288295465, 0.88717784288295465], [0.88717784288295465, 0.88717784288295465]], [[0.88717784288295465, 0.98487526483307875], [0.88717784288295465, 0.88717784288295465]], [[0.88717784288295465, 0.88717784288295465], [0.97666196551554485, 0.88717784288295465]], [[0.88717784288295465, 0.88717784288295465], [0.88717784288295465, 0.88717784288295465]]]),self.functionspace) | |
23416 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23417 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
23418 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23419 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23420 | def test_maximum_array_rank4_constData_rank0(self): | |
23421 | arg0=numarray.array([[[[-0.44596394506288406, -0.99451216053143821, 0.80947207669238974, 0.53381678739762761], [0.24988481018214626, 0.97340528016730477, -0.88181308417483706, -0.10501736634476666], [0.67231055089947356, -0.41705694674616267, -0.99130432976066873, -0.76183835148666756]], [[0.87564340019720688, -0.56545607723354552, 0.35986228734119252, -0.95148055206041304], [0.54888663455682729, 0.97420887940931578, 0.058263938512163049, 0.76370352854831602], [-0.82673099109694004, 0.9659484007501713, -0.92707003031757185, -0.29800942664995955]]], [[[0.22672462889085043, 0.77216678282924223, -0.68765485895438716, -0.41035411530512622], [-0.10574234135684346, 0.41868370912220354, -0.42894043779354374, 0.14689038755897377], [0.80637358889951183, 0.0048710336014621269, 0.95227700237370771, 0.67742226677379058]], [[0.33943135111692935, 0.051854083713816834, -0.11097498559618657, -0.28695360058894792], [0.25170868190713924, 0.51759300366308403, 0.045719489002853608, 0.85414177693285209], [-0.62313668843495651, -0.65158905094111397, -0.35965515542399928, -0.91881459559837508]]], [[[0.50411396804110731, -0.35071960896573962, 0.85463428495185267, 0.047161400398034514], [0.96936117001305488, -0.23708858547871281, -0.97958490805427312, 0.19911749296919523], [0.3558068103726566, 0.83166317419688163, 0.094348126909065133, 0.53229454234478757]], [[-0.95064691521898426, 0.40080396732915236, 0.33234699751344388, -0.9871206815396758], [0.98903106268798591, 0.091842667447183279, 0.29485522713344281, -0.33705972294401088], [0.29805334379644233, -0.9604786924125317, -0.73602864043687255, -0.40470873942057994]]]]) | |
23422 | arg1=Data(-0.176207534638,self.functionspace) | |
23423 | res=maximum(arg0,arg1) | |
23424 | ref=Data(numarray.array([[[[-0.17620753463766059, -0.17620753463766059, 0.80947207669238974, 0.53381678739762761], [0.24988481018214626, 0.97340528016730477, -0.17620753463766059, -0.10501736634476666], [0.67231055089947356, -0.17620753463766059, -0.17620753463766059, -0.17620753463766059]], [[0.87564340019720688, -0.17620753463766059, 0.35986228734119252, -0.17620753463766059], [0.54888663455682729, 0.97420887940931578, 0.058263938512163049, 0.76370352854831602], [-0.17620753463766059, 0.9659484007501713, -0.17620753463766059, -0.17620753463766059]]], [[[0.22672462889085043, 0.77216678282924223, -0.17620753463766059, -0.17620753463766059], [-0.10574234135684346, 0.41868370912220354, -0.17620753463766059, 0.14689038755897377], [0.80637358889951183, 0.0048710336014621269, 0.95227700237370771, 0.67742226677379058]], [[0.33943135111692935, 0.051854083713816834, -0.11097498559618657, -0.17620753463766059], [0.25170868190713924, 0.51759300366308403, 0.045719489002853608, 0.85414177693285209], [-0.17620753463766059, -0.17620753463766059, -0.17620753463766059, -0.17620753463766059]]], [[[0.50411396804110731, -0.17620753463766059, 0.85463428495185267, 0.047161400398034514], [0.96936117001305488, -0.17620753463766059, -0.17620753463766059, 0.19911749296919523], [0.3558068103726566, 0.83166317419688163, 0.094348126909065133, 0.53229454234478757]], [[-0.17620753463766059, 0.40080396732915236, 0.33234699751344388, -0.17620753463766059], [0.98903106268798591, 0.091842667447183279, 0.29485522713344281, -0.17620753463766059], [0.29805334379644233, -0.17620753463766059, -0.17620753463766059, -0.17620753463766059]]]]),self.functionspace) | |
23425 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23426 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
23427 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23428 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23429 | def test_maximum_array_rank0_expandedData_rank0(self): | |
23430 | arg0=numarray.array(-0.239808661002) | |
23431 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23432 | arg1=msk_arg1*(-0.499507234748)+(1.-msk_arg1)*(-0.671148207596) | |
23433 | res=maximum(arg0,arg1) | |
23434 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23435 | ref=msk_ref*(-0.239808661002)+(1.-msk_ref)*(-0.239808661002) | |
23436 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23437 | self.failUnlessEqual(res.getShape(),(),"wrong shape of result.") | |
23438 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23439 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23440 | def test_maximum_array_rank1_expandedData_rank0(self): | |
23441 | arg0=numarray.array([-0.097106554962706371, -0.53299957388591124]) | |
23442 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23443 | arg1=msk_arg1*(-0.48432167856)+(1.-msk_arg1)*(-0.25985897402) | |
23444 | res=maximum(arg0,arg1) | |
23445 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23446 | ref=msk_ref*numarray.array([-0.097106554962706371, -0.48432167856004193])+(1.-msk_ref)*numarray.array([-0.097106554962706371, -0.25985897401999281]) | |
23447 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23448 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
23449 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23450 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23451 | def test_maximum_array_rank2_expandedData_rank0(self): | |
23452 | arg0=numarray.array([[-0.13167949633164855, -0.0083337422827065577, -0.38573640576223611, -0.069870464900080531, 0.77840356126391153], [0.62218334866236424, 0.68483355583508021, -0.48863487618037715, -0.0082838053084859364, -0.33346342674536089], [-0.89360989325312534, -0.9751359066636649, -0.0084300747210315219, -0.96657583767552402, -0.10309752389903437], [-0.22842150326198207, -0.49737293664485316, -0.47025074030093283, -0.67836806796837679, 0.99564770637844346]]) | |
23453 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23454 | arg1=msk_arg1*(0.0781036984237)+(1.-msk_arg1)*(-0.0843238721184) | |
23455 | res=maximum(arg0,arg1) | |
23456 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23457 | ref=msk_ref*numarray.array([[0.078103698423652057, 0.078103698423652057, 0.078103698423652057, 0.078103698423652057, 0.77840356126391153], [0.62218334866236424, 0.68483355583508021, 0.078103698423652057, 0.078103698423652057, 0.078103698423652057], [0.078103698423652057, 0.078103698423652057, 0.078103698423652057, 0.078103698423652057, 0.078103698423652057], [0.078103698423652057, 0.078103698423652057, 0.078103698423652057, 0.078103698423652057, 0.99564770637844346]])+(1.-msk_ref)*numarray.array([[-0.084323872118388099, -0.0083337422827065577, -0.084323872118388099, -0.069870464900080531, 0.77840356126391153], [0.62218334866236424, 0.68483355583508021, -0.084323872118388099, -0.0082838053084859364, -0.084323872118388099], [-0.084323872118388099, -0.084323872118388099, -0.0084300747210315219, -0.084323872118388099, -0.084323872118388099], [-0.084323872118388099, -0.084323872118388099, -0.084323872118388099, -0.084323872118388099, 0.99564770637844346]]) | |
23458 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23459 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
23460 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23461 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23462 | def test_maximum_array_rank3_expandedData_rank0(self): | |
23463 | arg0=numarray.array([[[-0.70161399966991178, 0.33853877023786727], [-0.76494633110216448, -0.93684954048568492]], [[-0.65137354058954, 0.26553439129603973], [0.64552443308190122, -0.60830143039855877]], [[0.8023162924896885, -0.32038038872912455], [-0.47547406933615965, 0.27454091657539204]], [[-0.9672523328014897, -0.71919678369683115], [-0.35423678746927645, 0.81975223582448642]], [[-0.81403739453676183, 0.0020767234774008436], [0.94253026200138423, 0.98275512168780477]], [[-0.24210704831235974, 0.71604514999739655], [-0.55274691970980117, 0.99831912241667875]]]) | |
23464 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23465 | arg1=msk_arg1*(0.0102246658782)+(1.-msk_arg1)*(0.652230128332) | |
23466 | res=maximum(arg0,arg1) | |
23467 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23468 | ref=msk_ref*numarray.array([[[0.010224665878218353, 0.33853877023786727], [0.010224665878218353, 0.010224665878218353]], [[0.010224665878218353, 0.26553439129603973], [0.64552443308190122, 0.010224665878218353]], [[0.8023162924896885, 0.010224665878218353], [0.010224665878218353, 0.27454091657539204]], [[0.010224665878218353, 0.010224665878218353], [0.010224665878218353, 0.81975223582448642]], [[0.010224665878218353, 0.010224665878218353], [0.94253026200138423, 0.98275512168780477]], [[0.010224665878218353, 0.71604514999739655], [0.010224665878218353, 0.99831912241667875]]])+(1.-msk_ref)*numarray.array([[[0.65223012833196758, 0.65223012833196758], [0.65223012833196758, 0.65223012833196758]], [[0.65223012833196758, 0.65223012833196758], [0.65223012833196758, 0.65223012833196758]], [[0.8023162924896885, 0.65223012833196758], [0.65223012833196758, 0.65223012833196758]], [[0.65223012833196758, 0.65223012833196758], [0.65223012833196758, 0.81975223582448642]], [[0.65223012833196758, 0.65223012833196758], [0.94253026200138423, 0.98275512168780477]], [[0.65223012833196758, 0.71604514999739655], [0.65223012833196758, 0.99831912241667875]]]) | |
23469 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23470 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
23471 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23472 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23473 | def test_maximum_array_rank4_expandedData_rank0(self): | |
23474 | arg0=numarray.array([[[[0.11857521935136139, 0.093929496673029522, -0.86185255457483856, 0.66859958438889944], [-0.71414593797980697, 0.11258374469683963, 0.94835492072493288, -0.68730039028716172], [-0.69653609424045704, 0.079954029214261757, -0.091180257555399713, -0.1442422632927951]], [[0.26155223948894291, -0.27259910943079357, 0.74661493838533688, 0.53585345987130495], [-0.60022580287227467, -0.48790336997422057, 0.94579083650142803, -0.8863996264681393], [-0.48285648955978755, 0.43421403658329649, 0.12057557891417603, -0.48016460023246776]]], [[[0.82622400614598757, 0.89451467594773959, -0.42386713423727307, 0.4292564116088935], [0.15325746129096651, -0.40650587605155497, 0.48852383833911195, -0.12133478623760663], [0.79062049417854996, -0.18313225818980827, -0.97553885725628553, -0.8652842476948277]], [[-0.05398981985994844, 0.25155972652674774, 0.58065613688539863, 0.49996739942398416], [-0.96741564092273324, 0.25704723590663892, 0.21718381354462557, -0.87988046847383972], [0.17224341707309865, 0.2585605917314151, -0.61262203743428256, 0.088679962718663852]]], [[[0.95856449568455826, -0.21525011988362075, -0.87880681141864181, 0.74102075636768272], [0.41959007487547573, 0.80453495515335471, 0.48817109722463581, -0.11806636970967643], [0.90075904019500075, 0.47717994916605289, 0.35995395169862054, 0.40418049684201307]], [[0.28919635447948355, -0.28199908853065292, -0.051524269447178916, 0.39147412124693748], [-0.21236681046692141, -0.35585295155544783, -0.4325141024321022, 0.50366801462727206], [-0.69662947289754285, -0.10168687807009102, -0.74795243165887348, -0.26529343675798978]]]]) | |
23475 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23476 | arg1=msk_arg1*(-0.933797791441)+(1.-msk_arg1)*(-0.798477769938) | |
23477 | res=maximum(arg0,arg1) | |
23478 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23479 | ref=msk_ref*numarray.array([[[[0.11857521935136139, 0.093929496673029522, -0.86185255457483856, 0.66859958438889944], [-0.71414593797980697, 0.11258374469683963, 0.94835492072493288, -0.68730039028716172], [-0.69653609424045704, 0.079954029214261757, -0.091180257555399713, -0.1442422632927951]], [[0.26155223948894291, -0.27259910943079357, 0.74661493838533688, 0.53585345987130495], [-0.60022580287227467, -0.48790336997422057, 0.94579083650142803, -0.8863996264681393], [-0.48285648955978755, 0.43421403658329649, 0.12057557891417603, -0.48016460023246776]]], [[[0.82622400614598757, 0.89451467594773959, -0.42386713423727307, 0.4292564116088935], [0.15325746129096651, -0.40650587605155497, 0.48852383833911195, -0.12133478623760663], [0.79062049417854996, -0.18313225818980827, -0.93379779144110442, -0.8652842476948277]], [[-0.05398981985994844, 0.25155972652674774, 0.58065613688539863, 0.49996739942398416], [-0.93379779144110442, 0.25704723590663892, 0.21718381354462557, -0.87988046847383972], [0.17224341707309865, 0.2585605917314151, -0.61262203743428256, 0.088679962718663852]]], [[[0.95856449568455826, -0.21525011988362075, -0.87880681141864181, 0.74102075636768272], [0.41959007487547573, 0.80453495515335471, 0.48817109722463581, -0.11806636970967643], [0.90075904019500075, 0.47717994916605289, 0.35995395169862054, 0.40418049684201307]], [[0.28919635447948355, -0.28199908853065292, -0.051524269447178916, 0.39147412124693748], [-0.21236681046692141, -0.35585295155544783, -0.4325141024321022, 0.50366801462727206], [-0.69662947289754285, -0.10168687807009102, -0.74795243165887348, -0.26529343675798978]]]])+(1.-msk_ref)*numarray.array([[[[0.11857521935136139, 0.093929496673029522, -0.79847776993817776, 0.66859958438889944], [-0.71414593797980697, 0.11258374469683963, 0.94835492072493288, -0.68730039028716172], [-0.69653609424045704, 0.079954029214261757, -0.091180257555399713, -0.1442422632927951]], [[0.26155223948894291, -0.27259910943079357, 0.74661493838533688, 0.53585345987130495], [-0.60022580287227467, -0.48790336997422057, 0.94579083650142803, -0.79847776993817776], [-0.48285648955978755, 0.43421403658329649, 0.12057557891417603, -0.48016460023246776]]], [[[0.82622400614598757, 0.89451467594773959, -0.42386713423727307, 0.4292564116088935], [0.15325746129096651, -0.40650587605155497, 0.48852383833911195, -0.12133478623760663], [0.79062049417854996, -0.18313225818980827, -0.79847776993817776, -0.79847776993817776]], [[-0.05398981985994844, 0.25155972652674774, 0.58065613688539863, 0.49996739942398416], [-0.79847776993817776, 0.25704723590663892, 0.21718381354462557, -0.79847776993817776], [0.17224341707309865, 0.2585605917314151, -0.61262203743428256, 0.088679962718663852]]], [[[0.95856449568455826, -0.21525011988362075, -0.79847776993817776, 0.74102075636768272], [0.41959007487547573, 0.80453495515335471, 0.48817109722463581, -0.11806636970967643], [0.90075904019500075, 0.47717994916605289, 0.35995395169862054, 0.40418049684201307]], [[0.28919635447948355, -0.28199908853065292, -0.051524269447178916, 0.39147412124693748], [-0.21236681046692141, -0.35585295155544783, -0.4325141024321022, 0.50366801462727206], [-0.69662947289754285, -0.10168687807009102, -0.74795243165887348, -0.26529343675798978]]]]) | |
23480 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23481 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
23482 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23483 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23484 | def test_maximum_array_rank0_array_rank1(self): | |
23485 | arg0=numarray.array(0.174025779864) | |
23486 | arg1=numarray.array([-0.80468496847716819, -0.55702002599440315]) | |
23487 | res=maximum(arg0,arg1) | |
23488 | ref=numarray.array([0.17402577986423351, 0.17402577986423351]) | |
23489 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23490 | self.failUnlessEqual(res.shape,(2,),"wrong shape of result.") | |
23491 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23492 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23493 | def test_maximum_array_rank1_array_rank1(self): | |
23494 | arg0=numarray.array([0.40031346790971001, 0.42660221126313203]) | |
23495 | arg1=numarray.array([-0.60356690978921446, 0.38041619399718063]) | |
23496 | res=maximum(arg0,arg1) | |
23497 | ref=numarray.array([0.40031346790971001, 0.42660221126313203]) | |
23498 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23499 | self.failUnlessEqual(res.shape,(2,),"wrong shape of result.") | |
23500 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23501 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23502 | def test_maximum_array_rank0_Symbol_rank1(self): | |
23503 | arg0=numarray.array(0.155960285467) | |
23504 | arg1=Symbol(shape=(2,)) | |
23505 | res=maximum(arg0,arg1) | |
23506 | s1=numarray.array([-0.35545113165367748, 0.93267615556383454]) | |
23507 | sub=res.substitute({arg1:s1}) | |
23508 | ref=numarray.array([0.15596028546704765, 0.93267615556383454]) | |
23509 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23510 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
23511 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23512 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23513 | def test_maximum_array_rank1_Symbol_rank1(self): | |
23514 | arg0=numarray.array([-0.35905112955801766, -0.57102630812379984]) | |
23515 | arg1=Symbol(shape=(2,)) | |
23516 | res=maximum(arg0,arg1) | |
23517 | s1=numarray.array([0.50192775602939554, -0.7375470058295488]) | |
23518 | sub=res.substitute({arg1:s1}) | |
23519 | ref=numarray.array([0.50192775602939554, -0.57102630812379984]) | |
23520 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23521 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
23522 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23523 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23524 | def test_maximum_array_rank0_constData_rank1(self): | |
23525 | arg0=numarray.array(-0.232441816441) | |
23526 | arg1=Data(numarray.array([0.7042628437324705, -0.052385211928024367]),self.functionspace) | |
23527 | res=maximum(arg0,arg1) | |
23528 | ref=Data(numarray.array([0.7042628437324705, -0.052385211928024367]),self.functionspace) | |
23529 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23530 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
23531 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23532 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23533 | def test_maximum_array_rank1_constData_rank1(self): | |
23534 | arg0=numarray.array([0.43161703003093366, -0.69479066934103839]) | |
23535 | arg1=Data(numarray.array([0.0397394354531031, 0.99784298068228838]),self.functionspace) | |
23536 | res=maximum(arg0,arg1) | |
23537 | ref=Data(numarray.array([0.43161703003093366, 0.99784298068228838]),self.functionspace) | |
23538 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23539 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
23540 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23541 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23542 | def test_maximum_array_rank0_expandedData_rank1(self): | |
23543 | arg0=numarray.array(0.531197916018) | |
23544 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23545 | arg1=msk_arg1*numarray.array([0.10695530878160886, -0.091570793259940553])+(1.-msk_arg1)*numarray.array([0.19175738089028238, -0.89275588159527008]) | |
23546 | res=maximum(arg0,arg1) | |
23547 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23548 | ref=msk_ref*numarray.array([0.53119791601751842, 0.53119791601751842])+(1.-msk_ref)*numarray.array([0.53119791601751842, 0.53119791601751842]) | |
23549 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23550 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
23551 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23552 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23553 | def test_maximum_array_rank1_expandedData_rank1(self): | |
23554 | arg0=numarray.array([0.16613419849800959, 0.79547150938095146]) | |
23555 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23556 | arg1=msk_arg1*numarray.array([-0.76819288363166582, 0.064091176986368348])+(1.-msk_arg1)*numarray.array([-0.37616391703349095, -0.52746213013335952]) | |
23557 | res=maximum(arg0,arg1) | |
23558 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23559 | ref=msk_ref*numarray.array([0.16613419849800959, 0.79547150938095146])+(1.-msk_ref)*numarray.array([0.16613419849800959, 0.79547150938095146]) | |
23560 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23561 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
23562 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23563 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23564 | def test_maximum_array_rank0_array_rank2(self): | |
23565 | arg0=numarray.array(0.386947484668) | |
23566 | arg1=numarray.array([[0.87213326940203939, -0.38189636586633791, -0.72473189333280996, -0.21432483890478471, 0.88028312911208029], [0.2064306399504563, 0.30698465546256481, -0.43583358859083776, -0.70245985617074291, -0.31221616245670569], [0.33731000862177352, -0.22831708789872907, -0.776015520692938, 0.90598610188778328, -0.45012002694087161], [-0.97538226851945575, 0.79531267578818832, -0.52616844351177017, 0.30697695091792299, -0.82183015670659132]]) | |
23567 | res=maximum(arg0,arg1) | |
23568 | ref=numarray.array([[0.87213326940203939, 0.38694748466821971, 0.38694748466821971, 0.38694748466821971, 0.88028312911208029], [0.38694748466821971, 0.38694748466821971, 0.38694748466821971, 0.38694748466821971, 0.38694748466821971], [0.38694748466821971, 0.38694748466821971, 0.38694748466821971, 0.90598610188778328, 0.38694748466821971], [0.38694748466821971, 0.79531267578818832, 0.38694748466821971, 0.38694748466821971, 0.38694748466821971]]) | |
23569 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23570 | self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.") | |
23571 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23572 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23573 | def test_maximum_array_rank2_array_rank2(self): | |
23574 | arg0=numarray.array([[-0.83417152417968299, 0.83688796349341943, -0.27671759181162559, -0.67424349443288167, -0.42278111327171874], [0.99320754959522506, -0.82405717801872003, -0.76061490742008808, 0.5386983552951472, -0.90805452020755628], [-0.54835914387487272, -0.87502977528875259, 0.6410277115607339, 0.33439192634626114, 0.053433089463401418], [0.32291094963350808, -0.30495569379510146, 0.5766949489189841, 0.12613166199354442, -0.36970324165010404]]) | |
23575 | arg1=numarray.array([[0.71480188355203733, -0.80922817795802859, -0.19167944208480336, -0.40332523244781227, 0.40664695590425337], [-0.24805869736740882, 0.76973514026691303, 0.080936864295739319, 0.95644003803365796, -0.62680571189350576], [0.094574552319768079, 0.45665785511001311, -0.40597207626956666, 0.74668608783219925, -0.24298652271704668], [0.51320676722505087, 0.46491077097585576, -0.12305996770430627, -0.35470356431074013, -0.8913618557905405]]) | |
23576 | res=maximum(arg0,arg1) | |
23577 | ref=numarray.array([[0.71480188355203733, 0.83688796349341943, -0.19167944208480336, -0.40332523244781227, 0.40664695590425337], [0.99320754959522506, 0.76973514026691303, 0.080936864295739319, 0.95644003803365796, -0.62680571189350576], [0.094574552319768079, 0.45665785511001311, 0.6410277115607339, 0.74668608783219925, 0.053433089463401418], [0.51320676722505087, 0.46491077097585576, 0.5766949489189841, 0.12613166199354442, -0.36970324165010404]]) | |
23578 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23579 | self.failUnlessEqual(res.shape,(4, 5),"wrong shape of result.") | |
23580 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23581 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23582 | def test_maximum_array_rank0_Symbol_rank2(self): | |
23583 | arg0=numarray.array(0.0585342737601) | |
23584 | arg1=Symbol(shape=(4, 5)) | |
23585 | res=maximum(arg0,arg1) | |
23586 | s1=numarray.array([[0.46739135447000035, 0.7066282271423745, 0.31262155030569505, -0.59369434923157582, -0.22660499405718504], [-0.61766192494996508, -0.081760657275070869, -0.067509612259605278, 0.4190048649427387, -0.15975389590294209], [0.21426556410700281, -0.97743004027967473, 0.65277672017493171, -0.98564432738868168, -0.72243447254043125], [-0.59624081374608928, 0.51147747479299821, 0.28289272027701529, 0.040753837045484076, -0.24614723134031191]]) | |
23587 | sub=res.substitute({arg1:s1}) | |
23588 | ref=numarray.array([[0.46739135447000035, 0.7066282271423745, 0.31262155030569505, 0.058534273760069366, 0.058534273760069366], [0.058534273760069366, 0.058534273760069366, 0.058534273760069366, 0.4190048649427387, 0.058534273760069366], [0.21426556410700281, 0.058534273760069366, 0.65277672017493171, 0.058534273760069366, 0.058534273760069366], [0.058534273760069366, 0.51147747479299821, 0.28289272027701529, 0.058534273760069366, 0.058534273760069366]]) | |
23589 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23590 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
23591 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23592 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23593 | def test_maximum_array_rank2_Symbol_rank2(self): | |
23594 | arg0=numarray.array([[-0.1509922763531284, 0.26819583692593696, 0.13792062666516114, -0.67009659571616176, -0.28911428012327733], [0.97882363829635577, -0.14326364233543631, 0.75490549457928258, -0.10719645951684331, 0.74154785113308952], [0.60803030467184938, -0.27344716605735986, 0.009358524325833617, 0.95425171168249556, 0.30063797723589625], [-0.18029419108797407, 0.98381786341325128, 0.42691021623467118, -0.31226513329620165, -0.15802173113347839]]) | |
23595 | arg1=Symbol(shape=(4, 5)) | |
23596 | res=maximum(arg0,arg1) | |
23597 | s1=numarray.array([[-0.73729156903222304, -0.35802223684371048, 0.36372497898024969, -0.39546935913517345, -0.70641158310236873], [-0.88099494570526349, 0.27267988330366366, 0.33437154258946, 0.11222753137279962, 0.51346492656917175], [-0.190230441087887, -0.37688552516163676, -0.98854058326426242, -0.20200240934513003, -0.51381327245111152], [0.80204114089677492, 0.61620728774239142, 0.045084039107120111, -0.23814078195863764, 0.88369890223672165]]) | |
23598 | sub=res.substitute({arg1:s1}) | |
23599 | ref=numarray.array([[-0.1509922763531284, 0.26819583692593696, 0.36372497898024969, -0.39546935913517345, -0.28911428012327733], [0.97882363829635577, 0.27267988330366366, 0.75490549457928258, 0.11222753137279962, 0.74154785113308952], [0.60803030467184938, -0.27344716605735986, 0.009358524325833617, 0.95425171168249556, 0.30063797723589625], [0.80204114089677492, 0.98381786341325128, 0.42691021623467118, -0.23814078195863764, 0.88369890223672165]]) | |
23600 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23601 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
23602 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23603 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23604 | def test_maximum_array_rank0_constData_rank2(self): | |
23605 | arg0=numarray.array(-0.304885788971) | |
23606 | arg1=Data(numarray.array([[-0.22172548151150773, -0.93904306211217503, 0.25957365759321482, 0.96193812818412838, -0.3025989293684388], [0.15322972106506172, -0.17624868576712505, -0.96966588216584459, -0.34755630024821937, -0.80746601605652324], [-0.29018139429836909, 0.43809370308475382, 0.11270049169675955, -0.082055163241442131, 0.54761620786381182], [0.48410554687630114, 0.36722666263652659, -0.013480413011818015, 0.05569938806142205, 0.87738343744750513]]),self.functionspace) | |
23607 | res=maximum(arg0,arg1) | |
23608 | ref=Data(numarray.array([[-0.22172548151150773, -0.30488578897068686, 0.25957365759321482, 0.96193812818412838, -0.3025989293684388], [0.15322972106506172, -0.17624868576712505, -0.30488578897068686, -0.30488578897068686, -0.30488578897068686], [-0.29018139429836909, 0.43809370308475382, 0.11270049169675955, -0.082055163241442131, 0.54761620786381182], [0.48410554687630114, 0.36722666263652659, -0.013480413011818015, 0.05569938806142205, 0.87738343744750513]]),self.functionspace) | |
23609 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23610 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
23611 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23612 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23613 | def test_maximum_array_rank2_constData_rank2(self): | |
23614 | arg0=numarray.array([[-0.076997964172731859, -0.67651472726038619, 0.79667022354874106, -0.84019816840575978, 0.94360680273325759], [0.47038093139447756, -0.59450503868551907, -0.023296743257425589, -0.34991504516580862, 0.10421432583738932], [0.66486132511251816, -0.83990036625902253, -0.4366608776718115, 0.13311527467714845, 0.3382164722060923], [0.52398650977835115, -0.70218769667138736, 0.062518838539082466, 0.40994775955849438, -0.058568911794933065]]) | |
23615 | arg1=Data(numarray.array([[0.40801392810258319, 0.55970232701195477, 0.53761617047533083, -0.97909149343422142, 0.98483751837359579], [0.17961521617799492, -0.22784069507161275, 0.1643289876635754, -0.37631266069934499, 0.11329288954069172], [0.14297194831055426, 0.17614343920854547, -0.22505241632107609, -0.40785463004531297, -0.3909325837682216], [-0.047415577352520666, 0.92663082365757532, 0.078178606632032466, 0.91281457271967104, 0.81139969205422791]]),self.functionspace) | |
23616 | res=maximum(arg0,arg1) | |
23617 | ref=Data(numarray.array([[0.40801392810258319, 0.55970232701195477, 0.79667022354874106, -0.84019816840575978, 0.98483751837359579], [0.47038093139447756, -0.22784069507161275, 0.1643289876635754, -0.34991504516580862, 0.11329288954069172], [0.66486132511251816, 0.17614343920854547, -0.22505241632107609, 0.13311527467714845, 0.3382164722060923], [0.52398650977835115, 0.92663082365757532, 0.078178606632032466, 0.91281457271967104, 0.81139969205422791]]),self.functionspace) | |
23618 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23619 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
23620 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23621 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23622 | def test_maximum_array_rank0_expandedData_rank2(self): | |
23623 | arg0=numarray.array(-0.8135239605) | |
23624 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23625 | arg1=msk_arg1*numarray.array([[0.61388846009494302, 0.28085229667463008, 0.96966170418990538, 0.4756731086027064, 0.089044479963028111], [-0.22360355015236388, 0.6233791983511312, 0.68326777995318166, 0.54220296868399953, -0.75022793841884283], [-0.35635379209712803, -0.23282610888785338, 0.96092420087535979, -0.42869505675150421, 0.65750802195711344], [-0.42871508206319087, -0.56475764881159818, -0.96280950832962331, 0.40149040331234409, -0.26763005910436588]])+(1.-msk_arg1)*numarray.array([[0.39944561956393798, -0.43585902666808818, -0.58310182711372915, 0.0015142487710770869, 0.46901395376714472], [-0.87900855153850288, 0.38639011731442729, -0.95185702388174454, 0.53002944784207284, -0.73959003057720962], [0.53242706460536771, -0.50214820452948183, -0.54088517606287101, -0.68854716037107155, 0.39914930452741304], [0.017706305731783445, -0.37994166987594036, -0.78515827077432565, 0.61126257987463384, 0.453222031968322]]) | |
23626 | res=maximum(arg0,arg1) | |
23627 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23628 | ref=msk_ref*numarray.array([[0.61388846009494302, 0.28085229667463008, 0.96966170418990538, 0.4756731086027064, 0.089044479963028111], [-0.22360355015236388, 0.6233791983511312, 0.68326777995318166, 0.54220296868399953, -0.75022793841884283], [-0.35635379209712803, -0.23282610888785338, 0.96092420087535979, -0.42869505675150421, 0.65750802195711344], [-0.42871508206319087, -0.56475764881159818, -0.81352396050002107, 0.40149040331234409, -0.26763005910436588]])+(1.-msk_ref)*numarray.array([[0.39944561956393798, -0.43585902666808818, -0.58310182711372915, 0.0015142487710770869, 0.46901395376714472], [-0.81352396050002107, 0.38639011731442729, -0.81352396050002107, 0.53002944784207284, -0.73959003057720962], [0.53242706460536771, -0.50214820452948183, -0.54088517606287101, -0.68854716037107155, 0.39914930452741304], [0.017706305731783445, -0.37994166987594036, -0.78515827077432565, 0.61126257987463384, 0.453222031968322]]) | |
23629 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23630 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
23631 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23632 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23633 | def test_maximum_array_rank2_expandedData_rank2(self): | |
23634 | arg0=numarray.array([[-0.78653766932808744, -0.079549862437257701, -0.97814835106959053, 0.040719482339229174, -0.97962562375604301], [-0.40079581080394244, -0.09401787400557815, 0.62166778688084201, -0.75199001510197849, 0.20816228185381469], [0.0095398820105889737, -0.68544916461350902, 0.60254682946002269, -0.5420118338827502, 0.088366583114217079], [-0.14450048156635842, 0.54026628193149651, -0.61281491161900647, 0.94473957477532911, 0.041380925722077633]]) | |
23635 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23636 | arg1=msk_arg1*numarray.array([[0.5466488143349244, -0.99031514955758526, -0.0376062612628143, -0.96730469425974897, 0.35607274289209556], [-0.8471312962686266, -0.54896276227621144, -0.63471248523310386, -0.24615168151838396, -0.25723265379342197], [0.049145120793863128, 0.41925950625254549, 0.053557161047377511, -0.3343699299117846, 0.084647011122490401], [0.14946012103736361, 0.80747938071502534, 0.91500285776142665, -0.39265567276306723, 0.92295370825448098]])+(1.-msk_arg1)*numarray.array([[0.54379962366779711, -0.78061481958224044, 0.050683010869727596, -0.93957509919839777, -0.83910628271728838], [0.85987841725590952, -0.55992543465972155, -0.49874145776952972, -0.054873430290065972, -0.44738464167107428], [-0.42793766792957233, 0.13909111370769045, 0.39594342406841165, 0.69552748643520901, -0.29658339184532245], [-0.053113369145769695, -0.88956129876827283, -0.56416742238479545, -0.71325747423089059, 0.21741601018126056]]) | |
23637 | res=maximum(arg0,arg1) | |
23638 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23639 | ref=msk_ref*numarray.array([[0.5466488143349244, -0.079549862437257701, -0.0376062612628143, 0.040719482339229174, 0.35607274289209556], [-0.40079581080394244, -0.09401787400557815, 0.62166778688084201, -0.24615168151838396, 0.20816228185381469], [0.049145120793863128, 0.41925950625254549, 0.60254682946002269, -0.3343699299117846, 0.088366583114217079], [0.14946012103736361, 0.80747938071502534, 0.91500285776142665, 0.94473957477532911, 0.92295370825448098]])+(1.-msk_ref)*numarray.array([[0.54379962366779711, -0.079549862437257701, 0.050683010869727596, 0.040719482339229174, -0.83910628271728838], [0.85987841725590952, -0.09401787400557815, 0.62166778688084201, -0.054873430290065972, 0.20816228185381469], [0.0095398820105889737, 0.13909111370769045, 0.60254682946002269, 0.69552748643520901, 0.088366583114217079], [-0.053113369145769695, 0.54026628193149651, -0.56416742238479545, 0.94473957477532911, 0.21741601018126056]]) | |
23640 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23641 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
23642 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23643 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23644 | def test_maximum_array_rank0_array_rank3(self): | |
23645 | arg0=numarray.array(0.206495354305) | |
23646 | arg1=numarray.array([[[-0.28919465172476477, 0.73115741235130649], [0.66849766546201494, 0.32380315894628775]], [[0.34229286100657319, 0.89978338241535871], [-0.94517862805279029, -0.76245816228020713]], [[-0.33058799974889852, 0.91202625598008713], [-0.056699425352694677, -0.96047331967606175]], [[-0.18669649213118422, 0.89626981818651652], [0.12998045639700662, 0.48782120229237735]], [[-0.15134137439915119, -0.88244397684457598], [-0.52188376295396921, -0.81844180102396336]], [[-0.94590032799150481, -0.89329016632804104], [0.96506970958692784, -0.7503920073950836]]]) | |
23647 | res=maximum(arg0,arg1) | |
23648 | ref=numarray.array([[[0.20649535430469368, 0.73115741235130649], [0.66849766546201494, 0.32380315894628775]], [[0.34229286100657319, 0.89978338241535871], [0.20649535430469368, 0.20649535430469368]], [[0.20649535430469368, 0.91202625598008713], [0.20649535430469368, 0.20649535430469368]], [[0.20649535430469368, 0.89626981818651652], [0.20649535430469368, 0.48782120229237735]], [[0.20649535430469368, 0.20649535430469368], [0.20649535430469368, 0.20649535430469368]], [[0.20649535430469368, 0.20649535430469368], [0.96506970958692784, 0.20649535430469368]]]) | |
23649 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23650 | self.failUnlessEqual(res.shape,(6, 2, 2),"wrong shape of result.") | |
23651 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23652 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23653 | def test_maximum_array_rank3_array_rank3(self): | |
23654 | arg0=numarray.array([[[0.39235233572087225, 0.74304758249838065], [-0.66779588135394619, 0.9432836579138042]], [[0.49351107181892084, -0.54694467231291211], [0.99103217822194889, -0.54216696018531252]], [[-0.8175841098544685, 0.8326990222625672], [0.055153398295502587, -0.069716551616386457]], [[0.77626178147117608, 0.11964332061737948], [0.63436115410214011, 0.45842546157944164]], [[0.74397226514682946, -0.77625932725898372], [0.31696360097990373, 0.0024321261945943196]], [[-0.65200916938862652, -0.66937271743063431], [0.32954705135201956, -0.16907363126350994]]]) | |
23655 | arg1=numarray.array([[[-0.50482866899770862, -0.44765629013986286], [0.06780136207618459, 0.15558669698070049]], [[0.044218703621608846, 0.2249976385020942], [0.65123878442216898, 0.65553773857321596]], [[-0.17880284508873401, -0.12255713511715682], [-0.10992299072827882, 0.7685617836322296]], [[0.91958169502841858, -0.44956276558073194], [0.31549165750027508, -0.68010957917212078]], [[-0.8629768256097865, 0.026136425252384576], [-0.71708710148747556, 0.30781358079440957]], [[0.41046623722164766, -0.91807050647819977], [-0.80193690343803214, 0.39991444698935408]]]) | |
23656 | res=maximum(arg0,arg1) | |
23657 | ref=numarray.array([[[0.39235233572087225, 0.74304758249838065], [0.06780136207618459, 0.9432836579138042]], [[0.49351107181892084, 0.2249976385020942], [0.99103217822194889, 0.65553773857321596]], [[-0.17880284508873401, 0.8326990222625672], [0.055153398295502587, 0.7685617836322296]], [[0.91958169502841858, 0.11964332061737948], [0.63436115410214011, 0.45842546157944164]], [[0.74397226514682946, 0.026136425252384576], [0.31696360097990373, 0.30781358079440957]], [[0.41046623722164766, -0.66937271743063431], [0.32954705135201956, 0.39991444698935408]]]) | |
23658 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23659 | self.failUnlessEqual(res.shape,(6, 2, 2),"wrong shape of result.") | |
23660 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23661 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23662 | def test_maximum_array_rank0_Symbol_rank3(self): | |
23663 | arg0=numarray.array(-0.92297263575) | |
23664 | arg1=Symbol(shape=(6, 2, 2)) | |
23665 | res=maximum(arg0,arg1) | |
23666 | s1=numarray.array([[[0.37981875931431985, 0.87418870552988737], [0.45599418940704872, 0.91361702634679132]], [[0.88456872676409093, -0.51571215906629497], [-0.26515873138117541, 0.66143648685780843]], [[0.39450335922230106, -0.14722144919672209], [-0.54686554596220049, -0.78276847696479535]], [[-0.13878174646835451, 0.76489703719466484], [0.98137039775706092, 0.39004505195020789]], [[0.12259883986323894, 0.9145662451303298], [-0.19448278087007798, 0.49513630872017766]], [[-0.24780434378271909, -0.82875987188858025], [-0.43502860805814314, 0.21309349424065305]]]) | |
23667 | sub=res.substitute({arg1:s1}) | |
23668 | ref=numarray.array([[[0.37981875931431985, 0.87418870552988737], [0.45599418940704872, 0.91361702634679132]], [[0.88456872676409093, -0.51571215906629497], [-0.26515873138117541, 0.66143648685780843]], [[0.39450335922230106, -0.14722144919672209], [-0.54686554596220049, -0.78276847696479535]], [[-0.13878174646835451, 0.76489703719466484], [0.98137039775706092, 0.39004505195020789]], [[0.12259883986323894, 0.9145662451303298], [-0.19448278087007798, 0.49513630872017766]], [[-0.24780434378271909, -0.82875987188858025], [-0.43502860805814314, 0.21309349424065305]]]) | |
23669 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23670 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
23671 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23672 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23673 | def test_maximum_array_rank3_Symbol_rank3(self): | |
23674 | arg0=numarray.array([[[-0.6262965201288857, 0.084710159751576253], [-0.22354890140408368, -0.80318255693534746]], [[0.39505725142314208, 0.49024342679096233], [0.55974790145294517, -0.74633559665886362]], [[-0.79650062177428005, 0.14870059234679833], [-0.030425746887044802, 0.23615912733952005]], [[0.17001647445926582, 0.60460902992298449], [-0.29018815935114928, -0.36854365139823853]], [[-0.47996868823366334, -0.64200015630345253], [-0.27516754680725675, 0.34441943493978289]], [[0.60021679908106473, -0.45014014271083025], [0.20744651679018311, 0.85343196302909785]]]) | |
23675 | arg1=Symbol(shape=(6, 2, 2)) | |
23676 | res=maximum(arg0,arg1) | |
23677 | s1=numarray.array([[[0.71779794274070441, -0.935435114645224], [0.099475933856508103, 0.74912698964974078]], [[-0.57148188291821378, 0.15972232967923117], [0.73333186260421135, -0.29643072117177716]], [[0.13824844479234577, -0.76005022768157326], [-0.81204372947270365, -0.40255252527070029]], [[-0.21006280244781217, -0.81074339822210306], [-0.84352401253734, 0.14503932771616901]], [[0.26035715420523409, -0.55753735229250756], [-0.64127181637220509, -0.78728049497639185]], [[0.54085431684653695, -0.079395370017745659], [-0.063435288341727958, 0.33333238514882124]]]) | |
23678 | sub=res.substitute({arg1:s1}) | |
23679 | ref=numarray.array([[[0.71779794274070441, 0.084710159751576253], [0.099475933856508103, 0.74912698964974078]], [[0.39505725142314208, 0.49024342679096233], [0.73333186260421135, -0.29643072117177716]], [[0.13824844479234577, 0.14870059234679833], [-0.030425746887044802, 0.23615912733952005]], [[0.17001647445926582, 0.60460902992298449], [-0.29018815935114928, 0.14503932771616901]], [[0.26035715420523409, -0.55753735229250756], [-0.27516754680725675, 0.34441943493978289]], [[0.60021679908106473, -0.079395370017745659], [0.20744651679018311, 0.85343196302909785]]]) | |
23680 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23681 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
23682 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23683 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23684 | def test_maximum_array_rank0_constData_rank3(self): | |
23685 | arg0=numarray.array(0.378728231479) | |
23686 | arg1=Data(numarray.array([[[-0.67114944879927396, -0.16379812287341133], [-0.9257424893497439, -0.39645982000198798]], [[0.9478088084230436, -0.18879856392144134], [-0.16336027795938834, -0.77606729529959839]], [[0.1844003363969049, 0.78778704269394706], [-0.28578747268227223, 0.64431707984038233]], [[0.68238252707515246, 0.06834327476896096], [0.55758618402198645, -0.27105782153341762]], [[0.83653411523399557, -0.36510045139192182], [-0.013797618027125758, 0.11305598817590523]], [[0.9030275523114546, 0.86927059946280005], [0.79084757115115578, -0.51570522549785514]]]),self.functionspace) | |
23687 | res=maximum(arg0,arg1) | |
23688 | ref=Data(numarray.array([[[0.37872823147870549, 0.37872823147870549], [0.37872823147870549, 0.37872823147870549]], [[0.9478088084230436, 0.37872823147870549], [0.37872823147870549, 0.37872823147870549]], [[0.37872823147870549, 0.78778704269394706], [0.37872823147870549, 0.64431707984038233]], [[0.68238252707515246, 0.37872823147870549], [0.55758618402198645, 0.37872823147870549]], [[0.83653411523399557, 0.37872823147870549], [0.37872823147870549, 0.37872823147870549]], [[0.9030275523114546, 0.86927059946280005], [0.79084757115115578, 0.37872823147870549]]]),self.functionspace) | |
23689 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23690 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
23691 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23692 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23693 | def test_maximum_array_rank3_constData_rank3(self): | |
23694 | arg0=numarray.array([[[0.18144247762408483, -0.78353539631767855], [0.4162761253699141, 0.86266675194423259]], [[0.012556149953617091, 0.4804386420113258], [-0.76805986046045316, 0.14356514697520395]], [[0.49194772346347282, -0.092267796433379345], [-0.26102733986309756, 0.41571439368388496]], [[0.10264134639034794, -0.080200667814620541], [-0.63587157924917848, 0.18913827649625636]], [[-0.36058395425965362, 0.77598983861399407], [-0.73989677505891915, -0.1411309114240975]], [[0.34868774774129974, 0.19384418036852469], [-0.637183036828326, -0.19633048544319909]]]) | |
23695 | arg1=Data(numarray.array([[[0.83338557285258363, 0.075765655696657497], [-0.034150038711153075, 0.48867409214454072]], [[-0.016093860376023894, 0.2815160832699517], [-0.61553678302662829, -0.14883913383260139]], [[-0.94569473686322292, 0.50994618929453117], [-0.42494790481694533, -0.1667068481277989]], [[0.19933276666126143, 0.57718400900736966], [-0.51588024821082401, -0.65798936279151676]], [[-0.90857839351892578, 0.80942308915069616], [-0.75446107420460651, 0.50588344731088331]], [[0.38538650065235491, 0.81707429971303891], [-0.97815096479177388, -0.71051070913370973]]]),self.functionspace) | |
23696 | res=maximum(arg0,arg1) | |
23697 | ref=Data(numarray.array([[[0.83338557285258363, 0.075765655696657497], [0.4162761253699141, 0.86266675194423259]], [[0.012556149953617091, 0.4804386420113258], [-0.61553678302662829, 0.14356514697520395]], [[0.49194772346347282, 0.50994618929453117], [-0.26102733986309756, 0.41571439368388496]], [[0.19933276666126143, 0.57718400900736966], [-0.51588024821082401, 0.18913827649625636]], [[-0.36058395425965362, 0.80942308915069616], [-0.73989677505891915, 0.50588344731088331]], [[0.38538650065235491, 0.81707429971303891], [-0.637183036828326, -0.19633048544319909]]]),self.functionspace) | |
23698 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23699 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
23700 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23701 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23702 | def test_maximum_array_rank0_expandedData_rank3(self): | |
23703 | arg0=numarray.array(-0.609061899567) | |
23704 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23705 | arg1=msk_arg1*numarray.array([[[-0.02221934064502995, -0.24823677577161973], [0.21094272664364166, -0.55842446834946635]], [[0.42482246714205973, 0.06867811566792148], [-0.09860813606919594, -0.38907891589509846]], [[0.040756602755701365, -0.56155860925355627], [-0.63505984155662887, 0.1755095121350585]], [[-0.66997146937465057, 0.29725734526569592], [-0.2396248349932053, -0.32831714430302616]], [[0.4825884611716833, 0.52633576472674903], [0.21070943365647499, 0.27856846579068084]], [[-0.0073100047866563322, -0.25318043364058052], [-0.34499905875957904, -0.1738541124162174]]])+(1.-msk_arg1)*numarray.array([[[-0.54275150799677596, 0.048651829704920102], [0.50592847793838391, -0.6263705525173533]], [[0.67364333189053371, 0.56674993507685767], [0.65430400632474917, 0.80805941287995409]], [[0.064865726857806116, 0.56140841973052491], [-0.22773339570038464, 0.11192902757904855]], [[0.39747464964694235, -0.071536903509030747], [0.0085715500683487544, -0.69734624746017571]], [[-0.39876917998500661, 0.63390636634158959], [-0.39861821315858226, -0.35254308646570043]], [[0.14082903951981685, -0.99563200824916698], [0.086951946864466167, 0.57962945075783878]]]) | |
23706 | res=maximum(arg0,arg1) | |
23707 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23708 | ref=msk_ref*numarray.array([[[-0.02221934064502995, -0.24823677577161973], [0.21094272664364166, -0.55842446834946635]], [[0.42482246714205973, 0.06867811566792148], [-0.09860813606919594, -0.38907891589509846]], [[0.040756602755701365, -0.56155860925355627], [-0.60906189956736645, 0.1755095121350585]], [[-0.60906189956736645, 0.29725734526569592], [-0.2396248349932053, -0.32831714430302616]], [[0.4825884611716833, 0.52633576472674903], [0.21070943365647499, 0.27856846579068084]], [[-0.0073100047866563322, -0.25318043364058052], [-0.34499905875957904, -0.1738541124162174]]])+(1.-msk_ref)*numarray.array([[[-0.54275150799677596, 0.048651829704920102], [0.50592847793838391, -0.60906189956736645]], [[0.67364333189053371, 0.56674993507685767], [0.65430400632474917, 0.80805941287995409]], [[0.064865726857806116, 0.56140841973052491], [-0.22773339570038464, 0.11192902757904855]], [[0.39747464964694235, -0.071536903509030747], [0.0085715500683487544, -0.60906189956736645]], [[-0.39876917998500661, 0.63390636634158959], [-0.39861821315858226, -0.35254308646570043]], [[0.14082903951981685, -0.60906189956736645], [0.086951946864466167, 0.57962945075783878]]]) | |
23709 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23710 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
23711 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23712 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23713 | def test_maximum_array_rank3_expandedData_rank3(self): | |
23714 | arg0=numarray.array([[[0.38841144894036916, 0.92715868690960357], [-0.77447087138717952, 0.36220771166763188]], [[-0.16230793101547336, 0.49331094494024885], [-0.46865610524207124, -0.034121204544792283]], [[0.60386974342368327, 0.2626947818589247], [0.93855252670546929, 0.3634155608194618]], [[0.57612389585726764, 0.92358799548671633], [-0.299282269070823, 0.63505715881940072]], [[-0.42338854353484456, -0.42092239793600861], [0.95171309029484008, 0.66415309416591728]], [[-0.54765368059109276, 0.23554498111650468], [0.76618949130819791, -0.3948153453377552]]]) | |
23715 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23716 | arg1=msk_arg1*numarray.array([[[0.9266725179072941, 0.53090206757564506], [-0.59713986747580439, 0.076267888409365936]], [[0.22324371017712408, 0.87148261272246397], [-0.67623763534981807, 0.52405697820419905]], [[-0.097525537051566191, 0.89706368891826105], [-0.3810691076053736, 0.013402757258889952]], [[0.5113244637433414, -0.55238850920540195], [-0.99749026942641228, 0.67337322595687987]], [[-0.7550449944751183, -0.80888632434803931], [0.5666662381666081, 0.79044507419751109]], [[0.54280750281353374, -0.52462690319031169], [-0.75601693543054327, -0.63628825071666228]]])+(1.-msk_arg1)*numarray.array([[[0.33073885193792507, 0.46494205056802484], [-0.0093783968795420058, -0.99272021120250731]], [[-0.50160691421559145, 0.7830226406524603], [0.7158546638991472, 0.10681849654155018]], [[-0.65696144464899331, 0.25217540916152914], [-0.93176795276651858, 0.2468866135972112]], [[0.63556079393859766, 0.91078215014392927], [0.11430987826908967, 0.4340935122722549]], [[0.50475199331880161, 0.74420618264664129], [-0.068579135846449146, 0.7950673667181396]], [[0.41364534013008858, -0.49894363315644497], [-0.46943702047349745, 0.72811686317254676]]]) | |
23717 | res=maximum(arg0,arg1) | |
23718 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23719 | ref=msk_ref*numarray.array([[[0.9266725179072941, 0.92715868690960357], [-0.59713986747580439, 0.36220771166763188]], [[0.22324371017712408, 0.87148261272246397], [-0.46865610524207124, 0.52405697820419905]], [[0.60386974342368327, 0.89706368891826105], [0.93855252670546929, 0.3634155608194618]], [[0.57612389585726764, 0.92358799548671633], [-0.299282269070823, 0.67337322595687987]], [[-0.42338854353484456, -0.42092239793600861], [0.95171309029484008, 0.79044507419751109]], [[0.54280750281353374, 0.23554498111650468], [0.76618949130819791, -0.3948153453377552]]])+(1.-msk_ref)*numarray.array([[[0.38841144894036916, 0.92715868690960357], [-0.0093783968795420058, 0.36220771166763188]], [[-0.16230793101547336, 0.7830226406524603], [0.7158546638991472, 0.10681849654155018]], [[0.60386974342368327, 0.2626947818589247], [0.93855252670546929, 0.3634155608194618]], [[0.63556079393859766, 0.92358799548671633], [0.11430987826908967, 0.63505715881940072]], [[0.50475199331880161, 0.74420618264664129], [0.95171309029484008, 0.7950673667181396]], [[0.41364534013008858, 0.23554498111650468], [0.76618949130819791, 0.72811686317254676]]]) | |
23720 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23721 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
23722 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23723 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23724 | def test_maximum_array_rank0_array_rank4(self): | |
23725 | arg0=numarray.array(0.129171289856) | |
23726 | arg1=numarray.array([[[[0.3673768442593579, 0.11571490160281228, -0.64517552668077371, 0.21138864531232571], [-0.17300389051526821, 0.38561202294913177, -0.7799425045145012, 0.91789518329451791], [0.44295986488382333, -0.56752817407673462, -0.67717388658505007, -0.13952018204273786]], [[-0.76623182406287338, 0.85573861149727271, -0.95164332684139752, 0.86720827147905721], [0.74534759751714708, 0.50799031619007984, -0.41362920053940533, -0.36619696053715045], [0.6430492090475719, 0.082871936976270044, -0.68180628674605592, -0.92951630862957102]]], [[[0.29463597351945991, -0.58173079797975968, -0.7230223183212805, 0.61668827498944934], [0.57368054758243181, 0.3467677103973561, -0.86059141654013738, -0.14937151897206813], [-0.75121283127075067, -0.69342076558479571, -0.29776459669994493, -0.29380111352128369]], [[-0.61904618645811826, 0.037206696855934807, -0.30720321824196484, -0.42828827933323077], [0.94459053163673512, 0.75017970241763399, -0.024543351104895805, 0.7317992761434462], [-0.68772557726122208, -0.26921105423467973, -0.33303964038314393, 0.88689290884788208]]], [[[0.19931943871727253, 0.50620323919947507, 0.026887179304865505, 0.9726645366564568], [0.39022216572404478, 0.20642036994395507, 0.58810510782489067, 0.022525598659116186], [0.29380513762421545, -0.51206092926883473, 0.23740794951394628, 0.83348785598584829]], [[0.82449928560496843, -0.88047679800160905, 0.0437070552148493, -0.33527652724059176], [-0.15159772508509795, -0.45358363740648411, -0.51667738655965545, 0.5776497411681254], [0.9659629370206908, -0.41135044415686139, -0.37504198978467462, -0.36072733216551578]]]]) | |
23727 | res=maximum(arg0,arg1) | |
23728 | ref=numarray.array([[[[0.3673768442593579, 0.1291712898560109, 0.1291712898560109, 0.21138864531232571], [0.1291712898560109, 0.38561202294913177, 0.1291712898560109, 0.91789518329451791], [0.44295986488382333, 0.1291712898560109, 0.1291712898560109, 0.1291712898560109]], [[0.1291712898560109, 0.85573861149727271, 0.1291712898560109, 0.86720827147905721], [0.74534759751714708, 0.50799031619007984, 0.1291712898560109, 0.1291712898560109], [0.6430492090475719, 0.1291712898560109, 0.1291712898560109, 0.1291712898560109]]], [[[0.29463597351945991, 0.1291712898560109, 0.1291712898560109, 0.61668827498944934], [0.57368054758243181, 0.3467677103973561, 0.1291712898560109, 0.1291712898560109], [0.1291712898560109, 0.1291712898560109, 0.1291712898560109, 0.1291712898560109]], [[0.1291712898560109, 0.1291712898560109, 0.1291712898560109, 0.1291712898560109], [0.94459053163673512, 0.75017970241763399, 0.1291712898560109, 0.7317992761434462], [0.1291712898560109, 0.1291712898560109, 0.1291712898560109, 0.88689290884788208]]], [[[0.19931943871727253, 0.50620323919947507, 0.1291712898560109, 0.9726645366564568], [0.39022216572404478, 0.20642036994395507, 0.58810510782489067, 0.1291712898560109], [0.29380513762421545, 0.1291712898560109, 0.23740794951394628, 0.83348785598584829]], [[0.82449928560496843, 0.1291712898560109, 0.1291712898560109, 0.1291712898560109], [0.1291712898560109, 0.1291712898560109, 0.1291712898560109, 0.5776497411681254], [0.9659629370206908, 0.1291712898560109, 0.1291712898560109, 0.1291712898560109]]]]) | |
23729 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23730 | self.failUnlessEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.") | |
23731 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23732 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23733 | def test_maximum_array_rank4_array_rank4(self): | |
23734 | arg0=numarray.array([[[[-0.65015954456679181, 0.40240408318498599, 0.84464712425699462, -0.43969720683132807], [0.060269909487150608, -0.74687444707146433, -0.6437215821030513, 0.50694044142420136], [-0.95651303413075461, 0.30077769940421639, -0.88469041671271231, 0.35428303244641701]], [[-0.64479714996431903, -0.02806358507098361, 0.17146951356917417, 0.17856182601303572], [0.82338647213827665, 0.62775989519430597, 0.98131295897678883, -0.27925295851008336], [-0.077888587859346714, 0.39299547141403646, -0.76703658182228662, 0.69803559132588267]]], [[[-0.60438450369130425, 0.50974341740755325, 0.2628982550897998, 0.62253269815816936], [0.098454268427629721, -0.11354020704871637, 0.97520314368136374, 0.82424110975204568], [0.15014068269747205, -0.42103180617954483, 0.90299092501087008, -0.23139020793721432]], [[0.76941820515528692, -0.1765839158818503, -0.5913087365745302, 0.7161045583038077], [0.85854815816198493, 0.024439202303835561, -0.75033601915149672, 0.47128628281539831], [-0.41886779770164062, -0.18310623967189343, -0.6230995563003221, 0.9482826576576675]]], [[[0.094084288889770606, -0.1009961699861317, -0.24821425388692853, -0.70296524988401554], [0.67010687729768903, 0.57353374648941413, 0.81190592473146639, 0.99708169066638397], [-0.37503932645378679, -0.24423377176761285, -0.18549806495578736, -0.47985036549736715]], [[0.62433786823811555, 0.22620666330362238, -0.18049352036474309, 0.99051652854626893], [-0.3286392033550134, 0.83921438988823871, 0.68465908457587843, 0.44769792179940149], [0.11216755461815131, 0.21844427393884125, -0.42328115351224671, -0.85880777265173469]]]]) | |
23735 | arg1=numarray.array([[[[-0.73093615882935814, -0.70919589053874077, 0.78870394532867283, -0.50159810974536545], [-0.85519344422155075, -0.56155628934300195, -0.62373278444802516, -0.9772447843857226], [0.87755710000772535, -0.013588596244209494, -0.90114581352274459, 0.55410820192830745]], [[-0.72956039379052307, -0.35348269136869503, -0.42184790113450843, -0.89870920570023705], [-0.14489448657028414, -0.91755892231285974, 0.89607768435234414, 0.4058334012935787], [-0.55720951018176401, 0.90451728855028346, -0.54876588909958501, 0.70078916216098674]]], [[[0.84626531438079744, 0.45264260263683553, 0.12965000086402689, -0.021003962192429393], [-0.27005492904656037, 0.55590537183241318, -0.24978960230861946, 0.92321598749374068], [0.016189016341156437, -0.35579544797087137, 0.62297910324803074, 0.10682842803458792]], [[-0.5264656932595686, 0.044463460549419409, -0.73796856857767978, 0.16294987868437039], [0.78510668328973954, 0.756487852598553, 0.44081375563129299, -0.60856363687850457], [0.60854054966272164, 0.83451336734693471, 0.71676784780975211, 0.7477674423454328]]], [[[0.94511009490633557, -0.45500546126530228, -0.27748406592529928, -0.11960260520462684], [0.83727559558880982, 0.6973251313608686, 0.43086624118575867, 0.0099152218565310424], [0.18361709779587665, 0.53065002315173349, 0.45664732903855709, 0.71620430423422099]], [[-0.60506520502917138, 0.69610912235182143, -0.10835353752278154, -0.63873781536516083], [-0.80308848611516837, 0.54896014232641921, 0.48999568478728261, 0.075051256341975181], [0.00034354126399538387, 0.14982509954067424, 0.33039570291905651, -0.95215296115442083]]]]) | |
23736 | res=maximum(arg0,arg1) | |
23737 | ref=numarray.array([[[[-0.65015954456679181, 0.40240408318498599, 0.84464712425699462, -0.43969720683132807], [0.060269909487150608, -0.56155628934300195, -0.62373278444802516, 0.50694044142420136], [0.87755710000772535, 0.30077769940421639, -0.88469041671271231, 0.55410820192830745]], [[-0.64479714996431903, -0.02806358507098361, 0.17146951356917417, 0.17856182601303572], [0.82338647213827665, 0.62775989519430597, 0.98131295897678883, 0.4058334012935787], [-0.077888587859346714, 0.90451728855028346, -0.54876588909958501, 0.70078916216098674]]], [[[0.84626531438079744, 0.50974341740755325, 0.2628982550897998, 0.62253269815816936], [0.098454268427629721, 0.55590537183241318, 0.97520314368136374, 0.92321598749374068], [0.15014068269747205, -0.35579544797087137, 0.90299092501087008, 0.10682842803458792]], [[0.76941820515528692, 0.044463460549419409, -0.5913087365745302, 0.7161045583038077], [0.85854815816198493, 0.756487852598553, 0.44081375563129299, 0.47128628281539831], [0.60854054966272164, 0.83451336734693471, 0.71676784780975211, 0.9482826576576675]]], [[[0.94511009490633557, -0.1009961699861317, -0.24821425388692853, -0.11960260520462684], [0.83727559558880982, 0.6973251313608686, 0.81190592473146639, 0.99708169066638397], [0.18361709779587665, 0.53065002315173349, 0.45664732903855709, 0.71620430423422099]], [[0.62433786823811555, 0.69610912235182143, -0.10835353752278154, 0.99051652854626893], [-0.3286392033550134, 0.83921438988823871, 0.68465908457587843, 0.44769792179940149], [0.11216755461815131, 0.21844427393884125, 0.33039570291905651, -0.85880777265173469]]]]) | |
23738 | self.failUnless(isinstance(res,numarray.NumArray),"wrong type of result.") | |
23739 | self.failUnlessEqual(res.shape,(3, 2, 3, 4),"wrong shape of result.") | |
23740 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23741 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23742 | def test_maximum_array_rank0_Symbol_rank4(self): | |
23743 | arg0=numarray.array(0.54447214019) | |
23744 | arg1=Symbol(shape=(3, 2, 3, 4)) | |
23745 | res=maximum(arg0,arg1) | |
23746 | s1=numarray.array([[[[0.82434914558439965, 0.030640814671103245, 0.10529857983193125, 0.19997385161819414], [0.28204526598017354, 0.99501508197753386, 0.067263102510887629, 0.945612931561016], [0.69177212052239145, 0.15433877465882562, -0.34415974069966504, 0.46076601729121092]], [[0.54514541152028295, -0.10818735160716719, -0.54790530814729199, -0.9614148723158118], [-0.056835322728886251, 0.31649018663403705, 0.99908563845353426, 0.17217399903284103], [0.89140208475766625, -0.31401352732944132, 0.93168762026073271, -0.54433006276087714]]], [[[0.19545745789279012, -0.53182407993275294, 0.90944127624204407, 0.8974512286069467], [0.44590078115621212, -0.52372172301239694, -0.066822932423527881, 0.0075688913505596034], [0.30168381753209683, 0.48339138025018724, -0.91094197954722289, -0.59987115584787709]], [[-0.73892869459997712, -0.99404245872149222, -0.9310583051851391, 0.73646990298896942], [0.50348458368583526, 0.77412103532204291, 0.55848954879843005, 0.19642606917414862], [0.31416604812741022, 0.50768353012385248, -0.94664565077452512, 0.32435400644970303]]], [[[-0.10775896169479915, -0.95686803118132291, 0.70433993252993576, -0.86326746229903017], [-0.37116743524580786, 0.0075152579945991782, 0.069692036911444655, -0.19749223358485568], [0.29171217123752013, 0.60639389298244173, -0.25174791429627064, 0.1591086976595617]], [[0.82370050143859186, 0.67318457269004317, -0.81977476642063407, -0.7307165497925121], [0.44164841381939346, -0.41778065946860976, 0.38428858791676279, 0.77095046504411346], [-0.52130145465959155, 0.38652434558975246, 0.28559952159740765, 0.4620838896553261]]]]) | |
23747 | sub=res.substitute({arg1:s1}) | |
23748 | ref=numarray.array([[[[0.82434914558439965, 0.54447214018957846, 0.54447214018957846, 0.54447214018957846], [0.54447214018957846, 0.99501508197753386, 0.54447214018957846, 0.945612931561016], [0.69177212052239145, 0.54447214018957846, 0.54447214018957846, 0.54447214018957846]], [[0.54514541152028295, 0.54447214018957846, 0.54447214018957846, 0.54447214018957846], [0.54447214018957846, 0.54447214018957846, 0.99908563845353426, 0.54447214018957846], [0.89140208475766625, 0.54447214018957846, 0.93168762026073271, 0.54447214018957846]]], [[[0.54447214018957846, 0.54447214018957846, 0.90944127624204407, 0.8974512286069467], [0.54447214018957846, 0.54447214018957846, 0.54447214018957846, 0.54447214018957846], [0.54447214018957846, 0.54447214018957846, 0.54447214018957846, 0.54447214018957846]], [[0.54447214018957846, 0.54447214018957846, 0.54447214018957846, 0.73646990298896942], [0.54447214018957846, 0.77412103532204291, 0.55848954879843005, 0.54447214018957846], [0.54447214018957846, 0.54447214018957846, 0.54447214018957846, 0.54447214018957846]]], [[[0.54447214018957846, 0.54447214018957846, 0.70433993252993576, 0.54447214018957846], [0.54447214018957846, 0.54447214018957846, 0.54447214018957846, 0.54447214018957846], [0.54447214018957846, 0.60639389298244173, 0.54447214018957846, 0.54447214018957846]], [[0.82370050143859186, 0.67318457269004317, 0.54447214018957846, 0.54447214018957846], [0.54447214018957846, 0.54447214018957846, 0.54447214018957846, 0.77095046504411346], [0.54447214018957846, 0.54447214018957846, 0.54447214018957846, 0.54447214018957846]]]]) | |
23749 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23750 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
23751 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23752 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23753 | def test_maximum_array_rank4_Symbol_rank4(self): | |
23754 | arg0=numarray.array([[[[0.64035870487061941, -0.071502156034890074, 0.45870287482741956, -0.37050440874833046], [-0.25988335765654447, 0.42680078606482352, 0.11013240636419197, 0.13087052469793647], [-0.019889178150541476, -0.96397155283346359, -0.61014343630122569, 0.032007237991111159]], [[0.99029771186264992, 0.97213367201750378, 0.4758484907511531, -0.30758916017087645], [0.61920561114160155, 0.86345720477493981, 0.66440150764961925, -0.3446741419116508], [-0.41033588537740329, -0.36197294663242685, -0.83167286317164035, -0.12831037833172076]]], [[[0.19321103307000631, -0.34078216585226873, -0.78018494418415418, -0.29386078732302345], [-0.94164102465058108, -0.55556717835803959, 0.70474848050281214, -0.85546730500664658], [0.49961250716000172, 0.39678413866284501, 0.3150787805006765, 0.4308616101237055]], [[-0.57410334666083562, -0.62098075243495732, 0.35823364227533561, 0.43179776522545676], [-0.42835765597066544, 0.9438519022815326, -0.45189115695439286, -0.29829155143567099], [-0.9484619949380082, 0.93241452697201388, -0.4240568609770472, -0.15030179732130433]]], [[[-0.62214862186501874, -0.68626527658860526, 0.11837555713462589, -0.19551356382919916], [0.22367080470737677, 0.3144438225586601, -0.50523069137572274, -0.20317349094986836], [-0.29132101551971257, -0.0032855336079842257, -0.9206423961878889, 0.087371025588225182]], [[0.027805277588636157, -0.95709292181658534, -0.29963215574140944, -0.71458122527541601], [-0.54145518988377073, -0.029575892074154897, 0.93044197101731196, -0.11299239967562968], [0.094956034364700903, -0.70084591841267097, 0.85538135162366635, 0.88053528151004379]]]]) | |
23755 | arg1=Symbol(shape=(3, 2, 3, 4)) | |
23756 | res=maximum(arg0,arg1) | |
23757 | s1=numarray.array([[[[-0.26499460294772725, -0.25033497699890184, -0.97794180326004843, 0.377782894352507], [-0.85312111596170914, 0.6214282013811272, 0.89042813437483637, -0.47941616068389603], [-0.97425914007939873, 0.11103349509582849, 0.59853630796819668, -0.39131474118836218]], [[0.056847101073182804, -0.46017994784642191, 0.43494531047768947, 0.24615807931660227], [0.39908204176313289, 0.59236726121677363, -0.95090913141892552, 0.78833390908185597], [-0.50283442975408699, 0.81580846892625392, -0.61270374695955399, -0.62086199820911081]]], [[[0.18334852778114441, -0.3156194021042471, -0.76053679663695251, 0.14076166793207134], [-0.87501708908233389, -0.49164179184739409, 0.41759477539979772, -0.89279047688005031], [0.1578084605040464, -0.95852467056073309, 0.88167691429914496, 0.51601635901436382]], [[0.78955671979990072, 0.55980673412144366, -0.56376415759135656, 0.80750397548168018], [0.70439950213393177, 0.064904356306807465, -0.0025500668059383891, -0.93595437662341308], [-0.33579280547583923, 0.40104292385269447, -0.34647377314828653, -0.96767513771211866]]], [[[-0.78651350012593446, -0.72482037204131844, -0.27521751207727507, -0.99276193805650581], [0.48906016011055509, 0.81955986561954131, 0.52972943880001622, -0.39091273626154854], [-0.23189015507530963, -0.50679562801150646, 0.094728033171694204, -0.38017661241090139]], [[0.91968871624205017, -0.41799877488931947, -0.26457053738513392, -0.6320096150200083], [-0.24663202057308098, 0.061559275049066331, 0.53259487508798808, 0.34940042387313253], [0.18826045967397231, -0.15112354728140209, 0.93900739726492488, 0.4294116709555269]]]]) | |
23758 | sub=res.substitute({arg1:s1}) | |
23759 | ref=numarray.array([[[[0.64035870487061941, -0.071502156034890074, 0.45870287482741956, 0.377782894352507], [-0.25988335765654447, 0.6214282013811272, 0.89042813437483637, 0.13087052469793647], [-0.019889178150541476, 0.11103349509582849, 0.59853630796819668, 0.032007237991111159]], [[0.99029771186264992, 0.97213367201750378, 0.4758484907511531, 0.24615807931660227], [0.61920561114160155, 0.86345720477493981, 0.66440150764961925, 0.78833390908185597], [-0.41033588537740329, 0.81580846892625392, -0.61270374695955399, -0.12831037833172076]]], [[[0.19321103307000631, -0.3156194021042471, -0.76053679663695251, 0.14076166793207134], [-0.87501708908233389, -0.49164179184739409, 0.70474848050281214, -0.85546730500664658], [0.49961250716000172, 0.39678413866284501, 0.88167691429914496, 0.51601635901436382]], [[0.78955671979990072, 0.55980673412144366, 0.35823364227533561, 0.80750397548168018], [0.70439950213393177, 0.9438519022815326, -0.0025500668059383891, -0.29829155143567099], [-0.33579280547583923, 0.93241452697201388, -0.34647377314828653, -0.15030179732130433]]], [[[-0.62214862186501874, -0.68626527658860526, 0.11837555713462589, -0.19551356382919916], [0.48906016011055509, 0.81955986561954131, 0.52972943880001622, -0.20317349094986836], [-0.23189015507530963, -0.0032855336079842257, 0.094728033171694204, 0.087371025588225182]], [[0.91968871624205017, -0.41799877488931947, -0.26457053738513392, -0.6320096150200083], [-0.24663202057308098, 0.061559275049066331, 0.93044197101731196, 0.34940042387313253], [0.18826045967397231, -0.15112354728140209, 0.93900739726492488, 0.88053528151004379]]]]) | |
23760 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23761 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
23762 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23763 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23764 | def test_maximum_array_rank0_constData_rank4(self): | |
23765 | arg0=numarray.array(-0.943242637062) | |
23766 | arg1=Data(numarray.array([[[[0.46673989197448695, 0.6549649376118345, 0.9984111355226466, -0.70351419152946271], [0.71307312699624026, 0.5419548297460679, -0.17409109440608583, -0.97014228996198115], [-0.54280492332372599, 0.86380903975785861, -0.34701233365455697, 0.48567075553942263]], [[0.54700266237459316, -0.35248705368749378, 0.23377808128753208, 0.96721598543765519], [0.88430869613619123, -0.1219865051849538, -0.058637092978300664, -0.61754559413262333], [0.74079280717308227, -0.78739161180686512, 0.85037530898787361, 0.16508890280036592]]], [[[0.44817727199203761, 0.8926307678886285, -0.76111914551638038, 0.14362232256439045], [-0.48467388532021149, -0.8094428609146751, 0.53535210524492927, -0.56637649678780466], [0.98969180896200037, -0.3271162647098742, 0.69094018879758989, -0.61586242247168044]], [[-0.36044332609306107, -0.98997760997627204, 0.90220389283531444, -0.60156374176429561], [0.40405941425843839, 0.4234467099813175, -0.95866754182894565, 0.8344078032898532], [-0.48131027576552698, -0.59963997992966767, -0.83658860482593256, -0.75913735933586257]]], [[[0.88365651759965269, 0.89012413369555121, -0.4898888357384561, 0.67718373616908689], [0.32819567260296134, -0.89006474342304842, -0.58497923437075872, -0.025361716234509002], [-0.27583713562824563, -0.1438801449075906, 0.75117793183554871, -0.44679974659724797]], [[0.71819263148139534, -0.73238371283246728, -0.92822578406489709, -0.13704547005331813], [0.13259671454727084, -0.45302324436441288, -0.28335401748666711, 0.32261970225996106], [0.90169925985201749, 0.89781229478225999, -0.54573322813790259, -0.22215533008165655]]]]),self.functionspace) | |
23767 | res=maximum(arg0,arg1) | |
23768 | ref=Data(numarray.array([[[[0.46673989197448695, 0.6549649376118345, 0.9984111355226466, -0.70351419152946271], [0.71307312699624026, 0.5419548297460679, -0.17409109440608583, -0.94324263706204037], [-0.54280492332372599, 0.86380903975785861, -0.34701233365455697, 0.48567075553942263]], [[0.54700266237459316, -0.35248705368749378, 0.23377808128753208, 0.96721598543765519], [0.88430869613619123, -0.1219865051849538, -0.058637092978300664, -0.61754559413262333], [0.74079280717308227, -0.78739161180686512, 0.85037530898787361, 0.16508890280036592]]], [[[0.44817727199203761, 0.8926307678886285, -0.76111914551638038, 0.14362232256439045], [-0.48467388532021149, -0.8094428609146751, 0.53535210524492927, -0.56637649678780466], [0.98969180896200037, -0.3271162647098742, 0.69094018879758989, -0.61586242247168044]], [[-0.36044332609306107, -0.94324263706204037, 0.90220389283531444, -0.60156374176429561], [0.40405941425843839, 0.4234467099813175, -0.94324263706204037, 0.8344078032898532], [-0.48131027576552698, -0.59963997992966767, -0.83658860482593256, -0.75913735933586257]]], [[[0.88365651759965269, 0.89012413369555121, -0.4898888357384561, 0.67718373616908689], [0.32819567260296134, -0.89006474342304842, -0.58497923437075872, -0.025361716234509002], [-0.27583713562824563, -0.1438801449075906, 0.75117793183554871, -0.44679974659724797]], [[0.71819263148139534, -0.73238371283246728, -0.92822578406489709, -0.13704547005331813], [0.13259671454727084, -0.45302324436441288, -0.28335401748666711, 0.32261970225996106], [0.90169925985201749, 0.89781229478225999, -0.54573322813790259, -0.22215533008165655]]]]),self.functionspace) | |
23769 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23770 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
23771 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23772 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23773 | def test_maximum_array_rank4_constData_rank4(self): | |
23774 | arg0=numarray.array([[[[0.6710452933322606, 0.73655023524342855, -0.96637183491308676, 0.47953689956820522], [0.98053583083570528, 0.1461687898181756, 0.012703818765450459, 0.48064837271561767], [0.52408663541340594, -0.6101131637614976, 0.71951147562469586, 0.97773169491505763]], [[0.85269224639001395, -0.64939328460945966, -0.40530815940692455, -0.043873643895695258], [0.013474207600136179, -0.83199072645059813, -0.24875392233750837, -0.14945963740023349], [-0.19859755265586743, -0.83519278737823521, -0.16490322565926241, 0.19988995509904828]]], [[[0.54261691324742345, -0.83216349466983819, -0.82229431953325571, -0.95593602291977064], [-0.038265980497722341, 0.38578299235089331, -0.43729585014806571, -0.94893987277299208], [-0.27213639583191407, 0.1045917845853499, 0.0051298010833620289, -0.87753324258171328]], [[0.47867910844244244, -0.7935953174942354, 0.48633491846960841, -0.16964491089477818], [-0.73725496052678019, -0.65544040345490262, 0.82473847295242608, -0.86310822408155241], [-0.22876295798043222, 0.087254884598592541, -0.66897239866347769, -0.88155102312679112]]], [[[0.80518718751035201, 0.9208930345840538, -0.84320779895756859, -0.22169550184009501], [0.34144334236516105, -0.65813010675475092, -0.67816684120052328, 0.03057411294794643], [0.83964290874070091, -0.65242174738552761, 0.65986798996685425, 0.55354844330886732]], [[0.41987573705519776, 0.86448705917430524, 0.89887374333241499, 0.50981938714297903], [-0.66180921979411456, 0.59715491866752002, -0.94380294634555173, 0.61085742396555731], [-0.061851722069981907, -0.82539430034923944, -0.05820899628782894, -0.12313347830576449]]]]) | |
23775 | arg1=Data(numarray.array([[[[0.74351019640477412, -0.98281371332345957, 0.047498607093644729, 0.15927637373867798], [-0.56718099478511252, -0.40521930963777275, -0.15323791375707096, -0.13397472408265321], [0.32026529445003682, 0.94984367824314786, -0.21650883898062334, 0.36878669403603381]], [[0.76460386081962728, 0.26035938179375706, -0.17228362074739612, -0.76176095860293325], [0.79650097864796598, -0.92064005521421444, 0.63695414023301522, 0.29763045353273676], [0.028233556083444356, 0.65356505734241077, 0.64710795344625938, 0.47088770373999034]]], [[[0.052592817909343559, 0.90142884270306523, -0.55744523632845322, -0.10133937858296571], [-0.38270754560875409, 0.84777761145662178, -0.19647228139194683, 0.2624309028567815], [-0.36151988444214433, 0.79453458152737544, 0.035112284546496175, 0.090453586873261216]], [[-0.042959217360417634, -0.40165574292355521, 0.87853656547492331, -0.74381165790643089], [-0.035497537775224242, -0.26990065440269873, 0.52801706764535417, 0.44592510638569061], [-0.46487843397425954, 0.88572704975088068, -0.70820902545471909, -0.83719918740365951]]], [[[-0.17444138264473819, 0.44713858293412612, 0.42308639570713846, 0.11624103502896643], [-0.53171945486995664, -0.43730113574911877, 0.023341839389971808, -0.9174119628732611], [-0.34478808240190162, -0.64263237508691695, 0.09480577060325146, -0.54979877472252747]], [[-0.83762097768252852, -0.28250723065451577, -0.70302270429800839, 0.20350206223682488], [-0.51785671081588647, -0.99895978214481795, -0.09100830119876635, -0.10432462166690804], [-0.2140802658780443, -0.32749288111075736, -0.34840221305540831, -0.33613300029766058]]]]),self.functionspace) | |
23776 | res=maximum(arg0,arg1) | |
23777 | ref=Data(numarray.array([[[[0.74351019640477412, 0.73655023524342855, 0.047498607093644729, 0.47953689956820522], [0.98053583083570528, 0.1461687898181756, 0.012703818765450459, 0.48064837271561767], [0.52408663541340594, 0.94984367824314786, 0.71951147562469586, 0.97773169491505763]], [[0.85269224639001395, 0.26035938179375706, -0.17228362074739612, -0.043873643895695258], [0.79650097864796598, -0.83199072645059813, 0.63695414023301522, 0.29763045353273676], [0.028233556083444356, 0.65356505734241077, 0.64710795344625938, 0.47088770373999034]]], [[[0.54261691324742345, 0.90142884270306523, -0.55744523632845322, -0.10133937858296571], [-0.038265980497722341, 0.84777761145662178, -0.19647228139194683, 0.2624309028567815], [-0.27213639583191407, 0.79453458152737544, 0.035112284546496175, 0.090453586873261216]], [[0.47867910844244244, -0.40165574292355521, 0.87853656547492331, -0.16964491089477818], [-0.035497537775224242, -0.26990065440269873, 0.82473847295242608, 0.44592510638569061], [-0.22876295798043222, 0.88572704975088068, -0.66897239866347769, -0.83719918740365951]]], [[[0.80518718751035201, 0.9208930345840538, 0.42308639570713846, 0.11624103502896643], [0.34144334236516105, -0.43730113574911877, 0.023341839389971808, 0.03057411294794643], [0.83964290874070091, -0.64263237508691695, 0.65986798996685425, 0.55354844330886732]], [[0.41987573705519776, 0.86448705917430524, 0.89887374333241499, 0.50981938714297903], [-0.51785671081588647, 0.59715491866752002, -0.09100830119876635, 0.61085742396555731], [-0.061851722069981907, -0.32749288111075736, -0.05820899628782894, -0.12313347830576449]]]]),self.functionspace) | |
23778 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23779 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
23780 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23781 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23782 | def test_maximum_array_rank0_expandedData_rank4(self): | |
23783 | arg0=numarray.array(0.816751245349) | |
23784 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23785 | arg1=msk_arg1*numarray.array([[[[0.40706796204856954, -0.53751083415836831, -0.45864908744463273, -0.16181548971941506], [0.24911417445318973, -0.90143034728419491, 0.49231704616202521, -0.02953522449634538], [-0.54604157728790303, 0.96956023052870233, -0.35875149576930676, -0.65119882270566221]], [[-0.63683028644751638, 0.517070292194729, 0.88993945395848617, 0.45862552604255513], [-0.3937255872490002, 0.62928624666236899, 0.15644492847277935, 0.39426821818667213], [0.18687916068352117, -0.90059464422537161, 0.63405011651666454, -0.91397232745661849]]], [[[-0.59152682775898779, -0.29881608198483178, -0.12022357576247278, -0.14636655539718824], [0.10683837535157203, 0.4534643980627564, 0.56557067866858457, -0.0058893033942237771], [0.2438289343318536, -0.44513011643495815, -0.82351570680276276, -0.74628626035713075]], [[0.24049586413674917, 0.93536796522792276, 0.40179585898884218, 0.11001812792063603], [0.24888872211708435, 0.13170738221634015, -0.23386082553392895, 0.26287786471668606], [-0.12817923648221208, -0.81433650068603169, -0.85580088180765967, 0.37425524564540913]]], [[[-0.0015262470861385768, -0.13657548471526271, -0.17763500899807361, -0.29008714552601167], [-0.29605361382858919, -0.30804118243930012, -0.69034132273448701, 0.17159914379615593], [-0.055083234234476253, 0.27179546429245183, 0.73841704903963601, 0.56943419450749744]], [[-0.13221678354751099, -0.25975064422559724, 0.98055444051148144, 0.041900636495320498], [-0.67581584371274128, -0.044493982042192126, 0.38493910887288241, -0.053928330783549638], [0.24767507371629205, 0.02740918244429702, -0.40707529813083276, -0.53224165365256848]]]])+(1.-msk_arg1)*numarray.array([[[[-0.74622638578077849, 0.075132461697541508, -0.33313454924071673, -0.67257843324720423], [-0.89086147690801054, -0.37521216146728076, -0.3769720211792944, -0.25074902554592482], [0.03327796652289905, -0.831487975870429, -0.46430521993783014, 0.35666688446285999]], [[-0.3002282511139418, -0.9131223259696819, -0.35725566311385237, -0.08122060507717177], [0.49125425698890024, 0.04278065414817589, -0.10736165776646334, -0.58357962728965052], [-0.78389654631628258, 0.014252969571323604, -0.58349722415645489, 0.48015407778285857]]], [[[0.8629968548019411, -0.39330356017360191, -0.43953900522134193, -0.93850862679670422], [-0.67563892257080771, -0.30985847916271125, -0.73029188466858708, 0.45768180905096179], [0.89312962196038459, 0.24375888513531274, 0.79974754704490114, 0.062990767856061503]], [[0.19388446284468785, 0.2228516825113267, 0.58972079924045051, 0.16046525287644209], [0.16738918455502771, -0.87793601312414005, 0.55708100133014371, 0.79422379620746852], [0.48900265257984232, 0.20469753181175121, -0.076793936351922776, -0.66050327071342485]]], [[[0.37333906028974995, -0.13276337459811982, 0.55257492514565332, -0.87250909004301769], [-0.92159637562262575, 0.035611817197426232, 0.49669980616950649, 0.81933503740201186], [-0.96340332935349826, 0.85175864132768342, -0.56016253718759845, 0.56499606586394324]], [[-0.33109596385421125, 0.97878513835337344, -0.16451086770378209, 0.10562009554922169], [0.64934854776565909, 0.39252253014845206, 0.086082586528108962, -0.87179727093305726], [-0.64734193154791497, -0.11793903610185485, -0.80594955530268586, -0.7145408832676321]]]]) | |
23786 | res=maximum(arg0,arg1) | |
23787 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23788 | ref=msk_ref*numarray.array([[[[0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.96956023052870233, 0.81675124534906574, 0.81675124534906574]], [[0.81675124534906574, 0.81675124534906574, 0.88993945395848617, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574]]], [[[0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574]], [[0.81675124534906574, 0.93536796522792276, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574]]], [[[0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574]], [[0.81675124534906574, 0.81675124534906574, 0.98055444051148144, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574]]]])+(1.-msk_ref)*numarray.array([[[[0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574]], [[0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574]]], [[[0.8629968548019411, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.89312962196038459, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574]], [[0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574]]], [[[0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81933503740201186], [0.81675124534906574, 0.85175864132768342, 0.81675124534906574, 0.81675124534906574]], [[0.81675124534906574, 0.97878513835337344, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574], [0.81675124534906574, 0.81675124534906574, 0.81675124534906574, 0.81675124534906574]]]]) | |
23789 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23790 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
23791 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23792 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23793 | def test_maximum_array_rank4_expandedData_rank4(self): | |
23794 | arg0=numarray.array([[[[0.42000806204653474, 0.43445211169835551, 0.67259254968505977, -0.44236725657295772], [0.57797003911910583, -0.56843078081208565, 0.73401747796917305, 0.2724166496453182], [-0.63816568661349526, 0.47652891249952689, 0.22262872392584887, 0.57248495666865962]], [[0.67126178307885032, 0.55524712080063265, -0.57633405842088048, -0.51172125052107154], [0.64644288887632562, -0.30158732813994793, 0.066495417813510427, 0.55087047201075623], [-0.70640833320964092, 0.79392204123529808, -0.30151094639813847, 0.63477282920213551]]], [[[-0.33887822678892188, -0.17257825839362329, -0.86588501606225043, 0.79230278052527692], [-0.39941731689877535, -0.079106652140733758, 0.34561234826387599, -0.3250977623978315], [-0.072143230372351264, -0.35332740106055804, 0.36569821506455535, -0.40358096819303957]], [[-0.46326111929557134, -0.65734587522945453, 0.36365229912540875, 0.29629501392799629], [0.76965355270422631, 0.86916618870287166, -0.30399370154030803, 0.052406314916716434], [-0.76844408403720332, -0.80603282987458247, 0.87923305663161355, -0.47575486213082696]]], [[[0.064241833879999932, 0.75416840871509683, -0.16640916907322456, 0.51810523833466604], [-0.52612642670199117, -0.54881438921402426, -0.60230840326054902, -0.27590086084382826], [0.56589884837057913, 0.63901913471463057, 0.14143396068435887, 0.4572178777562419]], [[-0.77613236188204149, -0.10681746398394076, 0.56066764451409656, -0.2652991439307546], [-0.47167240379595765, 0.13624117786721168, 0.90830564372286182, -0.50408842514981544], [-0.10789679373755079, 0.89455801147160074, 0.64339672677130522, -0.52438730821821777]]]]) | |
23795 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
23796 | arg1=msk_arg1*numarray.array([[[[0.58994058399593396, -0.84790900163215799, -0.2810393046159938, 0.95132339628179641], [-0.96691100251741302, -0.27351720946556934, -0.59482024886374374, 0.067410044082623743], [-0.47797733987261082, -0.15881452904936122, 0.048733333513018007, -0.2097978517034238]], [[-0.022424892496763604, 0.95039754974581636, -0.26755918731750183, 0.11642407168693469], [0.42843959365869888, 0.87961951831310414, 0.87592903677448142, -0.14801753665349993], [-0.44794994006371702, 0.90952976942348851, 0.86095504356940866, 0.40092005641620676]]], [[[-0.87293977911397436, -0.26515845603721533, 0.51886214635551764, -0.84860714710587803], [-0.96644396225751872, -0.7631489360116015, 0.32411191551565888, -0.61020033012558517], [0.62767467887627681, 0.37469207688125628, 0.97311127999171076, -0.48576153689962909]], [[0.80653641318766311, 0.7667470510008485, -0.1244805386140686, -0.58255916955809517], [-0.68905687561103779, 0.73624509848196351, 0.14977570034343146, 0.040371627889322026], [0.59631748792445949, -0.36976261889718165, -0.32387905826980279, -0.70956255815582425]]], [[[-0.47168955139676272, -0.62259149336107811, -0.71438890780775055, -0.70887906389104938], [-0.22646044424514478, 0.22578442905780038, 0.82289907678613572, 0.78508276520394693], [0.66158100390938746, 0.81084818404365477, 0.41404741540900059, 0.29086117891310748]], [[-0.48563213325230881, -0.66773681864261558, 0.13251259057679676, 0.38312110170916869], [0.4985513501920098, -0.054491390265769768, -0.034239376662770438, 0.15118777726900667], [0.637203043607808, -0.63220275381972035, -0.83486043539732502, -0.89196454166383954]]]])+(1.-msk_arg1)*numarray.array([[[[0.77783291145936362, 0.14573546502013346, 0.16427843684067489, 0.070174330346382652], [-0.75910085997762344, -0.13628190232977233, 0.050999095952770856, 0.11715267966221887], [0.24272200394062349, 0.5320807594862087, 0.56874924645624914, -0.97874608588909484]], [[-0.98167918496033835, -0.92884768363832904, 0.020720960458232351, 0.60484296418798422], [0.43656063194574424, 0.24417269636492955, 0.88220623197013071, 0.0051165565172857086], [0.59919244135295746, -0.24769803256244494, 0.46747145925858957, -0.32539081032403749]]], [[[0.36547407180069946, 0.69858798920753662, -0.11815619917568543, 0.7202806361724019], [0.89566175611285326, -0.56471605346156917, -0.96295426503805337, -0.79642127774673965], [0.0082356467622470841, 0.86729114253916273, -0.61543952427247706, 0.84048187872968816]], [[-0.70083513366236239, -0.63770108259677039, 0.8010185543717967, -0.171777821609852], [0.28780672248819994, 0.77948501197327458, 0.80566125829149815, -0.48883690350583775], [-0.31426640827493268, 0.010369391352117008, -0.17008192331534411, -0.24571331409278607]]], [[[-0.81997880316304705, -0.65143657046299919, 0.53349064661197132, 0.56466068808179881], [0.9458545705591126, -0.62032388429602836, -0.20671123052978779, -0.87582148391296899], [0.025494758959417885, -0.16261424915626144, -0.44378234236454994, -0.22992948225644549]], [[0.81002927637991107, -0.68316174531148488, -0.85225788243989031, -0.88222373281789257], [-0.26541667769836907, 0.17943188950419575, 0.63512022836563475, -0.38654668208377108], [-0.31161290145238318, 0.35849193061546902, -0.032927010158966707, 0.33048499755046112]]]]) | |
23797 | res=maximum(arg0,arg1) | |
23798 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
23799 | ref=msk_ref*numarray.array([[[[0.58994058399593396, 0.43445211169835551, 0.67259254968505977, 0.95132339628179641], [0.57797003911910583, -0.27351720946556934, 0.73401747796917305, 0.2724166496453182], [-0.47797733987261082, 0.47652891249952689, 0.22262872392584887, 0.57248495666865962]], [[0.67126178307885032, 0.95039754974581636, -0.26755918731750183, 0.11642407168693469], [0.64644288887632562, 0.87961951831310414, 0.87592903677448142, 0.55087047201075623], [-0.44794994006371702, 0.90952976942348851, 0.86095504356940866, 0.63477282920213551]]], [[[-0.33887822678892188, -0.17257825839362329, 0.51886214635551764, 0.79230278052527692], [-0.39941731689877535, -0.079106652140733758, 0.34561234826387599, -0.3250977623978315], [0.62767467887627681, 0.37469207688125628, 0.97311127999171076, -0.40358096819303957]], [[0.80653641318766311, 0.7667470510008485, 0.36365229912540875, 0.29629501392799629], [0.76965355270422631, 0.86916618870287166, 0.14977570034343146, 0.052406314916716434], [0.59631748792445949, -0.36976261889718165, 0.87923305663161355, -0.47575486213082696]]], [[[0.064241833879999932, 0.75416840871509683, -0.16640916907322456, 0.51810523833466604], [-0.22646044424514478, 0.22578442905780038, 0.82289907678613572, 0.78508276520394693], [0.66158100390938746, 0.81084818404365477, 0.41404741540900059, 0.4572178777562419]], [[-0.48563213325230881, -0.10681746398394076, 0.56066764451409656, 0.38312110170916869], [0.4985513501920098, 0.13624117786721168, 0.90830564372286182, 0.15118777726900667], [0.637203043607808, 0.89455801147160074, 0.64339672677130522, -0.52438730821821777]]]])+(1.-msk_ref)*numarray.array([[[[0.77783291145936362, 0.43445211169835551, 0.67259254968505977, 0.070174330346382652], [0.57797003911910583, -0.13628190232977233, 0.73401747796917305, 0.2724166496453182], [0.24272200394062349, 0.5320807594862087, 0.56874924645624914, 0.57248495666865962]], [[0.67126178307885032, 0.55524712080063265, 0.020720960458232351, 0.60484296418798422], [0.64644288887632562, 0.24417269636492955, 0.88220623197013071, 0.55087047201075623], [0.59919244135295746, 0.79392204123529808, 0.46747145925858957, 0.63477282920213551]]], [[[0.36547407180069946, 0.69858798920753662, -0.11815619917568543, 0.79230278052527692], [0.89566175611285326, -0.079106652140733758, 0.34561234826387599, -0.3250977623978315], [0.0082356467622470841, 0.86729114253916273, 0.36569821506455535, 0.84048187872968816]], [[-0.46326111929557134, -0.63770108259677039, 0.8010185543717967, 0.29629501392799629], [0.76965355270422631, 0.86916618870287166, 0.80566125829149815, 0.052406314916716434], [-0.31426640827493268, 0.010369391352117008, 0.87923305663161355, -0.24571331409278607]]], [[[0.064241833879999932, 0.75416840871509683, 0.53349064661197132, 0.56466068808179881], [0.9458545705591126, -0.54881438921402426, -0.20671123052978779, -0.27590086084382826], [0.56589884837057913, 0.63901913471463057, 0.14143396068435887, 0.4572178777562419]], [[0.81002927637991107, -0.10681746398394076, 0.56066764451409656, -0.2652991439307546], [-0.26541667769836907, 0.17943188950419575, 0.90830564372286182, -0.38654668208377108], [-0.10789679373755079, 0.89455801147160074, 0.64339672677130522, 0.33048499755046112]]]]) | |
23800 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
23801 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
23802 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23803 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23804 | def test_maximum_Symbol_rank0_float_rank0(self): | |
23805 | arg0=Symbol(shape=()) | |
23806 | arg1=-0.986368977956 | |
23807 | res=maximum(arg0,arg1) | |
23808 | s0=numarray.array(0.917004108653) | |
23809 | sub=res.substitute({arg0:s0}) | |
23810 | ref=numarray.array(0.917004108653) | |
23811 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23812 | self.failUnlessEqual(res.getShape(),(),"wrong shape of result.") | |
23813 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23814 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23815 | def test_maximum_Symbol_rank1_float_rank0(self): | |
23816 | arg0=Symbol(shape=(2,)) | |
23817 | arg1=-0.733232617521 | |
23818 | res=maximum(arg0,arg1) | |
23819 | s0=numarray.array([0.87446212840176729, 0.69478198612538922]) | |
23820 | sub=res.substitute({arg0:s0}) | |
23821 | ref=numarray.array([0.87446212840176729, 0.69478198612538922]) | |
23822 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23823 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
23824 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23825 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23826 | def test_maximum_Symbol_rank2_float_rank0(self): | |
23827 | arg0=Symbol(shape=(4, 5)) | |
23828 | arg1=-0.715390372158 | |
23829 | res=maximum(arg0,arg1) | |
23830 | s0=numarray.array([[-0.10015069311152347, 0.85284430951934476, 0.98329958956907282, -0.057180446613754876, 0.86510058046773275], [0.36612085517932846, 0.96635272020442597, 0.59676599731596291, 0.33037821056673078, -0.35211979770395763], [-0.98100658956077491, 0.60495692444451987, 0.36107017587527679, 0.31905076888015071, 0.45131852744342105], [-0.74221976662814293, -0.85110644691487414, -0.0040792398492872639, 0.73620257954628232, 0.89473385139096373]]) | |
23831 | sub=res.substitute({arg0:s0}) | |
23832 | ref=numarray.array([[-0.10015069311152347, 0.85284430951934476, 0.98329958956907282, -0.057180446613754876, 0.86510058046773275], [0.36612085517932846, 0.96635272020442597, 0.59676599731596291, 0.33037821056673078, -0.35211979770395763], [-0.7153903721580166, 0.60495692444451987, 0.36107017587527679, 0.31905076888015071, 0.45131852744342105], [-0.7153903721580166, -0.7153903721580166, -0.0040792398492872639, 0.73620257954628232, 0.89473385139096373]]) | |
23833 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23834 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
23835 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23836 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23837 | def test_maximum_Symbol_rank3_float_rank0(self): | |
23838 | arg0=Symbol(shape=(6, 2, 2)) | |
23839 | arg1=0.464479738044 | |
23840 | res=maximum(arg0,arg1) | |
23841 | s0=numarray.array([[[-0.34352756908292448, -0.61419356359664357], [0.55818002446357595, -0.41101495052891646]], [[-0.71040027802639782, -0.79504603230523996], [0.84186554823330906, 0.35508497777449599]], [[0.12920328146546312, 0.48205994463481305], [0.95050650098673106, -0.60135148204872468]], [[-0.24348281308306974, 0.15502314913856363], [0.90086027504291977, 0.0011363979118135248]], [[0.95363315495164236, 0.29965777748593347], [0.2258865378960544, -0.31912367702745836]], [[-0.1423878893499102, -0.47378802842834356], [0.35794091817558304, -0.93648558855847175]]]) | |
23842 | sub=res.substitute({arg0:s0}) | |
23843 | ref=numarray.array([[[0.46447973804433973, 0.46447973804433973], [0.55818002446357595, 0.46447973804433973]], [[0.46447973804433973, 0.46447973804433973], [0.84186554823330906, 0.46447973804433973]], [[0.46447973804433973, 0.48205994463481305], [0.95050650098673106, 0.46447973804433973]], [[0.46447973804433973, 0.46447973804433973], [0.90086027504291977, 0.46447973804433973]], [[0.95363315495164236, 0.46447973804433973], [0.46447973804433973, 0.46447973804433973]], [[0.46447973804433973, 0.46447973804433973], [0.46447973804433973, 0.46447973804433973]]]) | |
23844 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23845 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
23846 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23847 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23848 | def test_maximum_Symbol_rank4_float_rank0(self): | |
23849 | arg0=Symbol(shape=(3, 2, 3, 4)) | |
23850 | arg1=0.525903738176 | |
23851 | res=maximum(arg0,arg1) | |
23852 | s0=numarray.array([[[[-0.19413905424603439, -0.63211402778026704, -0.49515700544447894, 0.27448546961970721], [0.38731263557039686, -0.45343907707182973, -0.18214645673257346, -0.23732767691311385], [0.99512219129028923, -0.79777607202760792, 0.19220487981433476, -0.78001727629227902]], [[0.040519495158340524, -0.34994277502182891, 0.45876588991715472, -0.33472722430214419], [-0.0017501847545955407, -0.67420388550667321, -0.39012005172372444, 0.96894201309850536], [0.88533663122940176, 0.7986914414082944, -0.40614644801536093, -0.96743479586304049]]], [[[0.60304500131116279, -0.66390835366580991, -0.23231715169180922, 0.75538886986552178], [-0.0094026018153718915, 0.64931261088799186, 0.82063279052147098, 0.66489594615650294], [-0.84183938247666856, 0.49762152875269217, 0.40679985917689154, 0.70053001183294716]], [[-0.0026706860103133945, 0.68125393416767577, -0.060972348753023375, -0.17121284596011876], [-0.97102579948957457, -0.73341280946258269, 0.21586532083260379, 0.82959603585223607], [0.61418236787689295, 0.41382494352608634, 0.69207793756699831, 0.62734783925624482]]], [[[0.62619841232383466, 0.79487182067585027, -0.42952146697606031, -0.92051357815300228], [-0.13654386398794482, -0.79818293777846794, -0.15827501140611089, -0.3251204465947175], [-0.76519771176625651, 0.91147718606064942, -0.025186900606159579, -0.9823182325003359]], [[0.80412070090660581, 0.2907015695560633, 0.19223847083813861, -0.70391356146192674], [0.80842793582848249, -0.74762359050177674, 0.51159052487731516, 0.45054313478058727], [0.059839263836910517, 0.65930489994926966, -0.49457259416276877, -0.5650773006137626]]]]) | |
23853 | sub=res.substitute({arg0:s0}) | |
23854 | ref=numarray.array([[[[0.5259037381755729, 0.5259037381755729, 0.5259037381755729, 0.5259037381755729], [0.5259037381755729, 0.5259037381755729, 0.5259037381755729, 0.5259037381755729], [0.99512219129028923, 0.5259037381755729, 0.5259037381755729, 0.5259037381755729]], [[0.5259037381755729, 0.5259037381755729, 0.5259037381755729, 0.5259037381755729], [0.5259037381755729, 0.5259037381755729, 0.5259037381755729, 0.96894201309850536], [0.88533663122940176, 0.7986914414082944, 0.5259037381755729, 0.5259037381755729]]], [[[0.60304500131116279, 0.5259037381755729, 0.5259037381755729, 0.75538886986552178], [0.5259037381755729, 0.64931261088799186, 0.82063279052147098, 0.66489594615650294], [0.5259037381755729, 0.5259037381755729, 0.5259037381755729, 0.70053001183294716]], [[0.5259037381755729, 0.68125393416767577, 0.5259037381755729, 0.5259037381755729], [0.5259037381755729, 0.5259037381755729, 0.5259037381755729, 0.82959603585223607], [0.61418236787689295, 0.5259037381755729, 0.69207793756699831, 0.62734783925624482]]], [[[0.62619841232383466, 0.79487182067585027, 0.5259037381755729, 0.5259037381755729], [0.5259037381755729, 0.5259037381755729, 0.5259037381755729, 0.5259037381755729], [0.5259037381755729, 0.91147718606064942, 0.5259037381755729, 0.5259037381755729]], [[0.80412070090660581, 0.5259037381755729, 0.5259037381755729, 0.5259037381755729], [0.80842793582848249, 0.5259037381755729, 0.5259037381755729, 0.5259037381755729], [0.5259037381755729, 0.65930489994926966, 0.5259037381755729, 0.5259037381755729]]]]) | |
23855 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23856 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
23857 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23858 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23859 | def test_maximum_Symbol_rank0_array_rank0(self): | |
23860 | arg0=Symbol(shape=()) | |
23861 | arg1=numarray.array(0.163319519199) | |
23862 | res=maximum(arg0,arg1) | |
23863 | s0=numarray.array(-0.697029784546) | |
23864 | sub=res.substitute({arg0:s0}) | |
23865 | ref=numarray.array(0.163319519199) | |
23866 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23867 | self.failUnlessEqual(res.getShape(),(),"wrong shape of result.") | |
23868 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23869 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23870 | def test_maximum_Symbol_rank1_array_rank0(self): | |
23871 | arg0=Symbol(shape=(2,)) | |
23872 | arg1=numarray.array(-0.86461138312) | |
23873 | res=maximum(arg0,arg1) | |
23874 | s0=numarray.array([-0.53479441468903244, 0.47123278520533973]) | |
23875 | sub=res.substitute({arg0:s0}) | |
23876 | ref=numarray.array([-0.53479441468903244, 0.47123278520533973]) | |
23877 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23878 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
23879 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23880 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23881 | def test_maximum_Symbol_rank2_array_rank0(self): | |
23882 | arg0=Symbol(shape=(4, 5)) | |
23883 | arg1=numarray.array(0.240330748429) | |
23884 | res=maximum(arg0,arg1) | |
23885 | s0=numarray.array([[-0.21670951132207117, 0.89114065925724462, -0.39133530486105061, 0.20748149605074517, 0.37132800880875028], [0.56765962762910305, 0.25852724262971383, -0.66121631998813757, -0.19339893573669764, -0.21263300196532819], [0.29982161450753986, -0.5456649228670325, -0.20000772442829828, -0.35366191645422207, 0.24501905042773187], [0.62686496948551507, 0.58301282508729724, 0.79985475354344038, 0.45460470747630999, -0.74585968299614658]]) | |
23886 | sub=res.substitute({arg0:s0}) | |
23887 | ref=numarray.array([[0.24033074842899693, 0.89114065925724462, 0.24033074842899693, 0.24033074842899693, 0.37132800880875028], [0.56765962762910305, 0.25852724262971383, 0.24033074842899693, 0.24033074842899693, 0.24033074842899693], [0.29982161450753986, 0.24033074842899693, 0.24033074842899693, 0.24033074842899693, 0.24501905042773187], [0.62686496948551507, 0.58301282508729724, 0.79985475354344038, 0.45460470747630999, 0.24033074842899693]]) | |
23888 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23889 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
23890 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23891 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23892 | def test_maximum_Symbol_rank3_array_rank0(self): | |
23893 | arg0=Symbol(shape=(6, 2, 2)) | |
23894 | arg1=numarray.array(0.56406146621) | |
23895 | res=maximum(arg0,arg1) | |
23896 | s0=numarray.array([[[0.49814742907718523, -0.20616723253250879], [0.82062693577468382, -0.51987495842035991]], [[0.63825091040794346, -0.33593468894754364], [0.44682595942570003, 0.89941799493797059]], [[0.065960592588822253, -0.70075327485766215], [-0.84594644906740823, 0.37915175015845337]], [[0.63868567321922898, -0.091521295949379633], [0.74124018197041286, -0.091251444285183503]], [[-0.2899767943552749, -0.055025360307588755], [0.44164874750145877, -0.066547620706841171]], [[0.12381643413101662, 0.4275304450701769], [0.65430215999852193, 0.28775853527073747]]]) | |
23897 | sub=res.substitute({arg0:s0}) | |
23898 | ref=numarray.array([[[0.56406146620986464, 0.56406146620986464], [0.82062693577468382, 0.56406146620986464]], [[0.63825091040794346, 0.56406146620986464], [0.56406146620986464, 0.89941799493797059]], [[0.56406146620986464, 0.56406146620986464], [0.56406146620986464, 0.56406146620986464]], [[0.63868567321922898, 0.56406146620986464], [0.74124018197041286, 0.56406146620986464]], [[0.56406146620986464, 0.56406146620986464], [0.56406146620986464, 0.56406146620986464]], [[0.56406146620986464, 0.56406146620986464], [0.65430215999852193, 0.56406146620986464]]]) | |
23899 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23900 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
23901 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23902 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23903 | def test_maximum_Symbol_rank4_array_rank0(self): | |
23904 | arg0=Symbol(shape=(3, 2, 3, 4)) | |
23905 | arg1=numarray.array(0.673716042599) | |
23906 | res=maximum(arg0,arg1) | |
23907 | s0=numarray.array([[[[0.92949562732749014, -0.33140075106618982, 0.8985665951811781, -0.77226331140467064], [0.22491766113324552, -0.82681218517906196, -0.39172215610702232, -0.16945280895218762], [0.82698314182604671, 0.98800458415997139, 0.48988568562712276, -0.24033341707920042]], [[-0.02074971973435713, -0.11811769358488022, -0.8081922603841234, 0.32953222027856199], [-0.83049130376397318, -0.076408561621631677, 0.86693245712853018, -0.38322565960826349], [-0.032701908245091227, 0.62434902947474868, -0.060463862774358113, -0.64361528687111447]]], [[[-0.72551194906831262, 0.32465942294217975, 0.96239077669546935, -0.3456104005150169], [-0.46819956359124104, -0.47688844710322731, 0.89035263520153096, 0.78148602550024338], [-0.54543222431933969, 0.49021417276933832, 0.66596718223072982, 0.24528067336774595]], [[0.82092327555344258, 0.12743161192466768, 0.97326825560320862, -0.34622099300303621], [-0.67228818938196255, 0.11244263900157248, 0.63074510030823983, 0.82133349344215989], [0.72747984047396108, -0.96008949636498753, -0.79681207230425155, -0.40330209587465182]]], [[[-0.48709602324947143, -0.7114627374732363, 0.25170065712457768, 0.77403207514055605], [0.72420011044427635, -0.44241645089163328, 0.88433681795000818, 0.78639271163316571], [-0.26810851303708882, 0.0013293407225201115, -0.89746526810324556, 0.40676874902078697]], [[-0.80835495704757432, 0.10175786779323448, -0.73594607340809448, 0.28757716016927781], [-0.55203099995639793, -0.8205215711447027, 0.84793054423581538, 0.24924223828120451], [0.6689253639882462, -0.50963140356565306, -0.63980941456055795, -0.2704595002396919]]]]) | |
23908 | sub=res.substitute({arg0:s0}) | |
23909 | ref=numarray.array([[[[0.92949562732749014, 0.67371604259937956, 0.8985665951811781, 0.67371604259937956], [0.67371604259937956, 0.67371604259937956, 0.67371604259937956, 0.67371604259937956], [0.82698314182604671, 0.98800458415997139, 0.67371604259937956, 0.67371604259937956]], [[0.67371604259937956, 0.67371604259937956, 0.67371604259937956, 0.67371604259937956], [0.67371604259937956, 0.67371604259937956, 0.86693245712853018, 0.67371604259937956], [0.67371604259937956, 0.67371604259937956, 0.67371604259937956, 0.67371604259937956]]], [[[0.67371604259937956, 0.67371604259937956, 0.96239077669546935, 0.67371604259937956], [0.67371604259937956, 0.67371604259937956, 0.89035263520153096, 0.78148602550024338], [0.67371604259937956, 0.67371604259937956, 0.67371604259937956, 0.67371604259937956]], [[0.82092327555344258, 0.67371604259937956, 0.97326825560320862, 0.67371604259937956], [0.67371604259937956, 0.67371604259937956, 0.67371604259937956, 0.82133349344215989], [0.72747984047396108, 0.67371604259937956, 0.67371604259937956, 0.67371604259937956]]], [[[0.67371604259937956, 0.67371604259937956, 0.67371604259937956, 0.77403207514055605], [0.72420011044427635, 0.67371604259937956, 0.88433681795000818, 0.78639271163316571], [0.67371604259937956, 0.67371604259937956, 0.67371604259937956, 0.67371604259937956]], [[0.67371604259937956, 0.67371604259937956, 0.67371604259937956, 0.67371604259937956], [0.67371604259937956, 0.67371604259937956, 0.84793054423581538, 0.67371604259937956], [0.67371604259937956, 0.67371604259937956, 0.67371604259937956, 0.67371604259937956]]]]) | |
23910 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23911 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
23912 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23913 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23914 | def test_maximum_Symbol_rank0_Symbol_rank0(self): | |
23915 | arg0=Symbol(shape=()) | |
23916 | arg1=Symbol(shape=()) | |
23917 | res=maximum(arg0,arg1) | |
23918 | s0=numarray.array(-0.166533972653) | |
23919 | s1=numarray.array(0.430008514948) | |
23920 | sub=res.substitute({arg0:s0,arg1:s1}) | |
23921 | ref=numarray.array(0.430008514948) | |
23922 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23923 | self.failUnlessEqual(res.getShape(),(),"wrong shape of result.") | |
23924 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23925 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23926 | def test_maximum_Symbol_rank1_Symbol_rank0(self): | |
23927 | arg0=Symbol(shape=(2,)) | |
23928 | arg1=Symbol(shape=()) | |
23929 | res=maximum(arg0,arg1) | |
23930 | s0=numarray.array([0.98855944642845883, -0.70279545386154929]) | |
23931 | s1=numarray.array(0.942761064153) | |
23932 | sub=res.substitute({arg0:s0,arg1:s1}) | |
23933 | ref=numarray.array([0.98855944642845883, 0.94276106415295402]) | |
23934 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23935 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
23936 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23937 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23938 | def test_maximum_Symbol_rank2_Symbol_rank0(self): | |
23939 | arg0=Symbol(shape=(4, 5)) | |
23940 | arg1=Symbol(shape=()) | |
23941 | res=maximum(arg0,arg1) | |
23942 | s0=numarray.array([[-0.8614007685112417, 0.82263019293461137, 0.1418462044227855, -0.20151175696136558, 0.30135292864272079], [-0.70846188345403349, -0.60533041631925211, 0.5431601660745895, 0.21139751570935839, -0.85400113567282943], [0.63686560832390393, -0.55432791732840991, 0.13475895427448137, -0.85230870242177037, 0.59339288766225207], [-0.33276615446339153, -0.49046931392216409, 0.97047097632721102, 0.5672078146297328, 0.30436669385545345]]) | |
23943 | s1=numarray.array(0.106783144869) | |
23944 | sub=res.substitute({arg0:s0,arg1:s1}) | |
23945 | ref=numarray.array([[0.1067831448692691, 0.82263019293461137, 0.1418462044227855, 0.1067831448692691, 0.30135292864272079], [0.1067831448692691, 0.1067831448692691, 0.5431601660745895, 0.21139751570935839, 0.1067831448692691], [0.63686560832390393, 0.1067831448692691, 0.13475895427448137, 0.1067831448692691, 0.59339288766225207], [0.1067831448692691, 0.1067831448692691, 0.97047097632721102, 0.5672078146297328, 0.30436669385545345]]) | |
23946 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23947 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
23948 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23949 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23950 | def test_maximum_Symbol_rank3_Symbol_rank0(self): | |
23951 | arg0=Symbol(shape=(6, 2, 2)) | |
23952 | arg1=Symbol(shape=()) | |
23953 | res=maximum(arg0,arg1) | |
23954 | s0=numarray.array([[[-0.79909899934883488, -0.40692994409128036], [-0.39615105661504368, -0.53390408798903644]], [[-0.16374438970800043, -0.24567498448514513], [0.22094989589252667, 0.81075447536539635]], [[-0.027615249313295731, 0.61952626682581768], [-0.7828540120805505, -0.52011020027155008]], [[-0.24843780128293691, 0.43600182922082897], [-0.53047801506438774, -0.46750623083443843]], [[0.85652955278665899, -0.91405058017376195], [0.31288219688658359, -0.65437941972793512]], [[-0.65139376325689069, 0.62494317062335347], [-0.16151041548850098, 0.61180187276593223]]]) | |
23955 | s1=numarray.array(-0.423928135739) | |
23956 | sub=res.substitute({arg0:s0,arg1:s1}) | |
23957 | ref=numarray.array([[[-0.42392813573946131, -0.40692994409128036], [-0.39615105661504368, -0.42392813573946131]], [[-0.16374438970800043, -0.24567498448514513], [0.22094989589252667, 0.81075447536539635]], [[-0.027615249313295731, 0.61952626682581768], [-0.42392813573946131, -0.42392813573946131]], [[-0.24843780128293691, 0.43600182922082897], [-0.42392813573946131, -0.42392813573946131]], [[0.85652955278665899, -0.42392813573946131], [0.31288219688658359, -0.42392813573946131]], [[-0.42392813573946131, 0.62494317062335347], [-0.16151041548850098, 0.61180187276593223]]]) | |
23958 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23959 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
23960 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23961 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23962 | def test_maximum_Symbol_rank4_Symbol_rank0(self): | |
23963 | arg0=Symbol(shape=(3, 2, 3, 4)) | |
23964 | arg1=Symbol(shape=()) | |
23965 | res=maximum(arg0,arg1) | |
23966 | s0=numarray.array([[[[-0.3197610658358101, 0.09163128400803755, 0.84285416271000502, 0.8107182318956847], [-0.80234594024029171, 0.88981471872386875, 0.077137979027627868, 0.19190664421844761], [0.50690629441499446, 0.9721392850575814, 0.12774839226000223, 0.80806202926473958]], [[-0.20131529499656198, -0.83678241134985742, 0.9298155323060342, -0.93329898616677198], [0.54482984289836844, 0.071141501257063089, 0.61162501195689578, 0.71034656005263175], [-0.98097765053215502, 0.71752059792137901, 0.2085477530285158, 0.26205019049259848]]], [[[0.6168213512427394, 0.57594407295380168, 0.68704347550782052, 0.61691401043530614], [0.35213409335576284, 0.27472848818475315, -0.3687087676488221, -0.44614893287030677], [-0.87608963419014874, -0.014053908691249895, 0.57597178412796324, -0.26681554386471018]], [[0.15197681521073614, -0.87567767562025156, 0.13133830178541284, -0.9185946661028388], [0.428296691362821, 0.64886826324610847, -0.069826285233708152, 0.48355919520824586], [0.99989140373972729, 0.016264841745767367, -0.05030165567678524, -0.73853383570009656]]], [[[-0.057969768496793028, 0.88240125813848502, 0.97914735846770395, -0.89873980653677177], [0.8083904454657822, 0.0049221269856327687, 0.51901335144301863, 0.53003262470873147], [0.23853331008355982, -0.82285092330190102, 0.20465406057234414, -0.60712276206742044]], [[-0.80386246349242652, -0.88535276518185668, -0.61358743884420663, -0.18986074502330252], [-0.47083317022436844, 0.19064280065118289, -0.017269458122652681, -0.055598241359959388], [0.99387494359776829, -0.80889485214570378, -0.12065207499884267, -0.59817605022123899]]]]) | |
23967 | s1=numarray.array(0.203476883849) | |
23968 | sub=res.substitute({arg0:s0,arg1:s1}) | |
23969 | ref=numarray.array([[[[0.20347688384919493, 0.20347688384919493, 0.84285416271000502, 0.8107182318956847], [0.20347688384919493, 0.88981471872386875, 0.20347688384919493, 0.20347688384919493], [0.50690629441499446, 0.9721392850575814, 0.20347688384919493, 0.80806202926473958]], [[0.20347688384919493, 0.20347688384919493, 0.9298155323060342, 0.20347688384919493], [0.54482984289836844, 0.20347688384919493, 0.61162501195689578, 0.71034656005263175], [0.20347688384919493, 0.71752059792137901, 0.2085477530285158, 0.26205019049259848]]], [[[0.6168213512427394, 0.57594407295380168, 0.68704347550782052, 0.61691401043530614], [0.35213409335576284, 0.27472848818475315, 0.20347688384919493, 0.20347688384919493], [0.20347688384919493, 0.20347688384919493, 0.57597178412796324, 0.20347688384919493]], [[0.20347688384919493, 0.20347688384919493, 0.20347688384919493, 0.20347688384919493], [0.428296691362821, 0.64886826324610847, 0.20347688384919493, 0.48355919520824586], [0.99989140373972729, 0.20347688384919493, 0.20347688384919493, 0.20347688384919493]]], [[[0.20347688384919493, 0.88240125813848502, 0.97914735846770395, 0.20347688384919493], [0.8083904454657822, 0.20347688384919493, 0.51901335144301863, 0.53003262470873147], [0.23853331008355982, 0.20347688384919493, 0.20465406057234414, 0.20347688384919493]], [[0.20347688384919493, 0.20347688384919493, 0.20347688384919493, 0.20347688384919493], [0.20347688384919493, 0.20347688384919493, 0.20347688384919493, 0.20347688384919493], [0.99387494359776829, 0.20347688384919493, 0.20347688384919493, 0.20347688384919493]]]]) | |
23970 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23971 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
23972 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23973 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23974 | def test_maximum_Symbol_rank0_constData_rank0(self): | |
23975 | arg0=Symbol(shape=()) | |
23976 | arg1=Data(0.0788511607181,self.functionspace) | |
23977 | res=maximum(arg0,arg1) | |
23978 | s0=numarray.array(0.303633608874) | |
23979 | sub=res.substitute({arg0:s0}) | |
23980 | ref=Data(0.303633608874,self.functionspace) | |
23981 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23982 | self.failUnlessEqual(res.getShape(),(),"wrong shape of result.") | |
23983 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23984 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23985 | def test_maximum_Symbol_rank1_constData_rank0(self): | |
23986 | arg0=Symbol(shape=(2,)) | |
23987 | arg1=Data(-0.162806571951,self.functionspace) | |
23988 | res=maximum(arg0,arg1) | |
23989 | s0=numarray.array([0.48899532432066772, 0.98292801130723961]) | |
23990 | sub=res.substitute({arg0:s0}) | |
23991 | ref=Data(numarray.array([0.48899532432066772, 0.98292801130723961]),self.functionspace) | |
23992 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
23993 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
23994 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
23995 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
23996 | def test_maximum_Symbol_rank2_constData_rank0(self): | |
23997 | arg0=Symbol(shape=(4, 5)) | |
23998 | arg1=Data(-0.587017634534,self.functionspace) | |
23999 | res=maximum(arg0,arg1) | |
24000 | s0=numarray.array([[-0.96680749418452683, -0.9409372133034557, -0.7372427659579408, 0.58183265634894132, -0.47030168775580528], [0.95629410215028376, -0.43441571473057294, -0.24254920368993438, 0.016680928636627401, -0.92292483223332344], [-0.42555995336057428, 0.77948391551850871, -0.9687742377475006, -0.28777464721520696, -0.90969594156509759], [0.087728141355752021, -0.40374152482886361, 0.81089428261806384, 0.22370927269414698, 0.93473939721049248]]) | |
24001 | sub=res.substitute({arg0:s0}) | |
24002 | ref=Data(numarray.array([[-0.58701763453389844, -0.58701763453389844, -0.58701763453389844, 0.58183265634894132, -0.47030168775580528], [0.95629410215028376, -0.43441571473057294, -0.24254920368993438, 0.016680928636627401, -0.58701763453389844], [-0.42555995336057428, 0.77948391551850871, -0.58701763453389844, -0.28777464721520696, -0.58701763453389844], [0.087728141355752021, -0.40374152482886361, 0.81089428261806384, 0.22370927269414698, 0.93473939721049248]]),self.functionspace) | |
24003 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24004 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24005 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24006 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24007 | def test_maximum_Symbol_rank3_constData_rank0(self): | |
24008 | arg0=Symbol(shape=(6, 2, 2)) | |
24009 | arg1=Data(0.547481898119,self.functionspace) | |
24010 | res=maximum(arg0,arg1) | |
24011 | s0=numarray.array([[[0.95130050632782148, 0.059809648831347317], [-0.0042055570823034127, -0.01676446924521291]], [[-0.11956810738226498, 0.0040191935537194912], [-0.92067452177716436, -0.21619168762054319]], [[0.39748366071952357, 0.88176111652294176], [-0.38367950899579428, -0.53417355040157588]], [[0.30869825039087684, 0.78034270617056012], [-0.60852640470368158, 0.83832406492458933]], [[0.42530182038268727, -0.69673521783603443], [0.3202479389074957, 0.80561068799305002]], [[-0.56765351405396069, -0.68856733684006644], [-0.21245231302681078, -0.62249435800827047]]]) | |
24012 | sub=res.substitute({arg0:s0}) | |
24013 | ref=Data(numarray.array([[[0.95130050632782148, 0.54748189811873549], [0.54748189811873549, 0.54748189811873549]], [[0.54748189811873549, 0.54748189811873549], [0.54748189811873549, 0.54748189811873549]], [[0.54748189811873549, 0.88176111652294176], [0.54748189811873549, 0.54748189811873549]], [[0.54748189811873549, 0.78034270617056012], [0.54748189811873549, 0.83832406492458933]], [[0.54748189811873549, 0.54748189811873549], [0.54748189811873549, 0.80561068799305002]], [[0.54748189811873549, 0.54748189811873549], [0.54748189811873549, 0.54748189811873549]]]),self.functionspace) | |
24014 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24015 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24016 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24017 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24018 | def test_maximum_Symbol_rank4_constData_rank0(self): | |
24019 | arg0=Symbol(shape=(3, 2, 3, 4)) | |
24020 | arg1=Data(-0.518107061619,self.functionspace) | |
24021 | res=maximum(arg0,arg1) | |
24022 | s0=numarray.array([[[[0.31640786412133126, 0.64807746462822458, 0.073977040593609544, -0.16449622796920038], [-0.14690222245515772, -0.81301379067263757, -0.50432224582303009, -0.447562296962005], [-0.58599425890881518, 0.83080068562811737, -0.34042686204931627, -0.38686789778375408]], [[-0.21063890178960709, 0.76788516863594625, 0.62451258248714692, 0.32421120223336719], [0.001661874659981244, 0.86811936048353289, 0.34186278145656779, 0.8345881407727882], [0.3461223632547854, -0.30870389935021469, 0.69332650541969332, -0.20457936523355036]]], [[[-0.44008316860592944, 0.033272971528933715, -0.43037577665469273, -0.86290580509896109], [-0.16154802830657111, 0.20835433741116738, -0.38994782436231357, 0.078796771405668098], [0.71789054669369712, -0.45269067670741658, 0.06288990641906711, -0.09976863050329321]], [[-0.44845973597783084, 0.37672855875725775, -0.57888357458476558, 0.097784566934107531], [-0.62678286627981228, -0.053958966187036106, -0.45992917142127077, -0.65505084111324141], [-0.26841433130275139, -0.97725071573027411, 0.88433357499588494, -0.49330829768795237]]], [[[-0.47659572222145563, 0.04928606586223383, 0.46058577506833442, -0.18461027428713539], [-0.22513427689931298, -0.7662490489772833, 0.61821460314715604, 0.58597859687807463], [-0.093810622230459773, 0.4964372103067185, -0.8616945111843024, -0.57833522278885452]], [[0.73171927612181387, -0.65706298967009102, -0.08364118747949334, 0.32871476768255992], [0.22332591303785332, 0.26675993239669671, -0.86248306316787549, -0.27336126248224679], [0.43488279247381145, 0.62698861668571082, 0.36801312408896392, -0.5375278001288486]]]]) | |
24023 | sub=res.substitute({arg0:s0}) | |
24024 | ref=Data(numarray.array([[[[0.31640786412133126, 0.64807746462822458, 0.073977040593609544, -0.16449622796920038], [-0.14690222245515772, -0.5181070616193959, -0.50432224582303009, -0.447562296962005], [-0.5181070616193959, 0.83080068562811737, -0.34042686204931627, -0.38686789778375408]], [[-0.21063890178960709, 0.76788516863594625, 0.62451258248714692, 0.32421120223336719], [0.001661874659981244, 0.86811936048353289, 0.34186278145656779, 0.8345881407727882], [0.3461223632547854, -0.30870389935021469, 0.69332650541969332, -0.20457936523355036]]], [[[-0.44008316860592944, 0.033272971528933715, -0.43037577665469273, -0.5181070616193959], [-0.16154802830657111, 0.20835433741116738, -0.38994782436231357, 0.078796771405668098], [0.71789054669369712, -0.45269067670741658, 0.06288990641906711, -0.09976863050329321]], [[-0.44845973597783084, 0.37672855875725775, -0.5181070616193959, 0.097784566934107531], [-0.5181070616193959, -0.053958966187036106, -0.45992917142127077, -0.5181070616193959], [-0.26841433130275139, -0.5181070616193959, 0.88433357499588494, -0.49330829768795237]]], [[[-0.47659572222145563, 0.04928606586223383, 0.46058577506833442, -0.18461027428713539], [-0.22513427689931298, -0.5181070616193959, 0.61821460314715604, 0.58597859687807463], [-0.093810622230459773, 0.4964372103067185, -0.5181070616193959, -0.5181070616193959]], [[0.73171927612181387, -0.5181070616193959, -0.08364118747949334, 0.32871476768255992], [0.22332591303785332, 0.26675993239669671, -0.5181070616193959, -0.27336126248224679], [0.43488279247381145, 0.62698861668571082, 0.36801312408896392, -0.5181070616193959]]]]),self.functionspace) | |
24025 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24026 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24027 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24028 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24029 | def test_maximum_Symbol_rank0_expandedData_rank0(self): | |
24030 | arg0=Symbol(shape=()) | |
24031 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24032 | arg1=msk_arg1*(0.263837473061)+(1.-msk_arg1)*(0.930322128729) | |
24033 | res=maximum(arg0,arg1) | |
24034 | s0=numarray.array(-0.303145599651) | |
24035 | sub=res.substitute({arg0:s0}) | |
24036 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24037 | ref=msk_ref*(0.263837473061)+(1.-msk_ref)*(0.930322128729) | |
24038 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24039 | self.failUnlessEqual(res.getShape(),(),"wrong shape of result.") | |
24040 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24041 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24042 | def test_maximum_Symbol_rank1_expandedData_rank0(self): | |
24043 | arg0=Symbol(shape=(2,)) | |
24044 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24045 | arg1=msk_arg1*(-0.425613591683)+(1.-msk_arg1)*(-0.266798362013) | |
24046 | res=maximum(arg0,arg1) | |
24047 | s0=numarray.array([0.47786124208316028, -0.10829417858192092]) | |
24048 | sub=res.substitute({arg0:s0}) | |
24049 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24050 | ref=msk_ref*numarray.array([0.47786124208316028, -0.10829417858192092])+(1.-msk_ref)*numarray.array([0.47786124208316028, -0.10829417858192092]) | |
24051 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24052 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24053 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24054 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24055 | def test_maximum_Symbol_rank2_expandedData_rank0(self): | |
24056 | arg0=Symbol(shape=(4, 5)) | |
24057 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24058 | arg1=msk_arg1*(0.518705356576)+(1.-msk_arg1)*(-0.425545159263) | |
24059 | res=maximum(arg0,arg1) | |
24060 | s0=numarray.array([[-0.47737943188442711, -0.50968653776702588, 0.12636167117822783, -0.16112767485523127, 0.61610406596900447], [0.70009109684603388, -0.44585520454126804, -0.95142957301589393, -0.83937244717880199, 0.83185554435457876], [-0.76477480506013906, -0.76358302849696003, -0.053281801624190273, 0.34653779013304975, -0.18229907430717285], [0.34674273157998892, 0.67907571493663266, 0.21299680560501799, -0.95864483251904531, 0.28186482517984324]]) | |
24061 | sub=res.substitute({arg0:s0}) | |
24062 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24063 | ref=msk_ref*numarray.array([[0.51870535657631067, 0.51870535657631067, 0.51870535657631067, 0.51870535657631067, 0.61610406596900447], [0.70009109684603388, 0.51870535657631067, 0.51870535657631067, 0.51870535657631067, 0.83185554435457876], [0.51870535657631067, 0.51870535657631067, 0.51870535657631067, 0.51870535657631067, 0.51870535657631067], [0.51870535657631067, 0.67907571493663266, 0.51870535657631067, 0.51870535657631067, 0.51870535657631067]])+(1.-msk_ref)*numarray.array([[-0.42554515926296643, -0.42554515926296643, 0.12636167117822783, -0.16112767485523127, 0.61610406596900447], [0.70009109684603388, -0.42554515926296643, -0.42554515926296643, -0.42554515926296643, 0.83185554435457876], [-0.42554515926296643, -0.42554515926296643, -0.053281801624190273, 0.34653779013304975, -0.18229907430717285], [0.34674273157998892, 0.67907571493663266, 0.21299680560501799, -0.42554515926296643, 0.28186482517984324]]) | |
24064 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24065 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24066 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24067 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24068 | def test_maximum_Symbol_rank3_expandedData_rank0(self): | |
24069 | arg0=Symbol(shape=(6, 2, 2)) | |
24070 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24071 | arg1=msk_arg1*(0.39619680396)+(1.-msk_arg1)*(0.510543564256) | |
24072 | res=maximum(arg0,arg1) | |
24073 | s0=numarray.array([[[0.33767055987597305, 0.97379547968070068], [0.80363858071540073, -0.95544434119662514]], [[0.75988251135815954, 0.24822206064809538], [0.98535571000331257, -0.061494240171396708]], [[0.56181380018510829, -0.70038885545135732], [0.47418443531364218, -0.7876625924625742]], [[0.77648037076526299, -0.85430842741265489], [-0.21299099629151108, 0.28476909129171646]], [[-0.89901746460087351, 0.80244629190134864], [-0.16039892085645224, 0.93087599509386121]], [[-0.24628855952915596, -0.36747393045803411], [-0.22990306443178077, 0.7827660973976549]]]) | |
24074 | sub=res.substitute({arg0:s0}) | |
24075 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24076 | ref=msk_ref*numarray.array([[[0.39619680396043155, 0.97379547968070068], [0.80363858071540073, 0.39619680396043155]], [[0.75988251135815954, 0.39619680396043155], [0.98535571000331257, 0.39619680396043155]], [[0.56181380018510829, 0.39619680396043155], [0.47418443531364218, 0.39619680396043155]], [[0.77648037076526299, 0.39619680396043155], [0.39619680396043155, 0.39619680396043155]], [[0.39619680396043155, 0.80244629190134864], [0.39619680396043155, 0.93087599509386121]], [[0.39619680396043155, 0.39619680396043155], [0.39619680396043155, 0.7827660973976549]]])+(1.-msk_ref)*numarray.array([[[0.51054356425597924, 0.97379547968070068], [0.80363858071540073, 0.51054356425597924]], [[0.75988251135815954, 0.51054356425597924], [0.98535571000331257, 0.51054356425597924]], [[0.56181380018510829, 0.51054356425597924], [0.51054356425597924, 0.51054356425597924]], [[0.77648037076526299, 0.51054356425597924], [0.51054356425597924, 0.51054356425597924]], [[0.51054356425597924, 0.80244629190134864], [0.51054356425597924, 0.93087599509386121]], [[0.51054356425597924, 0.51054356425597924], [0.51054356425597924, 0.7827660973976549]]]) | |
24077 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24078 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24079 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24080 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24081 | def test_maximum_Symbol_rank4_expandedData_rank0(self): | |
24082 | arg0=Symbol(shape=(3, 2, 3, 4)) | |
24083 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24084 | arg1=msk_arg1*(-0.867270234622)+(1.-msk_arg1)*(-0.184167666491) | |
24085 | res=maximum(arg0,arg1) | |
24086 | s0=numarray.array([[[[0.34778842100985696, 0.91466700155307601, 0.068070179806759334, 0.93587871845739112], [0.81660802101282726, -0.42862634669531841, 0.77826901708032148, -0.2395592743697541], [-0.99838763228477978, 0.90813063765068813, -0.21282461462487134, -0.56866622590996285]], [[-0.040514202639923669, -0.41228222367310474, -0.56155526462486827, -0.23846092550202469], [0.54370233421879144, 0.72784420886026124, -0.56680235853516159, -0.61068924291751481], [0.51942107564774043, -0.47875859482064098, -0.44532210559704266, -0.26453473762702484]]], [[[-0.45070324266714201, 0.47986144706095812, 0.015567101765326496, -0.55300155278252672], [-0.77777158426443727, -0.46817038952409518, 0.76605853896643961, -0.21029519272087338], [-0.75962168514124606, 0.69650112782742934, -0.40248744545665582, -0.53388556223025385]], [[0.15426085249022914, 0.37998253169049767, -0.63812447110396842, -0.78124765440264299], [-0.77292230448860999, 0.80781768514724206, 0.21895647166908949, -0.7094480538535668], [0.42737300022198133, -0.29447469391631875, -0.011906740714938024, -0.44324636230959058]]], [[[-0.84345759673746823, -0.62303509242689792, 0.33791243754168754, 0.056143570948844479], [0.45860774951591199, 0.41744652076944933, 0.30025926758975374, -0.3265961269776636], [-0.75573723130545112, -0.32649476937035216, 0.64656306851701828, 0.61570588213194255]], [[0.61027123987319132, 0.76728309078514756, 0.38269652894555595, 0.076546543524037558], [0.44125754685327867, 0.3603904711844681, 0.83200264991754014, -0.49749830527479832], [-0.98594801190851578, -0.044658872549786732, -0.46810940529491707, -0.34099272448468709]]]]) | |
24087 | sub=res.substitute({arg0:s0}) | |
24088 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24089 | ref=msk_ref*numarray.array([[[[0.34778842100985696, 0.91466700155307601, 0.068070179806759334, 0.93587871845739112], [0.81660802101282726, -0.42862634669531841, 0.77826901708032148, -0.2395592743697541], [-0.86727023462218034, 0.90813063765068813, -0.21282461462487134, -0.56866622590996285]], [[-0.040514202639923669, -0.41228222367310474, -0.56155526462486827, -0.23846092550202469], [0.54370233421879144, 0.72784420886026124, -0.56680235853516159, -0.61068924291751481], [0.51942107564774043, -0.47875859482064098, -0.44532210559704266, -0.26453473762702484]]], [[[-0.45070324266714201, 0.47986144706095812, 0.015567101765326496, -0.55300155278252672], [-0.77777158426443727, -0.46817038952409518, 0.76605853896643961, -0.21029519272087338], [-0.75962168514124606, 0.69650112782742934, -0.40248744545665582, -0.53388556223025385]], [[0.15426085249022914, 0.37998253169049767, -0.63812447110396842, -0.78124765440264299], [-0.77292230448860999, 0.80781768514724206, 0.21895647166908949, -0.7094480538535668], [0.42737300022198133, -0.29447469391631875, -0.011906740714938024, -0.44324636230959058]]], [[[-0.84345759673746823, -0.62303509242689792, 0.33791243754168754, 0.056143570948844479], [0.45860774951591199, 0.41744652076944933, 0.30025926758975374, -0.3265961269776636], [-0.75573723130545112, -0.32649476937035216, 0.64656306851701828, 0.61570588213194255]], [[0.61027123987319132, 0.76728309078514756, 0.38269652894555595, 0.076546543524037558], [0.44125754685327867, 0.3603904711844681, 0.83200264991754014, -0.49749830527479832], [-0.86727023462218034, -0.044658872549786732, -0.46810940529491707, -0.34099272448468709]]]])+(1.-msk_ref)*numarray.array([[[[0.34778842100985696, 0.91466700155307601, 0.068070179806759334, 0.93587871845739112], [0.81660802101282726, -0.18416766649073457, 0.77826901708032148, -0.18416766649073457], [-0.18416766649073457, 0.90813063765068813, -0.18416766649073457, -0.18416766649073457]], [[-0.040514202639923669, -0.18416766649073457, -0.18416766649073457, -0.18416766649073457], [0.54370233421879144, 0.72784420886026124, -0.18416766649073457, -0.18416766649073457], [0.51942107564774043, -0.18416766649073457, -0.18416766649073457, -0.18416766649073457]]], [[[-0.18416766649073457, 0.47986144706095812, 0.015567101765326496, -0.18416766649073457], [-0.18416766649073457, -0.18416766649073457, 0.76605853896643961, -0.18416766649073457], [-0.18416766649073457, 0.69650112782742934, -0.18416766649073457, -0.18416766649073457]], [[0.15426085249022914, 0.37998253169049767, -0.18416766649073457, -0.18416766649073457], [-0.18416766649073457, 0.80781768514724206, 0.21895647166908949, -0.18416766649073457], [0.42737300022198133, -0.18416766649073457, -0.011906740714938024, -0.18416766649073457]]], [[[-0.18416766649073457, -0.18416766649073457, 0.33791243754168754, 0.056143570948844479], [0.45860774951591199, 0.41744652076944933, 0.30025926758975374, -0.18416766649073457], [-0.18416766649073457, -0.18416766649073457, 0.64656306851701828, 0.61570588213194255]], [[0.61027123987319132, 0.76728309078514756, 0.38269652894555595, 0.076546543524037558], [0.44125754685327867, 0.3603904711844681, 0.83200264991754014, -0.18416766649073457], [-0.18416766649073457, -0.044658872549786732, -0.18416766649073457, -0.18416766649073457]]]]) | |
24090 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24091 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24092 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24093 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24094 | def test_maximum_Symbol_rank0_array_rank1(self): | |
24095 | arg0=Symbol(shape=()) | |
24096 | arg1=numarray.array([0.94106241283176484, 0.60425808753586785]) | |
24097 | res=maximum(arg0,arg1) | |
24098 | s0=numarray.array(0.152421450799) | |
24099 | sub=res.substitute({arg0:s0}) | |
24100 | ref=numarray.array([0.94106241283176484, 0.60425808753586785]) | |
24101 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24102 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24103 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24104 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24105 | def test_maximum_Symbol_rank1_array_rank1(self): | |
24106 | arg0=Symbol(shape=(2,)) | |
24107 | arg1=numarray.array([0.034752439445001171, 0.68085408257859159]) | |
24108 | res=maximum(arg0,arg1) | |
24109 | s0=numarray.array([0.49509033009119663, -0.073919203029765068]) | |
24110 | sub=res.substitute({arg0:s0}) | |
24111 | ref=numarray.array([0.49509033009119663, 0.68085408257859159]) | |
24112 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24113 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24114 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24115 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24116 | def test_maximum_Symbol_rank0_Symbol_rank1(self): | |
24117 | arg0=Symbol(shape=()) | |
24118 | arg1=Symbol(shape=(2,)) | |
24119 | res=maximum(arg0,arg1) | |
24120 | s0=numarray.array(-0.832622816062) | |
24121 | s1=numarray.array([0.92124477972930863, -0.25183969524474414]) | |
24122 | sub=res.substitute({arg0:s0,arg1:s1}) | |
24123 | ref=numarray.array([0.92124477972930863, -0.25183969524474414]) | |
24124 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24125 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24126 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24127 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24128 | def test_maximum_Symbol_rank1_Symbol_rank1(self): | |
24129 | arg0=Symbol(shape=(2,)) | |
24130 | arg1=Symbol(shape=(2,)) | |
24131 | res=maximum(arg0,arg1) | |
24132 | s0=numarray.array([-0.83387519920792053, 0.83757127479595406]) | |
24133 | s1=numarray.array([0.023700736212592943, -0.74911518215668571]) | |
24134 | sub=res.substitute({arg0:s0,arg1:s1}) | |
24135 | ref=numarray.array([0.023700736212592943, 0.83757127479595406]) | |
24136 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24137 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24138 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24139 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24140 | def test_maximum_Symbol_rank0_constData_rank1(self): | |
24141 | arg0=Symbol(shape=()) | |
24142 | arg1=Data(numarray.array([-0.20444554583372709, -0.7579455353730431]),self.functionspace) | |
24143 | res=maximum(arg0,arg1) | |
24144 | s0=numarray.array(0.269364792866) | |
24145 | sub=res.substitute({arg0:s0}) | |
24146 | ref=Data(numarray.array([0.26936479286585557, 0.26936479286585557]),self.functionspace) | |
24147 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24148 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24149 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24150 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24151 | def test_maximum_Symbol_rank1_constData_rank1(self): | |
24152 | arg0=Symbol(shape=(2,)) | |
24153 | arg1=Data(numarray.array([0.79189883806353989, 0.51030782269672104]),self.functionspace) | |
24154 | res=maximum(arg0,arg1) | |
24155 | s0=numarray.array([-0.021449956598355024, -0.8928594273678232]) | |
24156 | sub=res.substitute({arg0:s0}) | |
24157 | ref=Data(numarray.array([0.79189883806353989, 0.51030782269672104]),self.functionspace) | |
24158 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24159 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24160 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24161 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24162 | def test_maximum_Symbol_rank0_expandedData_rank1(self): | |
24163 | arg0=Symbol(shape=()) | |
24164 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24165 | arg1=msk_arg1*numarray.array([-0.91354659520570336, -0.7100777244328127])+(1.-msk_arg1)*numarray.array([-0.31113350629580583, -0.21776645657501925]) | |
24166 | res=maximum(arg0,arg1) | |
24167 | s0=numarray.array(0.601790255505) | |
24168 | sub=res.substitute({arg0:s0}) | |
24169 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24170 | ref=msk_ref*numarray.array([0.60179025550480314, 0.60179025550480314])+(1.-msk_ref)*numarray.array([0.60179025550480314, 0.60179025550480314]) | |
24171 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24172 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24173 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24174 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24175 | def test_maximum_Symbol_rank1_expandedData_rank1(self): | |
24176 | arg0=Symbol(shape=(2,)) | |
24177 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24178 | arg1=msk_arg1*numarray.array([-0.64122684146842635, -0.65429758471804611])+(1.-msk_arg1)*numarray.array([0.36026003247482508, -0.4395755173829814]) | |
24179 | res=maximum(arg0,arg1) | |
24180 | s0=numarray.array([0.05956187348421671, -0.39958095268037686]) | |
24181 | sub=res.substitute({arg0:s0}) | |
24182 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24183 | ref=msk_ref*numarray.array([0.05956187348421671, -0.39958095268037686])+(1.-msk_ref)*numarray.array([0.36026003247482508, -0.39958095268037686]) | |
24184 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24185 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24186 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24187 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24188 | def test_maximum_Symbol_rank0_array_rank2(self): | |
24189 | arg0=Symbol(shape=()) | |
24190 | arg1=numarray.array([[-0.41909952453052179, -0.95594534974473211, 0.32059759793432763, 0.71268961072629944, 0.35710059122523963], [0.20954651130957025, -0.60789293663703381, 0.1052632207481321, 0.83984311406122658, 0.81600130912826918], [-0.39167915011286447, 0.7961363405839792, 0.14325859631932425, 0.37374712551337019, -0.55546564616509864], [-0.82503775909959853, -0.29694261438056713, 0.88448073236823621, -0.380823321238005, -0.41325694100420418]]) | |
24191 | res=maximum(arg0,arg1) | |
24192 | s0=numarray.array(0.917201419953) | |
24193 | sub=res.substitute({arg0:s0}) | |
24194 | ref=numarray.array([[0.91720141995312843, 0.91720141995312843, 0.91720141995312843, 0.91720141995312843, 0.91720141995312843], [0.91720141995312843, 0.91720141995312843, 0.91720141995312843, 0.91720141995312843, 0.91720141995312843], [0.91720141995312843, 0.91720141995312843, 0.91720141995312843, 0.91720141995312843, 0.91720141995312843], [0.91720141995312843, 0.91720141995312843, 0.91720141995312843, 0.91720141995312843, 0.91720141995312843]]) | |
24195 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24196 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24197 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24198 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24199 | def test_maximum_Symbol_rank2_array_rank2(self): | |
24200 | arg0=Symbol(shape=(4, 5)) | |
24201 | arg1=numarray.array([[0.23282724770560126, 0.90119165886227859, 0.44879639491772649, 0.57993715563417991, -0.88778077284719803], [-0.098116174000989709, -0.10763469613068244, 0.69142554364313624, 0.64695857344334162, -0.72343296045702021], [-0.8485413429579356, 0.84987016287292305, -0.037053313470545968, -0.34405217320242421, -0.7831835209615936], [0.18315904299735286, 0.55556339471233818, -0.47376736532833519, -0.15673803853155754, 0.2040480519251282]]) | |
24202 | res=maximum(arg0,arg1) | |
24203 | s0=numarray.array([[-0.42967559325550519, 0.52471287102439446, -0.34684138483439919, 0.12047981989667123, 0.99943797195006256], [-0.83323480509064907, -0.32689970732899321, -0.20379032320512036, -0.67755387056710625, 0.67081376442907836], [0.47977870378710996, 0.27896962622954047, -0.52228456748219876, -0.39216003886053974, -0.39253205916633815], [0.06699134295942466, 0.43533022627635409, 0.022220650734660952, 0.31703340867534924, 0.84760350942064333]]) | |
24204 | sub=res.substitute({arg0:s0}) | |
24205 | ref=numarray.array([[0.23282724770560126, 0.90119165886227859, 0.44879639491772649, 0.57993715563417991, 0.99943797195006256], [-0.098116174000989709, -0.10763469613068244, 0.69142554364313624, 0.64695857344334162, 0.67081376442907836], [0.47977870378710996, 0.84987016287292305, -0.037053313470545968, -0.34405217320242421, -0.39253205916633815], [0.18315904299735286, 0.55556339471233818, 0.022220650734660952, 0.31703340867534924, 0.84760350942064333]]) | |
24206 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24207 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24208 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24209 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24210 | def test_maximum_Symbol_rank0_Symbol_rank2(self): | |
24211 | arg0=Symbol(shape=()) | |
24212 | arg1=Symbol(shape=(4, 5)) | |
24213 | res=maximum(arg0,arg1) | |
24214 | s0=numarray.array(0.166413160055) | |
24215 | s1=numarray.array([[0.55674342923379383, 0.59655050003377652, 0.8882982024657744, 0.58965616025464751, -0.39088936745926395], [0.75550554261223879, 0.16831498582554461, 0.7266049241086534, -0.27919117369941548, 0.60860624879720882], [0.11784583838409257, 0.65525340611548244, 0.22026806564170842, -0.51459503082157032, 0.98423242893885243], [0.34720556407559289, 0.5684198515052532, -0.36943957417928441, -0.78117042570196826, -0.59786143208149101]]) | |
24216 | sub=res.substitute({arg0:s0,arg1:s1}) | |
24217 | ref=numarray.array([[0.55674342923379383, 0.59655050003377652, 0.8882982024657744, 0.58965616025464751, 0.16641316005544349], [0.75550554261223879, 0.16831498582554461, 0.7266049241086534, 0.16641316005544349, 0.60860624879720882], [0.16641316005544349, 0.65525340611548244, 0.22026806564170842, 0.16641316005544349, 0.98423242893885243], [0.34720556407559289, 0.5684198515052532, 0.16641316005544349, 0.16641316005544349, 0.16641316005544349]]) | |
24218 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24219 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24220 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24221 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24222 | def test_maximum_Symbol_rank2_Symbol_rank2(self): | |
24223 | arg0=Symbol(shape=(4, 5)) | |
24224 | arg1=Symbol(shape=(4, 5)) | |
24225 | res=maximum(arg0,arg1) | |
24226 | s0=numarray.array([[0.77311242286876292, 0.44908744692280189, 0.83226215240998358, 0.52087289713254514, 0.38641318195812535], [-0.98247040827721266, -0.12604666338806214, 0.8510608849491661, 0.95600963684451967, 0.86448510301290793], [-0.48121609014032507, -0.7704793822017717, 0.36678788811442398, 0.19832437648441004, -0.0214211514409548], [-0.14461403809964946, 0.94793132621096565, 0.046753157348639496, -0.039652758267353594, -0.92175826292896268]]) | |
24227 | s1=numarray.array([[-0.41521660807567051, -0.5504989614425273, -0.78358117611510147, 0.21750741385718664, -0.028037838778460555], [0.80571324980523062, -0.56610366108198229, 0.28300733959704338, -0.904023477840457, -0.34530644180596659], [-0.2927941485226444, -0.090832415033978542, -0.82095666495166841, -0.1793629803434289, -0.21667299855103739], [0.32528318239674658, -0.49986609951053218, -0.63688004623043692, -0.97178857833490007, -0.31844436113856789]]) | |
24228 | sub=res.substitute({arg0:s0,arg1:s1}) | |
24229 | ref=numarray.array([[0.77311242286876292, 0.44908744692280189, 0.83226215240998358, 0.52087289713254514, 0.38641318195812535], [0.80571324980523062, -0.12604666338806214, 0.8510608849491661, 0.95600963684451967, 0.86448510301290793], [-0.2927941485226444, -0.090832415033978542, 0.36678788811442398, 0.19832437648441004, -0.0214211514409548], [0.32528318239674658, 0.94793132621096565, 0.046753157348639496, -0.039652758267353594, -0.31844436113856789]]) | |
24230 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24231 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24232 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24233 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24234 | def test_maximum_Symbol_rank0_constData_rank2(self): | |
24235 | arg0=Symbol(shape=()) | |
24236 | arg1=Data(numarray.array([[0.55586423371079974, 0.1892755317946877, 0.10847290719935687, 0.98536651351785176, 0.40074483077480161], [0.40934295572734603, -0.40703498663658744, 0.90664485297735964, 0.37409425109294903, 0.41403477923560916], [0.43123719782172043, 0.58710861324703756, 0.22184998986325244, 0.46732912109877556, 0.14149017002364639], [0.67107738367105441, -0.73809081654075137, -0.60804272681684313, -0.73453608096490575, 0.9874358625015538]]),self.functionspace) | |
24237 | res=maximum(arg0,arg1) | |
24238 | s0=numarray.array(-0.895231842742) | |
24239 | sub=res.substitute({arg0:s0}) | |
24240 | ref=Data(numarray.array([[0.55586423371079974, 0.1892755317946877, 0.10847290719935687, 0.98536651351785176, 0.40074483077480161], [0.40934295572734603, -0.40703498663658744, 0.90664485297735964, 0.37409425109294903, 0.41403477923560916], [0.43123719782172043, 0.58710861324703756, 0.22184998986325244, 0.46732912109877556, 0.14149017002364639], [0.67107738367105441, -0.73809081654075137, -0.60804272681684313, -0.73453608096490575, 0.9874358625015538]]),self.functionspace) | |
24241 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24242 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24243 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24244 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24245 | def test_maximum_Symbol_rank2_constData_rank2(self): | |
24246 | arg0=Symbol(shape=(4, 5)) | |
24247 | arg1=Data(numarray.array([[0.031464589677843602, 0.58682052183527667, -0.67221652467702797, -0.042723615419881344, -0.63221538060837301], [0.55748833630801475, -0.29991035566219959, 0.50987850203607521, -0.17227085001296349, -0.68007885242359722], [0.29317654387431946, 0.367577769111332, 0.33176880345126025, -0.72946453502795294, -0.98044004636102478], [-0.32683797691786798, 0.56652584111113891, -0.762238360123771, -0.20438852688104192, -0.10592808532685627]]),self.functionspace) | |
24248 | res=maximum(arg0,arg1) | |
24249 | s0=numarray.array([[-0.60950508272291426, -0.35350322683055491, 0.87782416243741301, -0.42352075787518917, -0.67320203638906162], [0.51816370523211086, 0.48670585227008223, 0.26768383062899237, 0.36693593965153748, -0.83242225321794527], [-0.006013485370434335, 0.62991771260382556, -0.79253727549210473, 0.37699346345269658, 0.57768486943772257], [0.9905387052666379, -0.31991906871887998, -0.36838059810883017, -0.31734079380928337, -0.55468831864149837]]) | |
24250 | sub=res.substitute({arg0:s0}) | |
24251 | ref=Data(numarray.array([[0.031464589677843602, 0.58682052183527667, 0.87782416243741301, -0.042723615419881344, -0.63221538060837301], [0.55748833630801475, 0.48670585227008223, 0.50987850203607521, 0.36693593965153748, -0.68007885242359722], [0.29317654387431946, 0.62991771260382556, 0.33176880345126025, 0.37699346345269658, 0.57768486943772257], [0.9905387052666379, 0.56652584111113891, -0.36838059810883017, -0.20438852688104192, -0.10592808532685627]]),self.functionspace) | |
24252 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24253 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24254 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24255 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24256 | def test_maximum_Symbol_rank0_expandedData_rank2(self): | |
24257 | arg0=Symbol(shape=()) | |
24258 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24259 | arg1=msk_arg1*numarray.array([[-0.4730468237134855, 0.080340250188812856, -0.81944086875643052, -0.098506767681945329, -0.5573341492542454], [-0.38440681213357553, 0.66568155755094494, -0.20620312454733902, 0.4569874848883233, 0.27044384864375748], [0.195540058404158, 0.34992187735181113, -0.20614423012646177, 0.09618657792128249, 0.66488703933604465], [0.7488248847520742, -0.12876223863389424, 0.62579378936737884, -0.96553767048637229, -0.73795071074858631]])+(1.-msk_arg1)*numarray.array([[0.57705445283252299, 0.95295912172459696, 0.14619043902616791, -0.80194733305638466, 0.78601648029803872], [-0.55324334911725881, 0.98107261205070739, -0.076270358399511906, 0.80642066967491277, -0.58671774610547422], [0.75602281001495553, -0.32236020811670429, 0.33247541870744768, 0.084067013568079219, -0.82826004746466086], [-0.79530514339776381, 0.97888215332810669, 0.44689990983720462, 0.21364765887818349, -0.82902352473958607]]) | |
24260 | res=maximum(arg0,arg1) | |
24261 | s0=numarray.array(-0.489204435704) | |
24262 | sub=res.substitute({arg0:s0}) | |
24263 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24264 | ref=msk_ref*numarray.array([[-0.4730468237134855, 0.080340250188812856, -0.48920443570417427, -0.098506767681945329, -0.48920443570417427], [-0.38440681213357553, 0.66568155755094494, -0.20620312454733902, 0.4569874848883233, 0.27044384864375748], [0.195540058404158, 0.34992187735181113, -0.20614423012646177, 0.09618657792128249, 0.66488703933604465], [0.7488248847520742, -0.12876223863389424, 0.62579378936737884, -0.48920443570417427, -0.48920443570417427]])+(1.-msk_ref)*numarray.array([[0.57705445283252299, 0.95295912172459696, 0.14619043902616791, -0.48920443570417427, 0.78601648029803872], [-0.48920443570417427, 0.98107261205070739, -0.076270358399511906, 0.80642066967491277, -0.48920443570417427], [0.75602281001495553, -0.32236020811670429, 0.33247541870744768, 0.084067013568079219, -0.48920443570417427], [-0.48920443570417427, 0.97888215332810669, 0.44689990983720462, 0.21364765887818349, -0.48920443570417427]]) | |
24265 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24266 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24267 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24268 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24269 | def test_maximum_Symbol_rank2_expandedData_rank2(self): | |
24270 | arg0=Symbol(shape=(4, 5)) | |
24271 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24272 | arg1=msk_arg1*numarray.array([[0.39666351820237589, -0.7352975550560068, -0.11015957426400935, -0.58424108198582503, -0.026323516666580282], [0.3740296945948236, 0.82459869609560044, -0.72619689102671736, 0.52044070974717171, 0.61329955513119594], [-0.87825153338839335, -0.69110457403756254, -0.40618051038714875, -0.42682250646600828, 0.66659882816185978], [-0.03478776450699228, -0.99588509909633616, -0.71844653366126976, -0.57251535227464911, 0.15819170818429984]])+(1.-msk_arg1)*numarray.array([[-0.13687397567259652, -0.40647175964694093, 0.88049888245344388, 0.56621060585902838, 0.77997450369669186], [0.20844744008272698, 0.81816420914114296, -0.37991517645443307, -0.87711264870328653, -0.06635834242538019], [0.6151897845931098, 0.79990554114277668, 0.15042066460006742, -0.83744291638551838, -0.74662500252921915], [-0.11203359139317959, -0.63423100525926923, -0.89990092815647449, -0.22412842181570958, -0.50482283300657027]]) | |
24273 | res=maximum(arg0,arg1) | |
24274 | s0=numarray.array([[-0.18056793740176569, 0.53044230869190945, -0.14675373044471818, -0.20989896841938638, -0.090609562556853263], [0.026850958754019771, 0.71455594536067824, 0.90780734773692839, 0.80427290442132771, 0.71868468688995968], [0.61645391497678426, -0.81210161202835485, 0.82228572590035354, 0.31715205993520246, -0.49206959275863027], [0.46469955384515593, 0.55983185688761883, -0.28121005250833164, 0.28750026513484728, -0.0035877014730121282]]) | |
24275 | sub=res.substitute({arg0:s0}) | |
24276 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24277 | ref=msk_ref*numarray.array([[0.39666351820237589, 0.53044230869190945, -0.11015957426400935, -0.20989896841938638, -0.026323516666580282], [0.3740296945948236, 0.82459869609560044, 0.90780734773692839, 0.80427290442132771, 0.71868468688995968], [0.61645391497678426, -0.69110457403756254, 0.82228572590035354, 0.31715205993520246, 0.66659882816185978], [0.46469955384515593, 0.55983185688761883, -0.28121005250833164, 0.28750026513484728, 0.15819170818429984]])+(1.-msk_ref)*numarray.array([[-0.13687397567259652, 0.53044230869190945, 0.88049888245344388, 0.56621060585902838, 0.77997450369669186], [0.20844744008272698, 0.81816420914114296, 0.90780734773692839, 0.80427290442132771, 0.71868468688995968], [0.61645391497678426, 0.79990554114277668, 0.82228572590035354, 0.31715205993520246, -0.49206959275863027], [0.46469955384515593, 0.55983185688761883, -0.28121005250833164, 0.28750026513484728, -0.0035877014730121282]]) | |
24278 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24279 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24280 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24281 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24282 | def test_maximum_Symbol_rank0_array_rank3(self): | |
24283 | arg0=Symbol(shape=()) | |
24284 | arg1=numarray.array([[[0.29339754233379134, 0.0022108846355042289], [-0.70281282396389044, -0.17913328863274702]], [[0.95083613182725002, -0.33360040205006802], [-0.72360459828560386, -0.63771632185237914]], [[-0.23174499618243161, 0.25783144021821069], [0.52292264961498547, -0.037581142208750862]], [[-0.33492137217380225, -0.92909994539363883], [-0.29294994252202189, 0.032771080938205577]], [[-0.33963115491622209, -0.4560184398105811], [-0.38704925082990704, -0.36905793427294387]], [[-0.097828004568041749, 0.93545203751918193], [-0.26423008668138226, -0.47432814341661977]]]) | |
24285 | res=maximum(arg0,arg1) | |
24286 | s0=numarray.array(-0.716419255352) | |
24287 | sub=res.substitute({arg0:s0}) | |
24288 | ref=numarray.array([[[0.29339754233379134, 0.0022108846355042289], [-0.70281282396389044, -0.17913328863274702]], [[0.95083613182725002, -0.33360040205006802], [-0.7164192553517521, -0.63771632185237914]], [[-0.23174499618243161, 0.25783144021821069], [0.52292264961498547, -0.037581142208750862]], [[-0.33492137217380225, -0.7164192553517521], [-0.29294994252202189, 0.032771080938205577]], [[-0.33963115491622209, -0.4560184398105811], [-0.38704925082990704, -0.36905793427294387]], [[-0.097828004568041749, 0.93545203751918193], [-0.26423008668138226, -0.47432814341661977]]]) | |
24289 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24290 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24291 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24292 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24293 | def test_maximum_Symbol_rank3_array_rank3(self): | |
24294 | arg0=Symbol(shape=(6, 2, 2)) | |
24295 | arg1=numarray.array([[[-0.6764874487979744, -0.77301471366395913], [0.93472250718477645, 0.94134766765736844]], [[-0.2902843413852163, 0.66766850628321395], [-0.84489262052202574, -0.88419449853196341]], [[-0.18912439533545444, 0.41945117999069748], [0.86905852107269266, -0.35644548972390622]], [[0.79284675788109782, -0.90079211040313822], [-0.37667354978120082, 0.32001422801363355]], [[0.99719108917820387, 0.20935549823961486], [-0.11340161949072614, -0.12111595365420702]], [[0.22719684872202683, 0.84433437986117599], [0.43006222467797817, 0.034934288834081784]]]) | |
24296 | res=maximum(arg0,arg1) | |
24297 | s0=numarray.array([[[0.88636166698982444, -0.6840838071931834], [0.89183726534345209, -0.60038977276729177]], [[-0.52566599572237149, 0.85602758932345857], [-0.90144110979166236, 0.34377038179269848]], [[-0.40687327227202053, 0.92541998919612278], [0.33112275763245225, 0.82982998871415004]], [[-0.22107841184853938, -0.17412319620151218], [0.023732852133522497, 0.38468457701812753]], [[0.24155039570276626, -0.21673544374962583], [-0.39727152459399528, -0.93415688425435017]], [[-0.42630542124350135, -0.46625312593790635], [0.91604919497418402, 0.74853205663615796]]]) | |
24298 | sub=res.substitute({arg0:s0}) | |
24299 | ref=numarray.array([[[0.88636166698982444, -0.6840838071931834], [0.93472250718477645, 0.94134766765736844]], [[-0.2902843413852163, 0.85602758932345857], [-0.84489262052202574, 0.34377038179269848]], [[-0.18912439533545444, 0.92541998919612278], [0.86905852107269266, 0.82982998871415004]], [[0.79284675788109782, -0.17412319620151218], [0.023732852133522497, 0.38468457701812753]], [[0.99719108917820387, 0.20935549823961486], [-0.11340161949072614, -0.12111595365420702]], [[0.22719684872202683, 0.84433437986117599], [0.91604919497418402, 0.74853205663615796]]]) | |
24300 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24301 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24302 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24303 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24304 | def test_maximum_Symbol_rank0_Symbol_rank3(self): | |
24305 | arg0=Symbol(shape=()) | |
24306 | arg1=Symbol(shape=(6, 2, 2)) | |
24307 | res=maximum(arg0,arg1) | |
24308 | s0=numarray.array(0.890464917105) | |
24309 | s1=numarray.array([[[-0.47542536293629367, 0.08791282309219306], [0.8318730496857536, 0.66675946379122975]], [[0.12035381179926241, -0.62237239525026067], [-0.73265350863233625, 0.73451543217895621]], [[0.38525462023648638, 0.25181197027127888], [0.61968014849451936, 0.64752205758820613]], [[-0.96274486374913337, -0.33713474488128448], [0.67669977294816919, -0.22462212781416113]], [[0.3264230846866516, -0.27333933805359933], [0.66932275948701769, 0.038019088948836988]], [[-0.64261933418664063, 0.055528829058187457], [-0.76546743375303739, 0.1942798776976693]]]) | |
24310 | sub=res.substitute({arg0:s0,arg1:s1}) | |
24311 | ref=numarray.array([[[0.89046491710527387, 0.89046491710527387], [0.89046491710527387, 0.89046491710527387]], [[0.89046491710527387, 0.89046491710527387], [0.89046491710527387, 0.89046491710527387]], [[0.89046491710527387, 0.89046491710527387], [0.89046491710527387, 0.89046491710527387]], [[0.89046491710527387, 0.89046491710527387], [0.89046491710527387, 0.89046491710527387]], [[0.89046491710527387, 0.89046491710527387], [0.89046491710527387, 0.89046491710527387]], [[0.89046491710527387, 0.89046491710527387], [0.89046491710527387, 0.89046491710527387]]]) | |
24312 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24313 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24314 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24315 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24316 | def test_maximum_Symbol_rank3_Symbol_rank3(self): | |
24317 | arg0=Symbol(shape=(6, 2, 2)) | |
24318 | arg1=Symbol(shape=(6, 2, 2)) | |
24319 | res=maximum(arg0,arg1) | |
24320 | s0=numarray.array([[[-0.18329481115264645, -0.97291108344147026], [-0.38503671080109481, 0.0254278700851025]], [[0.82486781226151185, 0.49859643168932766], [0.18958641241052931, -0.63059786697466569]], [[-0.96351285266090114, -0.11392388029447842], [-0.73545044716290309, -0.38415334680566304]], [[-0.70313895536108784, 0.86972453577345332], [0.9050989874114006, 0.20147143164852377]], [[-0.57693374895352312, -0.05702146868636282], [-0.024109084445333107, -0.088564104987937098]], [[-0.58633360287709313, 0.56710388407121859], [0.18820564679737162, -0.66919840474772596]]]) | |
24321 | s1=numarray.array([[[0.86414457908562214, 0.79359108960091551], [-0.10889162500414629, -0.50034676527335464]], [[-0.23814875115543277, -0.27663541315593543], [-0.32396929594753199, 0.4737724548108182]], [[-0.62312306630586245, -0.88502401546629295], [0.3881378252904939, 0.77539174161884361]], [[-0.54747818934173753, -0.84873885373197577], [-0.80592241488734295, -0.31580118674907953]], [[-0.9827146643857787, 0.86523259083675219], [0.96150783187292443, 0.98551482766924514]], [[0.35619038990324681, -0.73087960831237919], [0.32362013433909187, -0.080640095423787139]]]) | |
24322 | sub=res.substitute({arg0:s0,arg1:s1}) | |
24323 | ref=numarray.array([[[0.86414457908562214, 0.79359108960091551], [-0.10889162500414629, 0.0254278700851025]], [[0.82486781226151185, 0.49859643168932766], [0.18958641241052931, 0.4737724548108182]], [[-0.62312306630586245, -0.11392388029447842], [0.3881378252904939, 0.77539174161884361]], [[-0.54747818934173753, 0.86972453577345332], [0.9050989874114006, 0.20147143164852377]], [[-0.57693374895352312, 0.86523259083675219], [0.96150783187292443, 0.98551482766924514]], [[0.35619038990324681, 0.56710388407121859], [0.32362013433909187, -0.080640095423787139]]]) | |
24324 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24325 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24326 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24327 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24328 | def test_maximum_Symbol_rank0_constData_rank3(self): | |
24329 | arg0=Symbol(shape=()) | |
24330 | arg1=Data(numarray.array([[[0.32568852433408835, -0.55272129611930398], [-0.084149817978555586, -0.34274401865821558]], [[-0.47726176952042931, -0.34631937280026692], [-0.035216561520925671, -0.73249178043905627]], [[0.78009883802350832, 0.44360970602923189], [0.31506751179210712, -0.23113435042136166]], [[0.0023405479084084302, -0.46422556758653588], [0.6454266161015072, -0.96616888863495443]], [[0.9620354028039293, 0.60396559800614602], [-0.37745027478201343, 0.44192109227544019]], [[-0.54306608746890705, 0.075695529806122153], [-0.95678605433303199, 0.64704122328032687]]]),self.functionspace) | |
24331 | res=maximum(arg0,arg1) | |
24332 | s0=numarray.array(0.633627188844) | |
24333 | sub=res.substitute({arg0:s0}) | |
24334 | ref=Data(numarray.array([[[0.63362718884400193, 0.63362718884400193], [0.63362718884400193, 0.63362718884400193]], [[0.63362718884400193, 0.63362718884400193], [0.63362718884400193, 0.63362718884400193]], [[0.78009883802350832, 0.63362718884400193], [0.63362718884400193, 0.63362718884400193]], [[0.63362718884400193, 0.63362718884400193], [0.6454266161015072, 0.63362718884400193]], [[0.9620354028039293, 0.63362718884400193], [0.63362718884400193, 0.63362718884400193]], [[0.63362718884400193, 0.63362718884400193], [0.63362718884400193, 0.64704122328032687]]]),self.functionspace) | |
24335 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24336 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24337 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24338 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24339 | def test_maximum_Symbol_rank3_constData_rank3(self): | |
24340 | arg0=Symbol(shape=(6, 2, 2)) | |
24341 | arg1=Data(numarray.array([[[0.85692258587753933, -0.10129388170266518], [0.8110137002800879, 0.67377608274648737]], [[-0.71752398637016057, -0.58951427845265014], [0.30156121045716056, 0.66789438832765269]], [[0.25674121894260526, 0.50337004809901376], [-0.27534576699195612, 0.0069744298369271984]], [[0.10411830060243932, -0.38454331052123525], [-0.14398299168325446, -0.36725433436330102]], [[-0.076454899963227296, 0.36804698909232925], [-0.76660768351290121, 0.42166893789969384]], [[0.76306470750109567, 0.90405926947092086], [-0.69746358167885059, -0.57398383152198784]]]),self.functionspace) | |
24342 | res=maximum(arg0,arg1) | |
24343 | s0=numarray.array([[[0.050483403914534986, 0.6274385153472164], [-0.82735136253802311, -0.50120424225576699]], [[0.71550161154713776, -0.045329688560096448], [0.36829020813589053, -0.44341986442180992]], [[0.72297168963475511, -0.91716624719047912], [0.57398208106426352, 0.22082803410655294]], [[-0.45336261658274313, -0.92069962652331472], [0.82130013830648618, 0.60823879246569246]], [[0.33707620838660768, 0.56989518375507564], [0.28427029363757916, -0.50013875183284107]], [[-0.6058190127748484, 0.76654727297616265], [0.91096982261018966, -0.82329820822579647]]]) | |
24344 | sub=res.substitute({arg0:s0}) | |
24345 | ref=Data(numarray.array([[[0.85692258587753933, 0.6274385153472164], [0.8110137002800879, 0.67377608274648737]], [[0.71550161154713776, -0.045329688560096448], [0.36829020813589053, 0.66789438832765269]], [[0.72297168963475511, 0.50337004809901376], [0.57398208106426352, 0.22082803410655294]], [[0.10411830060243932, -0.38454331052123525], [0.82130013830648618, 0.60823879246569246]], [[0.33707620838660768, 0.56989518375507564], [0.28427029363757916, 0.42166893789969384]], [[0.76306470750109567, 0.90405926947092086], [0.91096982261018966, -0.57398383152198784]]]),self.functionspace) | |
24346 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24347 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24348 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24349 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24350 | def test_maximum_Symbol_rank0_expandedData_rank3(self): | |
24351 | arg0=Symbol(shape=()) | |
24352 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24353 | arg1=msk_arg1*numarray.array([[[-0.57653628850840333, 0.19094416526641789], [0.84417250154613299, -0.37411027843502231]], [[0.32126078398907976, 0.44944398340492597], [-0.11146170994432114, 0.11597337950678299]], [[-0.70285763359083875, -0.15598356223672916], [0.76426158039335346, 0.12007672470791309]], [[-0.65693831034340433, 0.84391397019686054], [-0.64829210999691655, 0.2219351949329178]], [[0.66709305263693874, -0.51781394274008274], [-0.86385545861254398, 0.68197749050561574]], [[-0.41293796354927248, 0.90505950749329767], [0.25110585703000177, 0.24781032994023589]]])+(1.-msk_arg1)*numarray.array([[[0.11132526506740836, -0.52402219445034026], [0.1828750046221308, -0.53065346009666436]], [[-0.80156405080561766, 0.63718840971056601], [-0.32283315325508433, 0.093742341886728919]], [[-0.93420729238299116, 0.22189922926071115], [-0.87128641182657129, 0.40088846571558312]], [[-0.77881045840063501, -0.3430723237069313], [-0.8013638431535326, 0.6571865235565697]], [[-0.82407092416622141, -0.51730688792872059], [-0.93104098770035315, 0.97332671737783594]], [[0.52127502902327527, -0.84531224506343094], [-0.59547145607180307, -0.56618082649726631]]]) | |
24354 | res=maximum(arg0,arg1) | |
24355 | s0=numarray.array(0.860369251457) | |
24356 | sub=res.substitute({arg0:s0}) | |
24357 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24358 | ref=msk_ref*numarray.array([[[0.86036925145669096, 0.86036925145669096], [0.86036925145669096, 0.86036925145669096]], [[0.86036925145669096, 0.86036925145669096], [0.86036925145669096, 0.86036925145669096]], [[0.86036925145669096, 0.86036925145669096], [0.86036925145669096, 0.86036925145669096]], [[0.86036925145669096, 0.86036925145669096], [0.86036925145669096, 0.86036925145669096]], [[0.86036925145669096, 0.86036925145669096], [0.86036925145669096, 0.86036925145669096]], [[0.86036925145669096, 0.90505950749329767], [0.86036925145669096, 0.86036925145669096]]])+(1.-msk_ref)*numarray.array([[[0.86036925145669096, 0.86036925145669096], [0.86036925145669096, 0.86036925145669096]], [[0.86036925145669096, 0.86036925145669096], [0.86036925145669096, 0.86036925145669096]], [[0.86036925145669096, 0.86036925145669096], [0.86036925145669096, 0.86036925145669096]], [[0.86036925145669096, 0.86036925145669096], [0.86036925145669096, 0.86036925145669096]], [[0.86036925145669096, 0.86036925145669096], [0.86036925145669096, 0.97332671737783594]], [[0.86036925145669096, 0.86036925145669096], [0.86036925145669096, 0.86036925145669096]]]) | |
24359 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24360 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24361 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24362 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24363 | def test_maximum_Symbol_rank3_expandedData_rank3(self): | |
24364 | arg0=Symbol(shape=(6, 2, 2)) | |
24365 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24366 | arg1=msk_arg1*numarray.array([[[0.010516777640972697, 0.60120064014605079], [-0.84460937064504482, -0.84625744776917022]], [[0.77962126254035158, 0.74164858425755464], [0.068202087346799223, 0.43265821004094707]], [[-0.55362398279753666, -0.27296959892978401], [-0.65328622442728768, -0.98672121384052991]], [[-0.63456176421577282, 0.62179697944598677], [-0.57625841517839804, 0.18574353119346165]], [[-0.08269199537899552, -0.99017991590928767], [0.52429151031264221, 0.75817259458900188]], [[-0.91460575509654629, 0.37417073831531877], [-0.11092444682659641, 0.059566798767184848]]])+(1.-msk_arg1)*numarray.array([[[-0.70061212578129428, 0.42367670762183929], [-0.12938353673895464, -0.10833729551639437]], [[-0.18825613846812339, -0.054063591344754025], [0.9480085478536513, 0.82998380686007667]], [[-0.28076760120864064, 0.2314742338361282], [-0.92727748765633589, 0.57998598065466922]], [[-0.038914120154450949, -0.84943755339331584], [0.16297527678184132, -0.4163279958605226]], [[-0.22292385049843944, -0.77914478579712099], [0.64661943234772634, -0.31154755140327883]], [[-0.90719447570461087, 0.14069859110425642], [-0.88855105894544573, -0.15904712129137155]]]) | |
24367 | res=maximum(arg0,arg1) | |
24368 | s0=numarray.array([[[-0.038394462994514766, 0.20434482159129064], [-0.92498889865024703, -0.77614747980675736]], [[0.65055268191055338, 0.03706977456722016], [0.17776082394317605, -0.70060252370400433]], [[-0.36252794984515258, -0.46726405611411126], [0.90858279094238226, 0.55782533354609654]], [[-0.9073925707193462, -0.22346212785707076], [0.63239830917035333, 0.34747287392663617]], [[-0.67968889804330246, 0.71036257956938531], [-0.27666689569899106, 0.40542747615974717]], [[0.39389220084882903, -0.76306927321997686], [-0.47819005673187309, -0.39173855327967866]]]) | |
24369 | sub=res.substitute({arg0:s0}) | |
24370 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24371 | ref=msk_ref*numarray.array([[[0.010516777640972697, 0.60120064014605079], [-0.84460937064504482, -0.77614747980675736]], [[0.77962126254035158, 0.74164858425755464], [0.17776082394317605, 0.43265821004094707]], [[-0.36252794984515258, -0.27296959892978401], [0.90858279094238226, 0.55782533354609654]], [[-0.63456176421577282, 0.62179697944598677], [0.63239830917035333, 0.34747287392663617]], [[-0.08269199537899552, 0.71036257956938531], [0.52429151031264221, 0.75817259458900188]], [[0.39389220084882903, 0.37417073831531877], [-0.11092444682659641, 0.059566798767184848]]])+(1.-msk_ref)*numarray.array([[[-0.038394462994514766, 0.42367670762183929], [-0.12938353673895464, -0.10833729551639437]], [[0.65055268191055338, 0.03706977456722016], [0.9480085478536513, 0.82998380686007667]], [[-0.28076760120864064, 0.2314742338361282], [0.90858279094238226, 0.57998598065466922]], [[-0.038914120154450949, -0.22346212785707076], [0.63239830917035333, 0.34747287392663617]], [[-0.22292385049843944, 0.71036257956938531], [0.64661943234772634, 0.40542747615974717]], [[0.39389220084882903, 0.14069859110425642], [-0.47819005673187309, -0.15904712129137155]]]) | |
24372 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24373 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24374 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24375 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24376 | def test_maximum_Symbol_rank0_array_rank4(self): | |
24377 | arg0=Symbol(shape=()) | |
24378 | arg1=numarray.array([[[[-0.22672291859395366, -0.95305535759181881, -0.63790479181274184, 0.57987784525884312], [-0.74794540413203126, 0.47005773853790078, -0.97876804068726875, 0.50784074089241993], [-0.084720347523811856, 0.086904799263365362, -0.96455200508452776, -0.18173771571574249]], [[0.91235685348610307, 0.32798518943235466, 0.63562798120801833, -0.047248426437298319], [-0.076374800002460663, -0.64182255571769198, 0.03315517509218191, -0.51358838089418168], [-0.91348077240620573, -0.84832022280125785, 0.008552131049955447, 0.91798535015558236]]], [[[-0.66753395132723825, -0.17623447837007822, -0.067291695444720245, -0.82210702472202102], [-0.3985041744402551, -0.041506375166231457, -0.9656316904147455, -0.16862736477613205], [-0.4851059142640104, 0.70744547107828404, -0.47413240299001425, 0.37066254940828669]], [[-0.059631009831195625, -0.84724579994833671, 0.24955596071221731, 0.17790317305792147], [0.44866580350344543, -0.24454945597196809, -0.14943377265514424, -0.86123841015287406], [0.63558026374371668, -0.99929837742030592, 0.31210228931905615, 0.33434525579893726]]], [[[-0.17964634256279277, -0.7893763716476343, -0.90750738207750836, 0.29169359971463216], [-0.32861007822736732, -0.66839272495110058, -0.95481155969639686, 0.82484410755679716], [-0.9067452758699881, -0.96011412793796813, -0.21841535705831494, 0.3739119351759197]], [[-0.47568953719081164, -0.28247777052015177, -0.21297521816609999, 0.80573677264279486], [-0.026756106052450379, 0.089541005915227956, -0.040373521220984809, 0.45967937074998177], [0.80916344237700244, 0.52963770268056076, 0.87782054362161399, 0.50646130790152677]]]]) | |
24379 | res=maximum(arg0,arg1) | |
24380 | s0=numarray.array(-0.0447842290384) | |
24381 | sub=res.substitute({arg0:s0}) | |
24382 | ref=numarray.array([[[[-0.044784229038412837, -0.044784229038412837, -0.044784229038412837, 0.57987784525884312], [-0.044784229038412837, 0.47005773853790078, -0.044784229038412837, 0.50784074089241993], [-0.044784229038412837, 0.086904799263365362, -0.044784229038412837, -0.044784229038412837]], [[0.91235685348610307, 0.32798518943235466, 0.63562798120801833, -0.044784229038412837], [-0.044784229038412837, -0.044784229038412837, 0.03315517509218191, -0.044784229038412837], [-0.044784229038412837, -0.044784229038412837, 0.008552131049955447, 0.91798535015558236]]], [[[-0.044784229038412837, -0.044784229038412837, -0.044784229038412837, -0.044784229038412837], [-0.044784229038412837, -0.041506375166231457, -0.044784229038412837, -0.044784229038412837], [-0.044784229038412837, 0.70744547107828404, -0.044784229038412837, 0.37066254940828669]], [[-0.044784229038412837, -0.044784229038412837, 0.24955596071221731, 0.17790317305792147], [0.44866580350344543, -0.044784229038412837, -0.044784229038412837, -0.044784229038412837], [0.63558026374371668, -0.044784229038412837, 0.31210228931905615, 0.33434525579893726]]], [[[-0.044784229038412837, -0.044784229038412837, -0.044784229038412837, 0.29169359971463216], [-0.044784229038412837, -0.044784229038412837, -0.044784229038412837, 0.82484410755679716], [-0.044784229038412837, -0.044784229038412837, -0.044784229038412837, 0.3739119351759197]], [[-0.044784229038412837, -0.044784229038412837, -0.044784229038412837, 0.80573677264279486], [-0.026756106052450379, 0.089541005915227956, -0.040373521220984809, 0.45967937074998177], [0.80916344237700244, 0.52963770268056076, 0.87782054362161399, 0.50646130790152677]]]]) | |
24383 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24384 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24385 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24386 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24387 | def test_maximum_Symbol_rank4_array_rank4(self): | |
24388 | arg0=Symbol(shape=(3, 2, 3, 4)) | |
24389 | arg1=numarray.array([[[[0.22859584632583263, -0.49964587357132872, 0.086470776924952197, 0.42290964650936536], [0.90937469309327956, 0.52077687187185928, 0.26403290901603027, 0.23331609740121895], [0.2963983419985563, -0.7647547061296065, 0.20664027121177853, 0.43665491999143158]], [[0.87939983689267698, 0.85421523030279389, 0.049255595757613735, 0.51481804264120412], [-0.18641300303264852, -0.6253462919532744, 0.33585610636840357, -0.39349689192316073], [0.57660421473602108, -0.42166143444700266, -0.91469900193095111, 0.10045159224477196]]], [[[-0.26395757504790129, 0.39147904987782045, -0.93606882339379793, -0.84160666236095771], [0.93471768322024862, -0.24903651446950037, 0.88677565016934268, -0.60610514893049938], [0.49273310369686851, 0.071189997025720153, 0.66662351893261484, -0.9527728713146697]], [[-0.40665175803980214, -0.15058994378663826, -0.60390247676056008, 0.72933869321036848], [-0.025687743718204148, -0.68564970759152288, 0.94289809230252786, 0.2900877373795363], [0.69609393571465406, -0.69112085533563472, 0.65144978792589914, -0.33446027303627068]]], [[[0.2387465130886075, 0.090950095918787222, -0.49309589516571251, 0.59865416201774324], [0.27584589277836713, 0.49849504887710827, -0.25120995254302203, 0.13990808487517103], [0.87000785561059812, -0.42191934000096465, 0.69837171372420315, 0.98016474174914903]], [[-0.20506044289881609, -0.40268835993916308, -0.46835003820343646, 0.68307210363587179], [-0.51517708190071332, -0.33359009958121311, 0.56420273334245685, 0.40583949265330466], [-0.0089796450496348879, 0.10175894115881468, 0.84086912438464467, -0.90042955897097188]]]]) | |
24390 | res=maximum(arg0,arg1) | |
24391 | s0=numarray.array([[[[-0.61680757786633, 0.15663517224128998, -0.62028829614332648, 0.65982719025153891], [0.95700546137100795, -0.08624570184920044, 0.018220798772857982, 0.91439775658040756], [0.06454215218124193, 0.14895550091837451, -0.81344811861198529, -0.73171642983234353]], [[-0.38274374999571026, -0.24846100370907909, -0.78256200168802881, 0.10660169114209683], [0.2408553375522946, -0.30389962377182278, 0.44611850858169744, -0.032042409294563479], [-0.34020222824520974, 0.1171858663552432, 0.99457455241720139, -0.45190701309699466]]], [[[-0.82444756608053904, -0.53701809683036617, 0.80526076129721846, 0.94179515034432382], [0.90570316863078637, 0.85026811413861325, -0.084328716034264062, 0.583858420302791], [-0.07503991344527372, -0.47842084538144136, 0.52532459198516146, 0.99015498512300959]], [[0.76475532370930455, 0.08568167696132778, 0.80666906071672861, 0.70540823249171347], [-0.92088313169158775, -0.71294774283312257, -0.50254617846594418, 0.69941402937188957], [0.68299307069766102, 0.20851158208497278, 0.97007859976731114, 0.89088997676979775]]], [[[0.74280261126787206, -0.79908745531265524, 0.28808238813408593, -0.9108026839182346], [-0.89323119175824472, 0.90400075232487431, -0.25196671766511436, -0.85718534216330911], [-0.44750354328292374, -0.63380481448691062, 0.02050948379246087, -0.83727980836704408]], [[-0.84104946225264698, 0.93174581258496203, -0.28512648036513899, -0.95377121876013171], [-0.29080440585024547, -0.40825991866604361, 0.97458611849762788, -0.034373434324477481], [0.31658722463091427, -0.5718901172479478, 0.36544453487551487, 0.55385738177950961]]]]) | |
24392 | sub=res.substitute({arg0:s0}) | |
24393 | ref=numarray.array([[[[0.22859584632583263, 0.15663517224128998, 0.086470776924952197, 0.65982719025153891], [0.95700546137100795, 0.52077687187185928, 0.26403290901603027, 0.91439775658040756], [0.2963983419985563, 0.14895550091837451, 0.20664027121177853, 0.43665491999143158]], [[0.87939983689267698, 0.85421523030279389, 0.049255595757613735, 0.51481804264120412], [0.2408553375522946, -0.30389962377182278, 0.44611850858169744, -0.032042409294563479], [0.57660421473602108, 0.1171858663552432, 0.99457455241720139, 0.10045159224477196]]], [[[-0.26395757504790129, 0.39147904987782045, 0.80526076129721846, 0.94179515034432382], [0.93471768322024862, 0.85026811413861325, 0.88677565016934268, 0.583858420302791], [0.49273310369686851, 0.071189997025720153, 0.66662351893261484, 0.99015498512300959]], [[0.76475532370930455, 0.08568167696132778, 0.80666906071672861, 0.72933869321036848], [-0.025687743718204148, -0.68564970759152288, 0.94289809230252786, 0.69941402937188957], [0.69609393571465406, 0.20851158208497278, 0.97007859976731114, 0.89088997676979775]]], [[[0.74280261126787206, 0.090950095918787222, 0.28808238813408593, 0.59865416201774324], [0.27584589277836713, 0.90400075232487431, -0.25120995254302203, 0.13990808487517103], [0.87000785561059812, -0.42191934000096465, 0.69837171372420315, 0.98016474174914903]], [[-0.20506044289881609, 0.93174581258496203, -0.28512648036513899, 0.68307210363587179], [-0.29080440585024547, -0.33359009958121311, 0.97458611849762788, 0.40583949265330466], [0.31658722463091427, 0.10175894115881468, 0.84086912438464467, 0.55385738177950961]]]]) | |
24394 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24395 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24396 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24397 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24398 | def test_maximum_Symbol_rank0_Symbol_rank4(self): | |
24399 | arg0=Symbol(shape=()) | |
24400 | arg1=Symbol(shape=(3, 2, 3, 4)) | |
24401 | res=maximum(arg0,arg1) | |
24402 | s0=numarray.array(-0.937781883941) | |
24403 | s1=numarray.array([[[[0.92592943775670555, 0.56445054840164621, -0.25798705131114419, -0.27720297339693656], [-0.5652057107656574, 0.71678840553271073, 0.26978498950813479, -0.81781280858706773], [-0.48007042378859066, 0.17887934717613962, 0.99045825227467987, -0.58914933265372804]], [[0.99922352095347478, 0.78262443546427352, -0.6520513942976085, -0.98291868592156351], [0.42952714706948503, -0.93783630911422833, 0.95894179727622619, 0.058853528582238912], [0.20846925403146854, -0.28138640206454313, -0.76485106306715434, -0.64242994143006227]]], [[[-0.76502499326976969, 0.22620747215356052, 0.15169968969400927, -0.28799122362178875], [-0.82468028483698341, 0.6853648721565524, 0.53618639251762268, -0.11504255580107769], [0.12016962029113687, -0.77624929571996182, 0.90332828825434164, 0.2649634762981079]], [[-0.70086154589199312, -0.72325037997451447, 0.90912045763140115, 0.59709754203889753], [-0.55693372356409254, 0.58996132388905598, 0.47997419252808293, -0.43712539184888555], [0.057999770468728284, -0.33362734244199643, 0.23278512046834376, -0.78673643505995416]]], [[[-0.67120184187944765, 0.039761256453554328, -0.82742387688294405, 0.83056912562260021], [0.0869773421732154, 0.036561727406758671, 0.67104424586236866, -0.68393955962414044], [0.29400476749493953, 0.60177470500994712, 0.84357347160566754, -0.35300399257861725]], [[-0.31642290502234882, -0.67819469512506481, -0.80321923418657626, -0.75130669583454446], [0.62276618423751628, 0.53085489780323525, 0.75723916853289319, -0.068956986552453969], [-0.65219707335512345, -0.52298443716825527, 0.74268126750312313, 0.064268626156129161]]]]) | |
24404 | sub=res.substitute({arg0:s0,arg1:s1}) | |
24405 | ref=numarray.array([[[[0.92592943775670555, 0.56445054840164621, -0.25798705131114419, -0.27720297339693656], [-0.5652057107656574, 0.71678840553271073, 0.26978498950813479, -0.81781280858706773], [-0.48007042378859066, 0.17887934717613962, 0.99045825227467987, -0.58914933265372804]], [[0.99922352095347478, 0.78262443546427352, -0.6520513942976085, -0.93778188394110451], [0.42952714706948503, -0.93778188394110451, 0.95894179727622619, 0.058853528582238912], [0.20846925403146854, -0.28138640206454313, -0.76485106306715434, -0.64242994143006227]]], [[[-0.76502499326976969, 0.22620747215356052, 0.15169968969400927, -0.28799122362178875], [-0.82468028483698341, 0.6853648721565524, 0.53618639251762268, -0.11504255580107769], [0.12016962029113687, -0.77624929571996182, 0.90332828825434164, 0.2649634762981079]], [[-0.70086154589199312, -0.72325037997451447, 0.90912045763140115, 0.59709754203889753], [-0.55693372356409254, 0.58996132388905598, 0.47997419252808293, -0.43712539184888555], [0.057999770468728284, -0.33362734244199643, 0.23278512046834376, -0.78673643505995416]]], [[[-0.67120184187944765, 0.039761256453554328, -0.82742387688294405, 0.83056912562260021], [0.0869773421732154, 0.036561727406758671, 0.67104424586236866, -0.68393955962414044], [0.29400476749493953, 0.60177470500994712, 0.84357347160566754, -0.35300399257861725]], [[-0.31642290502234882, -0.67819469512506481, -0.80321923418657626, -0.75130669583454446], [0.62276618423751628, 0.53085489780323525, 0.75723916853289319, -0.068956986552453969], [-0.65219707335512345, -0.52298443716825527, 0.74268126750312313, 0.064268626156129161]]]]) | |
24406 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24407 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24408 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24409 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24410 | def test_maximum_Symbol_rank4_Symbol_rank4(self): | |
24411 | arg0=Symbol(shape=(3, 2, 3, 4)) | |
24412 | arg1=Symbol(shape=(3, 2, 3, 4)) | |
24413 | res=maximum(arg0,arg1) | |
24414 | s0=numarray.array([[[[-0.41185158772809816, -0.59982439829929213, 0.11035526264174855, 0.39680396057713008], [0.60105426824013541, -0.32554905710316118, -0.38720375782902061, -0.1230271637826692], [-0.36164125397460012, 0.4041305639265893, 0.80684751796422649, -0.54389849602118989]], [[0.12472227670948288, 0.92001176547242602, -0.53583665251309198, -0.79032558890899129], [0.54303166570985795, 0.48730482750117066, 0.33536853423325219, -0.54405000648665203], [-0.90607601243187474, 0.77382684624419751, -0.09417864043275137, 0.75870003109114315]]], [[[0.63307410041973133, 0.8749566105768054, 0.37137382211609604, -0.77241284196092486], [0.15099008123405033, -0.73322216160913833, 0.28818404627765082, -0.83382706674975848], [-0.33206123027783407, -0.21371543078156408, 0.45839980899754873, 0.043354495720617336]], [[0.86256379359574797, 0.66782583537908891, -0.81777752559626249, 0.78678591492228267], [0.51236091465673694, -0.72912156504826964, 0.0011570183078764007, 0.29511700060869672], [-0.393514154152099, 0.72122139512956962, 0.22467497719317753, 0.0041654407953581885]]], [[[0.18146859353374323, 0.81309569349675392, -0.81543468728596191, -0.074289420750079715], [0.53380418923195894, 0.8477070735234058, 0.63008475217631887, -0.93684501515887053], [0.53706108758955562, -0.75639300486800209, -0.78351760363312195, -0.0026207614695039627]], [[-0.69087067123536605, 0.66220945531535946, -0.28646796185831502, -0.3640488631126737], [-0.70812099325081168, -0.081344895374056536, 0.64822549559257725, -0.025343484747048395], [-0.35262878521908503, 0.10534583481913495, -0.16963208595434542, 0.19534864838589616]]]]) | |
24415 | s1=numarray.array([[[[-0.044026313657740568, -0.78289814754355991, -0.70631058379045086, -0.52630435626334537], [0.9941097210486276, 0.7832949599807022, 0.28014575812793852, 0.05499629138443618], [0.91172429747596095, 0.51261079394706144, -0.81489687296645696, -0.16793882693190709]], [[-0.27046168009988736, 0.55398024095927823, 0.9492769973969879, -0.95147127755487593], [0.36824292958036708, -0.75966475779442799, -0.30187376724003312, 0.58898873841549482], [-0.99149051087675466, 0.95409690829694305, 0.34315692772672723, -0.55052047842092144]]], [[[-0.40959529608800405, -0.83174043986179091, -0.86670058576008313, -0.84047612074360467], [0.88661124543070624, 0.18009677741923502, -0.23825962030849501, 0.97781897017306307], [-0.25874554084403534, -0.49843208360473157, -0.85346777142566954, 0.98088469776303366]], [[0.46575327128539068, -0.97363923789027806, 0.31682900574101303, -0.58163959606138071], [-0.90383714625603595, 0.61983020748554929, -0.612894581271892, -0.43586899250922917], [-0.19735545140454702, 0.55375847781843635, -0.60601302849984973, -0.13122392524722182]]], [[[0.23212848220934368, 0.067639769889185519, 0.9949842666254769, -0.21102948960426482], [-0.48236152817826539, 0.38788767207762631, -0.023756490935391561, 0.77293934708851308], [0.56560004546728981, -0.64444227316016023, 0.42210933518530669, -0.52287550086514023]], [[-0.22095075813574039, -0.35204310530806149, -0.16366473997989539, -0.93633079033553201], [-0.16133682240062486, -0.80043300787665395, -0.47081233283657675, 0.62802945832598467], [-0.48214648563163132, -0.19446689423171892, 0.80158933715665071, 0.79093314251552416]]]]) | |
24416 | sub=res.substitute({arg0:s0,arg1:s1}) | |
24417 | ref=numarray.array([[[[-0.044026313657740568, -0.59982439829929213, 0.11035526264174855, 0.39680396057713008], [0.9941097210486276, 0.7832949599807022, 0.28014575812793852, 0.05499629138443618], [0.91172429747596095, 0.51261079394706144, 0.80684751796422649, -0.16793882693190709]], [[0.12472227670948288, 0.92001176547242602, 0.9492769973969879, -0.79032558890899129], [0.54303166570985795, 0.48730482750117066, 0.33536853423325219, 0.58898873841549482], [-0.90607601243187474, 0.95409690829694305, 0.34315692772672723, 0.75870003109114315]]], [[[0.63307410041973133, 0.8749566105768054, 0.37137382211609604, -0.77241284196092486], [0.88661124543070624, 0.18009677741923502, 0.28818404627765082, 0.97781897017306307], [-0.25874554084403534, -0.21371543078156408, 0.45839980899754873, 0.98088469776303366]], [[0.86256379359574797, 0.66782583537908891, 0.31682900574101303, 0.78678591492228267], [0.51236091465673694, 0.61983020748554929, 0.0011570183078764007, 0.29511700060869672], [-0.19735545140454702, 0.72122139512956962, 0.22467497719317753, 0.0041654407953581885]]], [[[0.23212848220934368, 0.81309569349675392, 0.9949842666254769, -0.074289420750079715], [0.53380418923195894, 0.8477070735234058, 0.63008475217631887, 0.77293934708851308], [0.56560004546728981, -0.64444227316016023, 0.42210933518530669, -0.0026207614695039627]], [[-0.22095075813574039, 0.66220945531535946, -0.16366473997989539, -0.3640488631126737], [-0.16133682240062486, -0.081344895374056536, 0.64822549559257725, 0.62802945832598467], [-0.35262878521908503, 0.10534583481913495, 0.80158933715665071, 0.79093314251552416]]]]) | |
24418 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24419 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24420 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24421 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24422 | def test_maximum_Symbol_rank0_constData_rank4(self): | |
24423 | arg0=Symbol(shape=()) | |
24424 | arg1=Data(numarray.array([[[[-0.50685759473576719, 0.93542139233168409, 0.86091578348248921, 0.58494539092709275], [0.91744132050650751, -0.12090084241685783, -0.22425047634430584, -0.26763897748139587], [-0.47215008025389005, 0.63019999532793292, -0.40899409051397306, 0.22804192071663487]], [[-0.11719848975372549, -0.74613076576175752, 0.81912278588233622, 0.52233933993291282], [0.15105709321543803, -0.33275004001129749, -0.82835368404702359, 0.34215784767967183], [0.042821885170873708, 0.41013155832171266, 0.76046715154107147, -0.12793062147458967]]], [[[0.34105576406804095, 0.64203616232599203, 0.9792104464266489, 0.73330843417008174], [0.11804732097582948, 0.32724230927205689, -0.93531377686595452, -0.032105704410765101], [0.26531057306554207, -0.84810983561679953, 0.69312850590289665, -0.99315140646823163]], [[-0.01552242416667271, 0.70315763041634494, 0.15581981807010492, -0.82813194303662341], [-0.36750586241714367, 0.29968282135195801, -0.73956697022543305, -0.096361557223572314], [0.8611274306722938, 0.22786652896860193, -0.63216669039665208, 0.62383613485301503]]], [[[-0.020105085338268269, 0.79313636338363569, -0.18076384556191449, -0.88296710086038188], [0.64143630686143704, -0.45499259129938707, 0.11284017505285804, -0.15283896664140451], [0.53237462591611662, -0.80884202719114895, -0.620808123572411, -0.31888518763473628]], [[0.7599060453656159, 0.57588666706212166, 0.34391524109001259, 0.38132425560502026], [0.76217435250233434, -0.8090981677400646, 0.33451694900534701, 0.7541228619916136], [-0.56450367450664252, 0.34989342045913352, 0.59826501510005237, 0.43924192680866425]]]]),self.functionspace) | |
24425 | res=maximum(arg0,arg1) | |
24426 | s0=numarray.array(0.483272599339) | |
24427 | sub=res.substitute({arg0:s0}) | |
24428 | ref=Data(numarray.array([[[[0.48327259933866151, 0.93542139233168409, 0.86091578348248921, 0.58494539092709275], [0.91744132050650751, 0.48327259933866151, 0.48327259933866151, 0.48327259933866151], [0.48327259933866151, 0.63019999532793292, 0.48327259933866151, 0.48327259933866151]], [[0.48327259933866151, 0.48327259933866151, 0.81912278588233622, 0.52233933993291282], [0.48327259933866151, 0.48327259933866151, 0.48327259933866151, 0.48327259933866151], [0.48327259933866151, 0.48327259933866151, 0.76046715154107147, 0.48327259933866151]]], [[[0.48327259933866151, 0.64203616232599203, 0.9792104464266489, 0.73330843417008174], [0.48327259933866151, 0.48327259933866151, 0.48327259933866151, 0.48327259933866151], [0.48327259933866151, 0.48327259933866151, 0.69312850590289665, 0.48327259933866151]], [[0.48327259933866151, 0.70315763041634494, 0.48327259933866151, 0.48327259933866151], [0.48327259933866151, 0.48327259933866151, 0.48327259933866151, 0.48327259933866151], [0.8611274306722938, 0.48327259933866151, 0.48327259933866151, 0.62383613485301503]]], [[[0.48327259933866151, 0.79313636338363569, 0.48327259933866151, 0.48327259933866151], [0.64143630686143704, 0.48327259933866151, 0.48327259933866151, 0.48327259933866151], [0.53237462591611662, 0.48327259933866151, 0.48327259933866151, 0.48327259933866151]], [[0.7599060453656159, 0.57588666706212166, 0.48327259933866151, 0.48327259933866151], [0.76217435250233434, 0.48327259933866151, 0.48327259933866151, 0.7541228619916136], [0.48327259933866151, 0.48327259933866151, 0.59826501510005237, 0.48327259933866151]]]]),self.functionspace) | |
24429 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24430 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24431 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24432 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24433 | def test_maximum_Symbol_rank4_constData_rank4(self): | |
24434 | arg0=Symbol(shape=(3, 2, 3, 4)) | |
24435 | arg1=Data(numarray.array([[[[0.81291500942743689, -0.68582699458955609, 0.81352298902763742, 0.39781543546080167], [-0.058821412679685325, 0.084121425869268407, 0.70267202907861503, 0.64973936665382448], [-0.83557781519503593, 0.83519559824905709, 0.3509596814867979, 0.44069192607057572]], [[0.58645256429834958, -0.93225362283840862, 0.68570059820099405, -0.54348414064253125], [0.76917587572857382, 0.95347446589624063, -0.60997445954200913, 0.64429654703588657], [0.66222501403614586, 0.54611501765355408, -0.86310550948589104, 0.7061027344391495]]], [[[-0.66032843373230898, -0.70116000754862728, 0.98886901186760179, 0.60211469163098008], [-0.30672337825078611, -0.67158566276763154, -0.18554254910322188, -0.97453904134729852], [0.20690850500924474, -0.69845742100687702, 0.77379175383854171, 0.63817634019129077]], [[0.20347185863536654, -0.73037920605041928, -0.73059576888121858, -0.45781414409932242], [0.97450335589680859, 0.48952866118620597, 0.60198834990491656, -0.22026887284307417], [0.83793237855262115, 0.68924996250989179, 0.43909589165101726, -0.84649279842798819]]], [[[0.06762289208374539, 0.003485215342493575, -0.72219871508048983, -0.42979286443903852], [-0.18910628954926922, 0.3733743927355937, 0.4847674701588891, -0.94903484938792149], [0.92474942550438666, 0.29176241363103461, -0.68790225227442536, 0.8333730304177811]], [[0.75479445958320479, -0.20679565120324828, -0.6850961798536086, 0.53947605724380332], [-0.14225936952298301, 0.67875317157661486, -0.3548525982400359, 0.66203649107645157], [-0.87976283666119182, 0.0415683267122815, 0.56826126103931318, 0.089739757320835167]]]]),self.functionspace) | |
24436 | res=maximum(arg0,arg1) | |
24437 | s0=numarray.array([[[[0.050681449842814974, -0.67051226777755391, 0.7906875326213878, 0.64802026846703398], [0.85274872767822263, -0.80912481523552904, 0.45310189322429273, -0.084009843756123193], [-0.20643249494243965, 0.5668766730144652, -0.20085534006470773, 0.5195238989056008]], [[0.22857005100313321, 0.048344182879428654, 0.37591809139105736, 0.09122669092525082], [0.091700487355204308, -0.9985039657422683, -0.4164303769076676, 0.9730391888230423], [0.36112212740007332, -0.77057750340490272, -0.89856339703576826, 0.021324460922719446]]], [[[-0.73448968801729797, 0.30575249723121178, 0.14892014298547984, -0.53107217197436607], [0.004812431898059355, -0.69992003674657433, -0.610488723221569, 0.64811312410943445], [0.22997105622251302, 0.11835539098936265, 0.8051190908659922, 0.31101048403753206]], [[0.84520047859214009, 0.25782980818567158, 0.013268176660491626, -0.33594843665530849], [0.64378241035921802, 0.69093768187104443, 0.39258728918190489, -0.18621134440879072], [-0.23302256553155276, -0.60443179190698082, -0.19660253238619974, 0.80036365200337034]]], [[[-0.07553608083911012, 0.60965867572354493, 0.85789932062393204, -0.81568652450890067], [0.80018980915321358, -0.23001896388500498, -0.24992976621779284, -0.6478071279090023], [-0.32424232929747721, 0.88731416443351541, -0.96115335133988533, 0.66653897919244987]], [[-0.67397552072494538, 0.20750517083663955, 0.84685381358684109, 0.66338214188449807], [-0.14628962409645374, 0.71081961187757159, -0.73926084700672257, -0.7162326018702152], [0.42110979033605678, 0.47593666296419634, -0.35853593738739398, -0.016857828821966292]]]]) | |
24438 | sub=res.substitute({arg0:s0}) | |
24439 | ref=Data(numarray.array([[[[0.81291500942743689, -0.67051226777755391, 0.81352298902763742, 0.64802026846703398], [0.85274872767822263, 0.084121425869268407, 0.70267202907861503, 0.64973936665382448], [-0.20643249494243965, 0.83519559824905709, 0.3509596814867979, 0.5195238989056008]], [[0.58645256429834958, 0.048344182879428654, 0.68570059820099405, 0.09122669092525082], [0.76917587572857382, 0.95347446589624063, -0.4164303769076676, 0.9730391888230423], [0.66222501403614586, 0.54611501765355408, -0.86310550948589104, 0.7061027344391495]]], [[[-0.66032843373230898, 0.30575249723121178, 0.98886901186760179, 0.60211469163098008], [0.004812431898059355, -0.67158566276763154, -0.18554254910322188, 0.64811312410943445], [0.22997105622251302, 0.11835539098936265, 0.8051190908659922, 0.63817634019129077]], [[0.84520047859214009, 0.25782980818567158, 0.013268176660491626, -0.33594843665530849], [0.97450335589680859, 0.69093768187104443, 0.60198834990491656, -0.18621134440879072], [0.83793237855262115, 0.68924996250989179, 0.43909589165101726, 0.80036365200337034]]], [[[0.06762289208374539, 0.60965867572354493, 0.85789932062393204, -0.42979286443903852], [0.80018980915321358, 0.3733743927355937, 0.4847674701588891, -0.6478071279090023], [0.92474942550438666, 0.88731416443351541, -0.68790225227442536, 0.8333730304177811]], [[0.75479445958320479, 0.20750517083663955, 0.84685381358684109, 0.66338214188449807], [-0.14225936952298301, 0.71081961187757159, -0.3548525982400359, 0.66203649107645157], [0.42110979033605678, 0.47593666296419634, 0.56826126103931318, 0.089739757320835167]]]]),self.functionspace) | |
24440 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24441 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24442 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24443 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24444 | def test_maximum_Symbol_rank0_expandedData_rank4(self): | |
24445 | arg0=Symbol(shape=()) | |
24446 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24447 | arg1=msk_arg1*numarray.array([[[[0.72453400015814773, 0.74968555354910205, 0.8864462807329363, -0.12876802818277633], [0.64036866843529117, 0.23169677841426406, -0.27490410632243645, 0.52995296066672637], [-0.23465182365842896, -0.15412558193730219, -0.77218295750237198, 0.85143952116619448]], [[-0.79604804377473992, 0.46234931443574956, 0.97015610088983983, -0.91555740188161483], [-0.9372279642794441, 0.73653887107290172, 0.31312323353269611, 0.24774753287309492], [-0.21436562878991916, -0.7379793369973604, 0.55165617866786709, -0.48025841889867382]]], [[[0.035086815901544499, -0.97968557903833964, 0.31741740083453585, 0.54396195668473357], [0.55497611231869826, 0.36509009344306453, 0.39845329246782635, 0.84456796768111664], [0.9632050535497847, -0.44559189726273463, 0.2853969566976482, -0.033412748200378095]], [[0.72262134138721423, 0.12862427339658367, -0.4447384602871618, 0.50148443724376679], [-0.57321307543500222, -0.50047778281013655, -0.41258254604157951, 0.23232139132588125], [0.82816332075151888, -0.26837013198422977, 0.29243538695633298, 0.33535389672240479]]], [[[-0.47838691303255509, -0.65502321532395213, -0.060413524045078715, 0.35595272059037475], [0.36754116633167322, -0.77596556004081929, -0.075032377463689404, -0.80441957648586815], [-0.66004735163369821, -0.71714608090292464, 0.086736521512553288, 0.83967553771133496]], [[0.32380435178041012, -0.45076176762655806, -0.66376594567140113, -0.97260810637511352], [-0.70002953550259828, 0.70218111817212181, 0.3916836054380437, -0.099288820926793475], [-0.22602506461069805, -0.31956317606771778, -0.21834314763125384, -0.5491632419972341]]]])+(1.-msk_arg1)*numarray.array([[[[-0.89455511489685757, 0.94599383179617269, -0.58100108642594273, 0.74289184873547831], [0.79825297278664165, 0.49488990645198694, -0.81805774319192337, 0.7723478579687284], [0.18720418817675766, -0.6973485780893558, -0.54851329989453057, 0.83060779510514626]], [[-0.24324518631955816, -0.39189601657073014, -0.41943664184408846, -0.16449107937419249], [0.43816203077572458, 0.10547053767896508, 0.76319682823895252, 0.97067330199334001], [0.20407509728020412, -0.050720884235648134, 0.03555023147139158, 0.88567082924827845]]], [[[-0.39965892542940051, 0.41687140772441889, -0.074958423452218481, -0.24937935512687437], [-0.51038725497925874, -0.69682476026124873, 0.48908614254851068, -0.54496539335394378], [-0.43259036138330997, -0.55392539318519085, 0.35042405862448756, -0.58066340287718909]], [[-0.54195724470367024, 0.60173079206236246, -0.91270254249214222, 0.88695387596924524], [-0.2177174630230041, -0.55124617487945526, -0.57352866746381581, -0.45536381236459023], [-0.20681805646616924, -0.7302209979352523, 0.38046946864336317, -0.48623067156976862]]], [[[-0.19057597861210906, 0.27329850884929718, -0.97321381433423815, -0.4382382110386509], [0.56177584764962507, 0.67326301723647863, -0.96143448952855937, 0.98748707230701482], [0.74667864479466339, 0.3402524282291004, -0.81662031017514014, 0.44794940107754022]], [[0.47828453909135282, -0.092501250116698186, 0.70462443973450162, 0.079988260487481755], [0.22084791725555908, -0.18427573695410504, 0.79639900215468074, -0.52192450099142129], [-0.86805278096187766, 0.80672822476952732, -0.69960387443364214, 0.24071506414240629]]]]) | |
24448 | res=maximum(arg0,arg1) | |
24449 | s0=numarray.array(0.603319875729) | |
24450 | sub=res.substitute({arg0:s0}) | |
24451 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24452 | ref=msk_ref*numarray.array([[[[0.72453400015814773, 0.74968555354910205, 0.8864462807329363, 0.6033198757288365], [0.64036866843529117, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365], [0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.85143952116619448]], [[0.6033198757288365, 0.6033198757288365, 0.97015610088983983, 0.6033198757288365], [0.6033198757288365, 0.73653887107290172, 0.6033198757288365, 0.6033198757288365], [0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365]]], [[[0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365], [0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.84456796768111664], [0.9632050535497847, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365]], [[0.72262134138721423, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365], [0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365], [0.82816332075151888, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365]]], [[[0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365], [0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365], [0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.83967553771133496]], [[0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365], [0.6033198757288365, 0.70218111817212181, 0.6033198757288365, 0.6033198757288365], [0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365]]]])+(1.-msk_ref)*numarray.array([[[[0.6033198757288365, 0.94599383179617269, 0.6033198757288365, 0.74289184873547831], [0.79825297278664165, 0.6033198757288365, 0.6033198757288365, 0.7723478579687284], [0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.83060779510514626]], [[0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365], [0.6033198757288365, 0.6033198757288365, 0.76319682823895252, 0.97067330199334001], [0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.88567082924827845]]], [[[0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365], [0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365], [0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365]], [[0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.88695387596924524], [0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365], [0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365]]], [[[0.6033198757288365, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365], [0.6033198757288365, 0.67326301723647863, 0.6033198757288365, 0.98748707230701482], [0.74667864479466339, 0.6033198757288365, 0.6033198757288365, 0.6033198757288365]], [[0.6033198757288365, 0.6033198757288365, 0.70462443973450162, 0.6033198757288365], [0.6033198757288365, 0.6033198757288365, 0.79639900215468074, 0.6033198757288365], [0.6033198757288365, 0.80672822476952732, 0.6033198757288365, 0.6033198757288365]]]]) | |
24453 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24454 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24455 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24456 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24457 | def test_maximum_Symbol_rank4_expandedData_rank4(self): | |
24458 | arg0=Symbol(shape=(3, 2, 3, 4)) | |
24459 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24460 | arg1=msk_arg1*numarray.array([[[[-0.05190996520507829, 0.017161612088801625, 0.71858473475896756, 0.37348553899634163], [-0.2900675205518739, 0.60854666978599803, 0.70397814254347901, 0.34729973841370732], [0.75952611874240916, -0.85817450277367535, -0.7317856056362293, -0.31052335974622758]], [[0.79398744563549517, 0.36998417255058302, -0.22929438181474016, 0.72966719351334763], [-0.23421902838943631, 0.52858124363614434, -0.34289297309725453, 0.4839966640935327], [0.89912158559629063, 0.19283434949277334, 0.6880794645896311, -0.50054360169032353]]], [[[-0.72502571574959829, 0.12262090113765312, -0.0020542239853444944, 0.91548118836692938], [0.78806292974921677, -0.81050708718107689, -0.4555499714123219, 0.20236859401508678], [-0.86916961516845492, -0.46273000223993566, -0.87145807505307871, -0.48884808814567582]], [[-0.28116992348313641, 0.94502678380907934, -0.34178232083148097, 0.494848074318752], [-0.49963099873167938, -0.38212305995515927, -0.90334447714176291, -0.027869624718332098], [-0.58406375150638778, 0.049953828057895722, 0.06288075173468588, 0.011374517234280956]]], [[[0.6313092846086179, -0.32934442397022878, -0.12082067268034402, -0.81517538889628494], [0.18194989025213792, 0.55938774982922723, -0.47438800760526822, -0.49610384574944866], [-0.19817862014855248, 0.49727611559501272, 0.65656919046343964, -0.90170978231220733]], [[-0.01430383255025669, -0.42392546084720828, -0.63408974934462714, 0.2297719414510393], [0.14518598570413488, -0.7593693018435812, 0.24665523827371505, 0.4227370985616663], [0.84731050064349067, 0.29891687014594681, 0.74229800688242542, -0.61146599162534176]]]])+(1.-msk_arg1)*numarray.array([[[[-0.12183245485334804, -0.72533881666320732, -0.095314628080340524, -0.96204587984036749], [0.81161246893894945, -0.41231517619150382, 0.81643004907183769, 0.64054743409630088], [0.28623669454789491, -0.11921417764493447, 0.77875292789103367, 0.83227612622879255]], [[0.94598610956808082, 0.31619246495167364, -0.50035233986323946, -0.60942345828654809], [0.8550308542962981, 0.60309493959946914, -0.62253263594962727, 0.099524057753801021], [0.065643405866520288, -0.51140342686979157, 0.2778463538429532, 0.099989530376729752]]], [[[-0.15734782977223682, 0.69843204704279982, 0.79456354791214867, 0.70614031560047175], [0.75846189691326282, -0.75135735449830965, 0.34566943333871936, 0.92376655153080911], [-0.67437646803837725, 0.31275498490118347, 0.99946206793939596, 0.44245904480217879]], [[-0.46126594617388528, -0.81725777487357232, 0.7882110144947998, -0.32610455746185063], [-0.2660914567173136, 0.38181156282466966, -0.48839127021344608, -0.1193962417619181], [0.56725512112085696, 0.83756894062445353, -0.57986804950752746, 0.41187912397027371]]], [[[0.23564342400826011, 0.72328665933702796, -0.84957020571644293, 0.47666051314019398], [-0.27886381132232452, 0.027580773383707458, 0.11851498214281264, 0.29752771163794023], [-0.33671436751098494, -0.032465399786591131, -0.92877668000088254, -0.31021658992823364]], [[-0.27500029514744329, 0.48538238289279523, -0.69495807540982768, 0.61839139559063661], [0.66670303573354928, 0.93605953311897627, -0.4262911110981098, 0.34502064198694971], [-0.88906028071393473, 0.23035782924474724, 0.63598579428315882, -0.84795750149192473]]]]) | |
24461 | res=maximum(arg0,arg1) | |
24462 | s0=numarray.array([[[[0.98325538221137898, -0.20186999833610031, 0.40857874358842761, -0.03668517494280743], [-0.74360096247307994, -0.90594758392189489, -0.93565726102554647, 0.14749657692620421], [0.83778447877286277, 0.0042404911944187162, -0.54558374198169668, 0.83393227278515081]], [[0.3861439064968375, 0.42073119766792422, -0.21121143187006264, 0.39579278884208868], [-0.073789476122656295, -0.94492877297639843, -0.088846534577811775, 0.28122228780170566], [0.83174417401553158, -0.30836633085770759, 0.93270177353542039, 0.17203339734052414]]], [[[0.0071722411065338054, -0.26670824412266647, -0.47151597155696856, 0.72438390893130444], [0.89834597644333214, 0.28086117009698075, 0.78702854436676284, -0.62291508588763289], [0.57885916508173674, -0.50880888737982843, 0.64618096057576913, -0.16496247850627377]], [[-0.66219205264588155, 0.71701284786986852, 0.11936010951822706, -0.37121227762466624], [0.61653883009191102, -0.21040229078419426, -0.17049828468535955, -0.77589529186195949], [0.24100195554851123, 0.79708451209204512, 0.9256059198368134, -0.71549478232361974]]], [[[0.058386909625657957, -0.63650298283992002, -0.86262180597088589, -0.67986038990692488], [0.61899027075381685, -0.34691779056299077, -0.94930033549704684, 0.20508395808553459], [-0.80551975631356143, 0.89331509581207391, 0.18099251426471263, -0.01524658111058308]], [[-0.79847150819719115, 0.09047607358432197, -0.63737569345251699, 0.43473428112791646], [0.78761887236842276, -0.20886021620156359, -0.27515812064151079, -0.80259839567017477], [-0.85468712569102934, 0.49900811497575015, -0.51677610308893063, -0.44832492704662719]]]]) | |
24463 | sub=res.substitute({arg0:s0}) | |
24464 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24465 | ref=msk_ref*numarray.array([[[[0.98325538221137898, 0.017161612088801625, 0.71858473475896756, 0.37348553899634163], [-0.2900675205518739, 0.60854666978599803, 0.70397814254347901, 0.34729973841370732], [0.83778447877286277, 0.0042404911944187162, -0.54558374198169668, 0.83393227278515081]], [[0.79398744563549517, 0.42073119766792422, -0.21121143187006264, 0.72966719351334763], [-0.073789476122656295, 0.52858124363614434, -0.088846534577811775, 0.4839966640935327], [0.89912158559629063, 0.19283434949277334, 0.93270177353542039, 0.17203339734052414]]], [[[0.0071722411065338054, 0.12262090113765312, -0.0020542239853444944, 0.91548118836692938], [0.89834597644333214, 0.28086117009698075, 0.78702854436676284, 0.20236859401508678], [0.57885916508173674, -0.46273000223993566, 0.64618096057576913, -0.16496247850627377]], [[-0.28116992348313641, 0.94502678380907934, 0.11936010951822706, 0.494848074318752], [0.61653883009191102, -0.21040229078419426, -0.17049828468535955, -0.027869624718332098], [0.24100195554851123, 0.79708451209204512, 0.9256059198368134, 0.011374517234280956]]], [[[0.6313092846086179, -0.32934442397022878, -0.12082067268034402, -0.67986038990692488], [0.61899027075381685, 0.55938774982922723, -0.47438800760526822, 0.20508395808553459], [-0.19817862014855248, 0.89331509581207391, 0.65656919046343964, -0.01524658111058308]], [[-0.01430383255025669, 0.09047607358432197, -0.63408974934462714, 0.43473428112791646], [0.78761887236842276, -0.20886021620156359, 0.24665523827371505, 0.4227370985616663], [0.84731050064349067, 0.49900811497575015, 0.74229800688242542, -0.44832492704662719]]]])+(1.-msk_ref)*numarray.array([[[[0.98325538221137898, -0.20186999833610031, 0.40857874358842761, -0.03668517494280743], [0.81161246893894945, -0.41231517619150382, 0.81643004907183769, 0.64054743409630088], [0.83778447877286277, 0.0042404911944187162, 0.77875292789103367, 0.83393227278515081]], [[0.94598610956808082, 0.42073119766792422, -0.21121143187006264, 0.39579278884208868], [0.8550308542962981, 0.60309493959946914, -0.088846534577811775, 0.28122228780170566], [0.83174417401553158, -0.30836633085770759, 0.93270177353542039, 0.17203339734052414]]], [[[0.0071722411065338054, 0.69843204704279982, 0.79456354791214867, 0.72438390893130444], [0.89834597644333214, 0.28086117009698075, 0.78702854436676284, 0.92376655153080911], [0.57885916508173674, 0.31275498490118347, 0.99946206793939596, 0.44245904480217879]], [[-0.46126594617388528, 0.71701284786986852, 0.7882110144947998, -0.32610455746185063], [0.61653883009191102, 0.38181156282466966, -0.17049828468535955, -0.1193962417619181], [0.56725512112085696, 0.83756894062445353, 0.9256059198368134, 0.41187912397027371]]], [[[0.23564342400826011, 0.72328665933702796, -0.84957020571644293, 0.47666051314019398], [0.61899027075381685, 0.027580773383707458, 0.11851498214281264, 0.29752771163794023], [-0.33671436751098494, 0.89331509581207391, 0.18099251426471263, -0.01524658111058308]], [[-0.27500029514744329, 0.48538238289279523, -0.63737569345251699, 0.61839139559063661], [0.78761887236842276, 0.93605953311897627, -0.27515812064151079, 0.34502064198694971], [-0.85468712569102934, 0.49900811497575015, 0.63598579428315882, -0.44832492704662719]]]]) | |
24466 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24467 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24468 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24469 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24470 | def test_maximum_constData_rank0_float_rank0(self): | |
24471 | arg0=Data(-0.103724211678,self.functionspace) | |
24472 | arg1=0.328283764361 | |
24473 | res=maximum(arg0,arg1) | |
24474 | ref=Data(0.328283764361,self.functionspace) | |
24475 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24476 | self.failUnlessEqual(res.getShape(),(),"wrong shape of result.") | |
24477 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24478 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24479 | def test_maximum_constData_rank1_float_rank0(self): | |
24480 | arg0=Data(numarray.array([-0.994662543839125, -0.74842601409030385]),self.functionspace) | |
24481 | arg1=0.83441404241 | |
24482 | res=maximum(arg0,arg1) | |
24483 | ref=Data(numarray.array([0.83441404241015316, 0.83441404241015316]),self.functionspace) | |
24484 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24485 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24486 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24487 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24488 | def test_maximum_constData_rank2_float_rank0(self): | |
24489 | arg0=Data(numarray.array([[-0.93123334581207584, -0.6375770434441641, 0.14522839584946268, -0.73025618312998342, -0.43938340547287202], [-0.94178326076177643, 0.37494459873539854, -0.41021077539181738, -0.20418492678279287, 0.66837201836494731], [-0.8482840255895383, -0.37013598496106792, 0.9491945264624071, -0.84517384298961939, -0.98444834611902565], [-0.62650653009151203, -0.80707547020964321, -0.54928564740444141, 0.62760912325779228, -0.068170353902772929]]),self.functionspace) | |
24490 | arg1=0.416476250509 | |
24491 | res=maximum(arg0,arg1) | |
24492 | ref=Data(numarray.array([[0.41647625050863057, 0.41647625050863057, 0.41647625050863057, 0.41647625050863057, 0.41647625050863057], [0.41647625050863057, 0.41647625050863057, 0.41647625050863057, 0.41647625050863057, 0.66837201836494731], [0.41647625050863057, 0.41647625050863057, 0.9491945264624071, 0.41647625050863057, 0.41647625050863057], [0.41647625050863057, 0.41647625050863057, 0.41647625050863057, 0.62760912325779228, 0.41647625050863057]]),self.functionspace) | |
24493 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24494 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24495 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24496 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24497 | def test_maximum_constData_rank3_float_rank0(self): | |
24498 | arg0=Data(numarray.array([[[-0.30986069585890852, -0.71233438667691962], [-0.71108485594464965, 0.46803401869143135]], [[0.047347209617666586, 0.40377859059535814], [-0.076869071518825383, 0.66840655201248778]], [[-0.73984483745703389, 0.15706212028006727], [-0.75038361207139048, 0.71534375261818672]], [[-0.16981297613502533, 0.95326334909603228], [-0.578228141354864, 0.69445686433215403]], [[0.85239986273571344, 0.70437733963137261], [-0.64356702754466366, 0.98497620890820303]], [[-0.73348032264680829, -0.90903872026049592], [-0.30876237687286801, 0.85358440828017468]]]),self.functionspace) | |
24499 | arg1=-0.707243668032 | |
24500 | res=maximum(arg0,arg1) | |
24501 | ref=Data(numarray.array([[[-0.30986069585890852, -0.70724366803240968], [-0.70724366803240968, 0.46803401869143135]], [[0.047347209617666586, 0.40377859059535814], [-0.076869071518825383, 0.66840655201248778]], [[-0.70724366803240968, 0.15706212028006727], [-0.70724366803240968, 0.71534375261818672]], [[-0.16981297613502533, 0.95326334909603228], [-0.578228141354864, 0.69445686433215403]], [[0.85239986273571344, 0.70437733963137261], [-0.64356702754466366, 0.98497620890820303]], [[-0.70724366803240968, -0.70724366803240968], [-0.30876237687286801, 0.85358440828017468]]]),self.functionspace) | |
24502 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24503 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24504 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24505 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24506 | def test_maximum_constData_rank4_float_rank0(self): | |
24507 | arg0=Data(numarray.array([[[[-0.44038422283869894, -0.99307493506995592, -0.64116938861589978, -0.52885072305198189], [-0.60664143188537656, -0.53692428608899201, 0.9427489146021919, -0.66511035190756762], [-0.95640611039066736, 0.98227091107399023, -0.35080572865502968, -0.062671325929018584]], [[-0.74010294573905111, -0.60760114920218666, 0.45863579037285751, -0.45688569472448681], [-0.33875049551517833, 0.35019781316828325, 0.45173979734058101, 0.8762043904815493], [-0.34188391703990084, 0.19998649935419754, -0.63879709781309413, 0.18545222105657011]]], [[[0.011754072910120206, -0.90550908100131511, -0.93322868838339446, -0.11741827984316866], [0.77558036495515026, -0.85219854425588326, -0.061841571000625484, -0.066269008250732009], [0.96157185984128013, -0.95342288705795242, 0.45172913312384599, 0.018267106882194906]], [[0.1591168098755007, -0.27340675847513096, -0.14469177879585371, 0.694740264377673], [-0.80538537088324014, 0.20415359879847728, -0.25347422230372807, -0.93986986572358044], [0.82523363323342358, 0.95118360314535688, -0.084226421580063437, 0.23148605050984217]]], [[[0.19213259368793234, 0.79589318105724693, -0.54294778796310839, -0.20471748468873829], [0.18053098336615636, -0.84012326762801948, -0.62575984457545952, -0.14368177341561639], [0.62597131428981112, 0.38509874618804685, 0.47371812469111485, -0.86705010549302908]], [[-0.36502653007689423, -0.79613146258086531, 0.15329391158627304, 0.68148041836662387], [0.73324139002880684, 0.38529515075962784, -0.9317611817520175, -0.6261241009923757], [0.80092298112981131, 0.34865093765311261, 0.89442927947537765, 0.92170715451548602]]]]),self.functionspace) | |
24508 | arg1=0.635778225458 | |
24509 | res=maximum(arg0,arg1) | |
24510 | ref=Data(numarray.array([[[[0.63577822545793317, 0.63577822545793317, 0.63577822545793317, 0.63577822545793317], [0.63577822545793317, 0.63577822545793317, 0.9427489146021919, 0.63577822545793317], [0.63577822545793317, 0.98227091107399023, 0.63577822545793317, 0.63577822545793317]], [[0.63577822545793317, 0.63577822545793317, 0.63577822545793317, 0.63577822545793317], [0.63577822545793317, 0.63577822545793317, 0.63577822545793317, 0.8762043904815493], [0.63577822545793317, 0.63577822545793317, 0.63577822545793317, 0.63577822545793317]]], [[[0.63577822545793317, 0.63577822545793317, 0.63577822545793317, 0.63577822545793317], [0.77558036495515026, 0.63577822545793317, 0.63577822545793317, 0.63577822545793317], [0.96157185984128013, 0.63577822545793317, 0.63577822545793317, 0.63577822545793317]], [[0.63577822545793317, 0.63577822545793317, 0.63577822545793317, 0.694740264377673], [0.63577822545793317, 0.63577822545793317, 0.63577822545793317, 0.63577822545793317], [0.82523363323342358, 0.95118360314535688, 0.63577822545793317, 0.63577822545793317]]], [[[0.63577822545793317, 0.79589318105724693, 0.63577822545793317, 0.63577822545793317], [0.63577822545793317, 0.63577822545793317, 0.63577822545793317, 0.63577822545793317], [0.63577822545793317, 0.63577822545793317, 0.63577822545793317, 0.63577822545793317]], [[0.63577822545793317, 0.63577822545793317, 0.63577822545793317, 0.68148041836662387], [0.73324139002880684, 0.63577822545793317, 0.63577822545793317, 0.63577822545793317], [0.80092298112981131, 0.63577822545793317, 0.89442927947537765, 0.92170715451548602]]]]),self.functionspace) | |
24511 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24512 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24513 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24514 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24515 | def test_maximum_constData_rank0_array_rank0(self): | |
24516 | arg0=Data(0.131131173778,self.functionspace) | |
24517 | arg1=numarray.array(-0.576805781524) | |
24518 | res=maximum(arg0,arg1) | |
24519 | ref=Data(0.131131173778,self.functionspace) | |
24520 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24521 | self.failUnlessEqual(res.getShape(),(),"wrong shape of result.") | |
24522 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24523 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24524 | def test_maximum_constData_rank1_array_rank0(self): | |
24525 | arg0=Data(numarray.array([0.14808740913781926, 0.35567967234737252]),self.functionspace) | |
24526 | arg1=numarray.array(-0.935584836565) | |
24527 | res=maximum(arg0,arg1) | |
24528 | ref=Data(numarray.array([0.14808740913781926, 0.35567967234737252]),self.functionspace) | |
24529 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24530 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24531 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24532 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24533 | def test_maximum_constData_rank2_array_rank0(self): | |
24534 | arg0=Data(numarray.array([[0.11219561462947825, -0.18427729976238316, -0.26893116897649416, 0.40378445902375137, -0.64010126735322159], [-0.54548479863007193, -0.6771466146796592, -0.65941588238170357, -0.080554716485880862, -0.51142929986801766], [0.1802163583855485, 0.4654264085214439, -0.88158680167000036, -0.67093289247607557, 0.47213709052956609], [-0.15939930729103469, -0.25730020832439515, -0.97874531075582616, 0.10703962128016098, 0.32041153354414065]]),self.functionspace) | |
24535 | arg1=numarray.array(0.896240426157) | |
24536 | res=maximum(arg0,arg1) | |
24537 | ref=Data(numarray.array([[0.89624042615692456, 0.89624042615692456, 0.89624042615692456, 0.89624042615692456, 0.89624042615692456], [0.89624042615692456, 0.89624042615692456, 0.89624042615692456, 0.89624042615692456, 0.89624042615692456], [0.89624042615692456, 0.89624042615692456, 0.89624042615692456, 0.89624042615692456, 0.89624042615692456], [0.89624042615692456, 0.89624042615692456, 0.89624042615692456, 0.89624042615692456, 0.89624042615692456]]),self.functionspace) | |
24538 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24539 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24540 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24541 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24542 | def test_maximum_constData_rank3_array_rank0(self): | |
24543 | arg0=Data(numarray.array([[[0.11547252472671099, 0.27715619160036087], [-0.0011872311418676951, -0.38096891774653074]], [[0.37877267210850607, -0.8255429528666729], [-0.63956098319827714, -0.70194003551721074]], [[0.44309695940748495, -0.88721518381663578], [-0.53272604278013991, 0.79625941492663554]], [[-0.1703558707341577, -0.95114537821544309], [-0.32281622748150207, 0.31750595998728737]], [[0.30447422840521154, -0.82721331108465446], [0.65676818386047175, 0.40338692981661328]], [[0.39404755664916813, -0.78343567350875953], [-0.30036954834309015, -0.83068548144181831]]]),self.functionspace) | |
24544 | arg1=numarray.array(0.597874377242) | |
24545 | res=maximum(arg0,arg1) | |
24546 | ref=Data(numarray.array([[[0.59787437724227765, 0.59787437724227765], [0.59787437724227765, 0.59787437724227765]], [[0.59787437724227765, 0.59787437724227765], [0.59787437724227765, 0.59787437724227765]], [[0.59787437724227765, 0.59787437724227765], [0.59787437724227765, 0.79625941492663554]], [[0.59787437724227765, 0.59787437724227765], [0.59787437724227765, 0.59787437724227765]], [[0.59787437724227765, 0.59787437724227765], [0.65676818386047175, 0.59787437724227765]], [[0.59787437724227765, 0.59787437724227765], [0.59787437724227765, 0.59787437724227765]]]),self.functionspace) | |
24547 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24548 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24549 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24550 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24551 | def test_maximum_constData_rank4_array_rank0(self): | |
24552 | arg0=Data(numarray.array([[[[-0.12333178650474741, -0.41601255505495294, 0.78421542610699757, -0.89389135345287363], [-0.89386090823390885, 0.56081437970269388, -0.39255299041023939, 0.32411039481285564], [0.8551210553300661, -0.90707027924543415, 0.16036883016043224, -0.10713182442360014]], [[0.62413380378897632, -0.33807365498251962, -0.14322028563106537, -0.28390387123110661], [0.10848574295659086, -0.3237100322279467, 0.40626470900918554, -0.86322529775615497], [-0.53241603186354824, 0.96450022170256, 0.7410412312711554, -0.90628249882883471]]], [[[0.56961012500639319, 0.46258567990715616, 0.2691574282574225, -0.70084123183330149], [0.32178078403959587, -0.16491236638222273, -0.67544384124087165, 0.49044876181851271], [0.87426425567196486, 0.99113280536628512, -0.33592835344070004, -0.48167757670424649]], [[0.37582959179360564, 0.079659313583228863, 0.13142551769766975, -0.50982437173132999], [-0.80549764829567927, -0.99459313338638555, -0.24095207228821169, -0.91245577244012499], [0.36688639267496503, 0.20893052084134811, -0.95250384603251925, -0.46421785538004756]]], [[[-0.69408638083069896, -0.60590039199066448, 0.65199154172599783, 0.5600386130626831], [-0.45945308229643844, -0.33990278016795927, -0.12156326670116702, 0.76710181803628164], [-0.30308185765731799, -0.47607829009357494, -0.66299346892125444, 0.85153168985207617]], [[0.97196327159277796, -0.76370007931813078, 0.50139581647673981, 0.63066011940195899], [-0.98705858372661903, 0.30251550651882297, -0.12436255937028684, 0.47348321672077809], [-0.11280446521491339, 0.3669717233616796, -0.58417675366941624, -0.8354338127149179]]]]),self.functionspace) | |
24553 | arg1=numarray.array(-0.987163870919) | |
24554 | res=maximum(arg0,arg1) | |
24555 | ref=Data(numarray.array([[[[-0.12333178650474741, -0.41601255505495294, 0.78421542610699757, -0.89389135345287363], [-0.89386090823390885, 0.56081437970269388, -0.39255299041023939, 0.32411039481285564], [0.8551210553300661, -0.90707027924543415, 0.16036883016043224, -0.10713182442360014]], [[0.62413380378897632, -0.33807365498251962, -0.14322028563106537, -0.28390387123110661], [0.10848574295659086, -0.3237100322279467, 0.40626470900918554, -0.86322529775615497], [-0.53241603186354824, 0.96450022170256, 0.7410412312711554, -0.90628249882883471]]], [[[0.56961012500639319, 0.46258567990715616, 0.2691574282574225, -0.70084123183330149], [0.32178078403959587, -0.16491236638222273, -0.67544384124087165, 0.49044876181851271], [0.87426425567196486, 0.99113280536628512, -0.33592835344070004, -0.48167757670424649]], [[0.37582959179360564, 0.079659313583228863, 0.13142551769766975, -0.50982437173132999], [-0.80549764829567927, -0.98716387091897451, -0.24095207228821169, -0.91245577244012499], [0.36688639267496503, 0.20893052084134811, -0.95250384603251925, -0.46421785538004756]]], [[[-0.69408638083069896, -0.60590039199066448, 0.65199154172599783, 0.5600386130626831], [-0.45945308229643844, -0.33990278016795927, -0.12156326670116702, 0.76710181803628164], [-0.30308185765731799, -0.47607829009357494, -0.66299346892125444, 0.85153168985207617]], [[0.97196327159277796, -0.76370007931813078, 0.50139581647673981, 0.63066011940195899], [-0.98705858372661903, 0.30251550651882297, -0.12436255937028684, 0.47348321672077809], [-0.11280446521491339, 0.3669717233616796, -0.58417675366941624, -0.8354338127149179]]]]),self.functionspace) | |
24556 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24557 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24558 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24559 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24560 | def test_maximum_constData_rank0_Symbol_rank0(self): | |
24561 | arg0=Data(0.664561779083,self.functionspace) | |
24562 | arg1=Symbol(shape=()) | |
24563 | res=maximum(arg0,arg1) | |
24564 | s1=numarray.array(0.829285050023) | |
24565 | sub=res.substitute({arg1:s1}) | |
24566 | ref=Data(0.829285050023,self.functionspace) | |
24567 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24568 | self.failUnlessEqual(res.getShape(),(),"wrong shape of result.") | |
24569 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24570 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24571 | def test_maximum_constData_rank1_Symbol_rank0(self): | |
24572 | arg0=Data(numarray.array([-0.69545419737927117, 0.99305327855079217]),self.functionspace) | |
24573 | arg1=Symbol(shape=()) | |
24574 | res=maximum(arg0,arg1) | |
24575 | s1=numarray.array(0.153020727326) | |
24576 | sub=res.substitute({arg1:s1}) | |
24577 | ref=Data(numarray.array([0.15302072732624339, 0.99305327855079217]),self.functionspace) | |
24578 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24579 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24580 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24581 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24582 | def test_maximum_constData_rank2_Symbol_rank0(self): | |
24583 | arg0=Data(numarray.array([[-0.59374607886600006, -0.50931590206448885, 0.87158812528115992, -0.083248463579309817, 0.64675557959416596], [-0.99510993900114997, -0.86534619373808885, -0.76055600732404205, -0.32388592463644716, 0.48179608280482089], [-0.0189717949163144, 0.53343311709904495, -0.01695952592096317, -0.14275237095244719, -0.56878877627022906], [-0.66684442729332871, 0.90441290480400194, -0.95338552917045272, -0.19153791835347533, 0.26360673254102074]]),self.functionspace) | |
24584 | arg1=Symbol(shape=()) | |
24585 | res=maximum(arg0,arg1) | |
24586 | s1=numarray.array(0.32156239679) | |
24587 | sub=res.substitute({arg1:s1}) | |
24588 | ref=Data(numarray.array([[0.3215623967904031, 0.3215623967904031, 0.87158812528115992, 0.3215623967904031, 0.64675557959416596], [0.3215623967904031, 0.3215623967904031, 0.3215623967904031, 0.3215623967904031, 0.48179608280482089], [0.3215623967904031, 0.53343311709904495, 0.3215623967904031, 0.3215623967904031, 0.3215623967904031], [0.3215623967904031, 0.90441290480400194, 0.3215623967904031, 0.3215623967904031, 0.3215623967904031]]),self.functionspace) | |
24589 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24590 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24591 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24592 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24593 | def test_maximum_constData_rank3_Symbol_rank0(self): | |
24594 | arg0=Data(numarray.array([[[-0.63408955961464142, -0.76118818542823696], [-0.0029784442754923202, 0.54432467407787422]], [[-0.64191739678302429, 0.067130805893673484], [-0.19665248598291529, 0.1328475859290037]], [[-0.56971462838064468, 0.51091249756472101], [-0.47226268148108841, 0.63794524003575748]], [[0.55245668688973337, -0.63810367804480395], [0.74612529134962369, -0.17481247619555695]], [[0.025673774490274193, 0.10960736160784612], [-0.76951823716646683, 0.13670394008645115]], [[0.67172421750357691, -0.40880035103301604], [0.79132642447949686, 0.72197872430428278]]]),self.functionspace) | |
24595 | arg1=Symbol(shape=()) | |
24596 | res=maximum(arg0,arg1) | |
24597 | s1=numarray.array(-0.186648816909) | |
24598 | sub=res.substitute({arg1:s1}) | |
24599 | ref=Data(numarray.array([[[-0.18664881690900659, -0.18664881690900659], [-0.0029784442754923202, 0.54432467407787422]], [[-0.18664881690900659, 0.067130805893673484], [-0.18664881690900659, 0.1328475859290037]], [[-0.18664881690900659, 0.51091249756472101], [-0.18664881690900659, 0.63794524003575748]], [[0.55245668688973337, -0.18664881690900659], [0.74612529134962369, -0.17481247619555695]], [[0.025673774490274193, 0.10960736160784612], [-0.18664881690900659, 0.13670394008645115]], [[0.67172421750357691, -0.18664881690900659], [0.79132642447949686, 0.72197872430428278]]]),self.functionspace) | |
24600 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24601 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24602 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24603 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24604 | def test_maximum_constData_rank4_Symbol_rank0(self): | |
24605 | arg0=Data(numarray.array([[[[0.11691606484743811, -0.18910207642141397, -0.97467407734233369, 0.54785995546527189], [0.94659765351248715, -0.50895768482469506, 0.75673961085640173, 0.81000722351354781], [0.12962517455334921, -0.078976357655154539, -0.63070660955667046, 0.38159785488013642]], [[-0.02403526270024936, -0.1723643289467176, -0.52475964505263439, -0.90347327300706604], [-0.64581611506488201, 0.49661549530917881, -0.94000053808660566, -0.35771609596682397], [-0.78621989863997332, 0.020741795385072592, -0.44360981567644231, 0.22226902471522392]]], [[[-0.038463812991184509, -0.4099796075013018, -0.43560481702467024, -0.81522019261561196], [-0.16899899767684734, -0.83049119482277756, -0.92056631424361623, -0.37390489621232259], [0.072983530166874866, 0.1831674166669639, -0.85469662452253403, -0.29142005064818877]], [[-0.9144023718274068, 0.6401005232965018, -0.86961613870225341, -0.61116440564734287], [0.60983911653939904, -0.58546568971594759, -0.074285422547206714, 0.021363661195166195], [0.00850205556137551, 0.58012942485722929, -0.13639426106487806, -0.13725955595150907]]], [[[0.48995477809263677, -0.85159004979717401, 0.57236937634099427, 0.96218992321882535], [-0.41176815588149163, 0.51666573976104435, -0.56806312709864182, -0.22610154639166402], [-0.9520160415423875, 0.884347925828179, 0.13363791828118421, 0.11169377706342409]], [[0.72525326379313837, -0.65913525904766379, 0.18068049451919643, 0.85369735995883933], [-0.64521176966868765, -0.23404065953506392, 0.026544508868687089, 0.083906169344088344], [-0.020672344041770652, -0.9841740747373513, -0.99849728600899912, -0.28628548061458803]]]]),self.functionspace) | |
24606 | arg1=Symbol(shape=()) | |
24607 | res=maximum(arg0,arg1) | |
24608 | s1=numarray.array(-0.400014368083) | |
24609 | sub=res.substitute({arg1:s1}) | |
24610 | ref=Data(numarray.array([[[[0.11691606484743811, -0.18910207642141397, -0.40001436808308521, 0.54785995546527189], [0.94659765351248715, -0.40001436808308521, 0.75673961085640173, 0.81000722351354781], [0.12962517455334921, -0.078976357655154539, -0.40001436808308521, 0.38159785488013642]], [[-0.02403526270024936, -0.1723643289467176, -0.40001436808308521, -0.40001436808308521], [-0.40001436808308521, 0.49661549530917881, -0.40001436808308521, -0.35771609596682397], [-0.40001436808308521, 0.020741795385072592, -0.40001436808308521, 0.22226902471522392]]], [[[-0.038463812991184509, -0.40001436808308521, -0.40001436808308521, -0.40001436808308521], [-0.16899899767684734, -0.40001436808308521, -0.40001436808308521, -0.37390489621232259], [0.072983530166874866, 0.1831674166669639, -0.40001436808308521, -0.29142005064818877]], [[-0.40001436808308521, 0.6401005232965018, -0.40001436808308521, -0.40001436808308521], [0.60983911653939904, -0.40001436808308521, -0.074285422547206714, 0.021363661195166195], [0.00850205556137551, 0.58012942485722929, -0.13639426106487806, -0.13725955595150907]]], [[[0.48995477809263677, -0.40001436808308521, 0.57236937634099427, 0.96218992321882535], [-0.40001436808308521, 0.51666573976104435, -0.40001436808308521, -0.22610154639166402], [-0.40001436808308521, 0.884347925828179, 0.13363791828118421, 0.11169377706342409]], [[0.72525326379313837, -0.40001436808308521, 0.18068049451919643, 0.85369735995883933], [-0.40001436808308521, -0.23404065953506392, 0.026544508868687089, 0.083906169344088344], [-0.020672344041770652, -0.40001436808308521, -0.40001436808308521, -0.28628548061458803]]]]),self.functionspace) | |
24611 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24612 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24613 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24614 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24615 | def test_maximum_constData_rank0_constData_rank0(self): | |
24616 | arg0=Data(0.585764561052,self.functionspace) | |
24617 | arg1=Data(0.562102768003,self.functionspace) | |
24618 | res=maximum(arg0,arg1) | |
24619 | ref=Data(0.585764561052,self.functionspace) | |
24620 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24621 | self.failUnlessEqual(res.getShape(),(),"wrong shape of result.") | |
24622 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24623 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24624 | def test_maximum_constData_rank1_constData_rank0(self): | |
24625 | arg0=Data(numarray.array([0.36817249063478297, 0.84922379654348235]),self.functionspace) | |
24626 | arg1=Data(-0.000326831113467,self.functionspace) | |
24627 | res=maximum(arg0,arg1) | |
24628 | ref=Data(numarray.array([0.36817249063478297, 0.84922379654348235]),self.functionspace) | |
24629 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24630 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24631 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24632 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24633 | def test_maximum_constData_rank2_constData_rank0(self): | |
24634 | arg0=Data(numarray.array([[0.62061167912589932, -0.38731372384862972, -0.095757334081436607, -0.71510399904747191, -0.7960986251434321], [-0.62309855289829441, -0.87302083840022671, 0.19339618209313958, -0.46839248025963864, -0.50779431412333742], [-0.21582349308100612, 0.38788705235820564, 0.013156532615211658, 0.48974126868597168, -0.8747876083639794], [-0.03351051938462235, -0.01330223402014763, 0.41055032605572195, -0.83673851035555735, 0.75259533240721854]]),self.functionspace) | |
24635 | arg1=Data(0.834120422885,self.functionspace) | |
24636 | res=maximum(arg0,arg1) | |
24637 | ref=Data(numarray.array([[0.8341204228848349, 0.8341204228848349, 0.8341204228848349, 0.8341204228848349, 0.8341204228848349], [0.8341204228848349, 0.8341204228848349, 0.8341204228848349, 0.8341204228848349, 0.8341204228848349], [0.8341204228848349, 0.8341204228848349, 0.8341204228848349, 0.8341204228848349, 0.8341204228848349], [0.8341204228848349, 0.8341204228848349, 0.8341204228848349, 0.8341204228848349, 0.8341204228848349]]),self.functionspace) | |
24638 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24639 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24640 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24641 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24642 | def test_maximum_constData_rank3_constData_rank0(self): | |
24643 | arg0=Data(numarray.array([[[-0.34639348942196935, 0.54454548312732642], [0.54767137350158723, -0.1261592719343172]], [[0.50901738204046398, -0.84585881665715412], [-0.13374339923115808, -0.2770246163740675]], [[-0.54418624743208754, 0.12594979383328964], [0.36093139391063178, 0.82920727027033436]], [[0.27913464865114546, 0.80222365962388098], [0.20763542419244296, 0.90359922967678674]], [[0.84504710858705456, 0.65071402913489296], [-0.38961429927310487, -0.71287474316420352]], [[0.21051157156997924, 0.12062151771734198], [0.15420074047028498, -0.77490659965239894]]]),self.functionspace) | |
24644 | arg1=Data(-0.719008102783,self.functionspace) | |
24645 | res=maximum(arg0,arg1) | |
24646 | ref=Data(numarray.array([[[-0.34639348942196935, 0.54454548312732642], [0.54767137350158723, -0.1261592719343172]], [[0.50901738204046398, -0.71900810278299088], [-0.13374339923115808, -0.2770246163740675]], [[-0.54418624743208754, 0.12594979383328964], [0.36093139391063178, 0.82920727027033436]], [[0.27913464865114546, 0.80222365962388098], [0.20763542419244296, 0.90359922967678674]], [[0.84504710858705456, 0.65071402913489296], [-0.38961429927310487, -0.71287474316420352]], [[0.21051157156997924, 0.12062151771734198], [0.15420074047028498, -0.71900810278299088]]]),self.functionspace) | |
24647 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24648 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24649 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24650 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24651 | def test_maximum_constData_rank4_constData_rank0(self): | |
24652 | arg0=Data(numarray.array([[[[0.24615935787720122, -0.78756263814918848, 0.14312411275206283, -0.61209069712580444], [0.66751834472618388, -0.97270217915095181, 0.44734491429921719, 0.56094524052401296], [-0.52616981543309271, -0.59090561139819875, 0.72854643636544969, 0.28084180850612128]], [[-0.13831139862668707, -0.41869220979295729, 0.45665100088168176, -0.17425379986376388], [-0.71060410977750221, -0.23490189062085109, 0.55707427536980814, -0.47235867785724728], [-0.7825415636663855, -0.50535912385584014, 0.18080270846310542, 0.81347475179814932]]], [[[0.11676945660942573, 0.0090598274192139616, -0.45702967566484753, 0.10306553976340282], [0.99323093060600787, 0.29434293524837996, 0.54768497876439315, 0.64082304875839924], [0.11154113644780606, -0.92134481397307355, 0.47282662127503539, 0.88748076184699709]], [[0.22357060873765233, -0.64706904541581722, 0.19015911386848727, -0.17771475973870299], [0.26760950005587758, 0.53275086600982924, -0.67459888863079587, -0.47669911211071847], [0.13841053267986525, -0.55447231310576828, -0.60380591334225908, 0.45443682452695322]]], [[[0.90802807850631129, 0.5777144475067848, 0.29643536414101779, -0.70268788049900732], [-0.40417344419730084, 0.60820239131834386, 0.98877684418314415, 0.02773308630434923], [-0.99593792390185087, -0.99197717949359321, -0.57269874716477709, 0.23365613209137837]], [[0.74741771939310353, -0.57587639566704985, 0.74979270157039379, 0.88416116732103767], [0.3503774673176725, 0.4043599318959008, 0.92900873297982289, -0.060730954440895157], [-0.82062848810850908, 0.36166456925688828, -0.98165811447801321, 0.10663254098157515]]]]),self.functionspace) | |
24653 | arg1=Data(-0.218709768625,self.functionspace) | |
24654 | res=maximum(arg0,arg1) | |
24655 | ref=Data(numarray.array([[[[0.24615935787720122, -0.21870976862466218, 0.14312411275206283, -0.21870976862466218], [0.66751834472618388, -0.21870976862466218, 0.44734491429921719, 0.56094524052401296], [-0.21870976862466218, -0.21870976862466218, 0.72854643636544969, 0.28084180850612128]], [[-0.13831139862668707, -0.21870976862466218, 0.45665100088168176, -0.17425379986376388], [-0.21870976862466218, -0.21870976862466218, 0.55707427536980814, -0.21870976862466218], [-0.21870976862466218, -0.21870976862466218, 0.18080270846310542, 0.81347475179814932]]], [[[0.11676945660942573, 0.0090598274192139616, -0.21870976862466218, 0.10306553976340282], [0.99323093060600787, 0.29434293524837996, 0.54768497876439315, 0.64082304875839924], [0.11154113644780606, -0.21870976862466218, 0.47282662127503539, 0.88748076184699709]], [[0.22357060873765233, -0.21870976862466218, 0.19015911386848727, -0.17771475973870299], [0.26760950005587758, 0.53275086600982924, -0.21870976862466218, -0.21870976862466218], [0.13841053267986525, -0.21870976862466218, -0.21870976862466218, 0.45443682452695322]]], [[[0.90802807850631129, 0.5777144475067848, 0.29643536414101779, -0.21870976862466218], [-0.21870976862466218, 0.60820239131834386, 0.98877684418314415, 0.02773308630434923], [-0.21870976862466218, -0.21870976862466218, -0.21870976862466218, 0.23365613209137837]], [[0.74741771939310353, -0.21870976862466218, 0.74979270157039379, 0.88416116732103767], [0.3503774673176725, 0.4043599318959008, 0.92900873297982289, -0.060730954440895157], [-0.21870976862466218, 0.36166456925688828, -0.21870976862466218, 0.10663254098157515]]]]),self.functionspace) | |
24656 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24657 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24658 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24659 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24660 | def test_maximum_constData_rank0_expandedData_rank0(self): | |
24661 | arg0=Data(-0.0924750298109,self.functionspace) | |
24662 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24663 | arg1=msk_arg1*(0.719276974378)+(1.-msk_arg1)*(-0.901780055402) | |
24664 | res=maximum(arg0,arg1) | |
24665 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24666 | ref=msk_ref*(0.719276974378)+(1.-msk_ref)*(-0.0924750298109) | |
24667 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24668 | self.failUnlessEqual(res.getShape(),(),"wrong shape of result.") | |
24669 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24670 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24671 | def test_maximum_constData_rank1_expandedData_rank0(self): | |
24672 | arg0=Data(numarray.array([0.19003810057983306, 0.86747179360557602]),self.functionspace) | |
24673 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24674 | arg1=msk_arg1*(-0.979758050952)+(1.-msk_arg1)*(0.498784837635) | |
24675 | res=maximum(arg0,arg1) | |
24676 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24677 | ref=msk_ref*numarray.array([0.19003810057983306, 0.86747179360557602])+(1.-msk_ref)*numarray.array([0.49878483763491466, 0.86747179360557602]) | |
24678 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24679 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24680 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24681 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24682 | def test_maximum_constData_rank2_expandedData_rank0(self): | |
24683 | arg0=Data(numarray.array([[-0.21116738853853634, 0.39376908967419455, -0.90448828983244067, 0.39775680151484716, -0.62546967898667782], [0.71684884432650064, -0.2950221732323155, 0.061549355711304932, 0.92168965316615159, 0.54752726203495428], [-0.12485263858702367, 0.16626287261463624, -0.79329781788494325, -0.22207097268419607, 0.19795438035557633], [0.76599397431182026, 0.56414018544113698, 0.95805026779533731, -0.69615823883217742, 0.21821142022539242]]),self.functionspace) | |
24684 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24685 | arg1=msk_arg1*(-0.243791427144)+(1.-msk_arg1)*(-0.440291613911) | |
24686 | res=maximum(arg0,arg1) | |
24687 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24688 | ref=msk_ref*numarray.array([[-0.21116738853853634, 0.39376908967419455, -0.24379142714392676, 0.39775680151484716, -0.24379142714392676], [0.71684884432650064, -0.24379142714392676, 0.061549355711304932, 0.92168965316615159, 0.54752726203495428], [-0.12485263858702367, 0.16626287261463624, -0.24379142714392676, -0.22207097268419607, 0.19795438035557633], [0.76599397431182026, 0.56414018544113698, 0.95805026779533731, -0.24379142714392676, 0.21821142022539242]])+(1.-msk_ref)*numarray.array([[-0.21116738853853634, 0.39376908967419455, -0.44029161391063454, 0.39775680151484716, -0.44029161391063454], [0.71684884432650064, -0.2950221732323155, 0.061549355711304932, 0.92168965316615159, 0.54752726203495428], [-0.12485263858702367, 0.16626287261463624, -0.44029161391063454, -0.22207097268419607, 0.19795438035557633], [0.76599397431182026, 0.56414018544113698, 0.95805026779533731, -0.44029161391063454, 0.21821142022539242]]) | |
24689 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24690 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24691 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24692 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24693 | def test_maximum_constData_rank3_expandedData_rank0(self): | |
24694 | arg0=Data(numarray.array([[[0.71382052722853828, 0.59639246293382753], [0.79091055029858603, 0.6098069915009563]], [[-0.81877756445176075, -0.12572711561586747], [0.6629503717900096, 0.088668188470614639]], [[-0.25907968164793926, 0.078844106245125056], [0.53171494813158082, -0.48562454486265927]], [[-0.16221141560120533, -0.22108938742601714], [-0.19849691519790702, 0.1366342465866397]], [[0.97032753659399651, 0.10811990970766572], [-0.53083812183678813, 0.48681350528164535]], [[0.94501075888711217, 0.15734516046100699], [0.67336660412428007, 0.54871928770743117]]]),self.functionspace) | |
24695 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24696 | arg1=msk_arg1*(0.154574403253)+(1.-msk_arg1)*(0.444360735115) | |
24697 | res=maximum(arg0,arg1) | |
24698 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24699 | ref=msk_ref*numarray.array([[[0.71382052722853828, 0.59639246293382753], [0.79091055029858603, 0.6098069915009563]], [[0.15457440325278737, 0.15457440325278737], [0.6629503717900096, 0.15457440325278737]], [[0.15457440325278737, 0.15457440325278737], [0.53171494813158082, 0.15457440325278737]], [[0.15457440325278737, 0.15457440325278737], [0.15457440325278737, 0.15457440325278737]], [[0.97032753659399651, 0.15457440325278737], [0.15457440325278737, 0.48681350528164535]], [[0.94501075888711217, 0.15734516046100699], [0.67336660412428007, 0.54871928770743117]]])+(1.-msk_ref)*numarray.array([[[0.71382052722853828, 0.59639246293382753], [0.79091055029858603, 0.6098069915009563]], [[0.4443607351150709, 0.4443607351150709], [0.6629503717900096, 0.4443607351150709]], [[0.4443607351150709, 0.4443607351150709], [0.53171494813158082, 0.4443607351150709]], [[0.4443607351150709, 0.4443607351150709], [0.4443607351150709, 0.4443607351150709]], [[0.97032753659399651, 0.4443607351150709], [0.4443607351150709, 0.48681350528164535]], [[0.94501075888711217, 0.4443607351150709], [0.67336660412428007, 0.54871928770743117]]]) | |
24700 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24701 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24702 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24703 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24704 | def test_maximum_constData_rank4_expandedData_rank0(self): | |
24705 | arg0=Data(numarray.array([[[[0.17987454394191782, -0.47366581235947391, 0.57343836836209627, -0.38076754396458123], [0.57156205056895448, 0.22221196833792156, -0.63457115192030189, -0.90743873572672884], [0.50190781994193601, -0.72382204778829151, -0.16048375541143778, 0.24666469799623414]], [[0.1797380572435916, 0.16543463798169644, -0.38942568372144026, -0.60094923326812366], [0.58369106606630172, -0.72979782894371525, -0.71685913494409648, -0.43487862431086666], [0.94570907221553924, -0.71041646506714295, -0.57201057001577316, -0.27780439634546106]]], [[[0.21885917868948757, 0.691429511541092, -0.86074155940358898, -0.74572948424544871], [-0.67104106531707486, 0.65026368776100796, -0.77242606184409479, -0.17309140373321386], [-0.71424293657762106, 0.0160043137660697, -0.86608565479945288, 0.21568143007726359]], [[0.17793601295093553, 0.8241368231005648, -0.56689484436349358, -0.64591475368907791], [-0.83488920100836284, 0.89807531811166474, 0.12481763857472217, 0.19555968134032309], [0.90280696977547814, -0.3114337513979637, -0.4016548633642858, 0.84998160623596397]]], [[[-0.41113212039641711, 0.69589842214715314, 0.40122617777186043, 0.66162309921520612], [-0.64259349002452848, -0.61545179085033141, 0.35720959723129897, -0.74561290819100612], [0.25049896732519583, -0.84957718142891347, -0.69000881268819692, 0.55532528673635673]], [[0.65030548208217898, 0.61753581199201957, 0.55386412523479889, -0.59819873675646185], [0.59881331123370507, -0.73382421864055347, -0.25155846699294737, -0.83893004279709227], [-0.68286287600890794, -0.029611557116543841, 0.092485711989719332, 0.54588443381266383]]]]),self.functionspace) | |
24706 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24707 | arg1=msk_arg1*(-0.647690225694)+(1.-msk_arg1)*(-0.116678653334) | |
24708 | res=maximum(arg0,arg1) | |
24709 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24710 | ref=msk_ref*numarray.array([[[[0.17987454394191782, -0.47366581235947391, 0.57343836836209627, -0.38076754396458123], [0.57156205056895448, 0.22221196833792156, -0.63457115192030189, -0.64769022569387036], [0.50190781994193601, -0.64769022569387036, -0.16048375541143778, 0.24666469799623414]], [[0.1797380572435916, 0.16543463798169644, -0.38942568372144026, -0.60094923326812366], [0.58369106606630172, -0.64769022569387036, -0.64769022569387036, -0.43487862431086666], [0.94570907221553924, -0.64769022569387036, -0.57201057001577316, -0.27780439634546106]]], [[[0.21885917868948757, 0.691429511541092, -0.64769022569387036, -0.64769022569387036], [-0.64769022569387036, 0.65026368776100796, -0.64769022569387036, -0.17309140373321386], [-0.64769022569387036, 0.0160043137660697, -0.64769022569387036, 0.21568143007726359]], [[0.17793601295093553, 0.8241368231005648, -0.56689484436349358, -0.64591475368907791], [-0.64769022569387036, 0.89807531811166474, 0.12481763857472217, 0.19555968134032309], [0.90280696977547814, -0.3114337513979637, -0.4016548633642858, 0.84998160623596397]]], [[[-0.41113212039641711, 0.69589842214715314, 0.40122617777186043, 0.66162309921520612], [-0.64259349002452848, -0.61545179085033141, 0.35720959723129897, -0.64769022569387036], [0.25049896732519583, -0.64769022569387036, -0.64769022569387036, 0.55532528673635673]], [[0.65030548208217898, 0.61753581199201957, 0.55386412523479889, -0.59819873675646185], [0.59881331123370507, -0.64769022569387036, -0.25155846699294737, -0.64769022569387036], [-0.64769022569387036, -0.029611557116543841, 0.092485711989719332, 0.54588443381266383]]]])+(1.-msk_ref)*numarray.array([[[[0.17987454394191782, -0.11667865333375405, 0.57343836836209627, -0.11667865333375405], [0.57156205056895448, 0.22221196833792156, -0.11667865333375405, -0.11667865333375405], [0.50190781994193601, -0.11667865333375405, -0.11667865333375405, 0.24666469799623414]], [[0.1797380572435916, 0.16543463798169644, -0.11667865333375405, -0.11667865333375405], [0.58369106606630172, -0.11667865333375405, -0.11667865333375405, -0.11667865333375405], [0.94570907221553924, -0.11667865333375405, -0.11667865333375405, -0.11667865333375405]]], [[[0.21885917868948757, 0.691429511541092, -0.11667865333375405, -0.11667865333375405], [-0.11667865333375405, 0.65026368776100796, -0.11667865333375405, -0.11667865333375405], [-0.11667865333375405, 0.0160043137660697, -0.11667865333375405, 0.21568143007726359]], [[0.17793601295093553, 0.8241368231005648, -0.11667865333375405, -0.11667865333375405], [-0.11667865333375405, 0.89807531811166474, 0.12481763857472217, 0.19555968134032309], [0.90280696977547814, -0.11667865333375405, -0.11667865333375405, 0.84998160623596397]]], [[[-0.11667865333375405, 0.69589842214715314, 0.40122617777186043, 0.66162309921520612], [-0.11667865333375405, -0.11667865333375405, 0.35720959723129897, -0.11667865333375405], [0.25049896732519583, -0.11667865333375405, -0.11667865333375405, 0.55532528673635673]], [[0.65030548208217898, 0.61753581199201957, 0.55386412523479889, -0.11667865333375405], [0.59881331123370507, -0.11667865333375405, -0.11667865333375405, -0.11667865333375405], [-0.11667865333375405, -0.029611557116543841, 0.092485711989719332, 0.54588443381266383]]]]) | |
24711 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24712 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24713 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24714 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24715 | def test_maximum_constData_rank0_array_rank1(self): | |
24716 | arg0=Data(-0.977109354346,self.functionspace) | |
24717 | arg1=numarray.array([0.70276044813264082, -0.31317697172843362]) | |
24718 | res=maximum(arg0,arg1) | |
24719 | ref=Data(numarray.array([0.70276044813264082, -0.31317697172843362]),self.functionspace) | |
24720 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24721 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24722 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24723 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24724 | def test_maximum_constData_rank1_array_rank1(self): | |
24725 | arg0=Data(numarray.array([-0.62917253954533403, -0.91478760916921553]),self.functionspace) | |
24726 | arg1=numarray.array([0.33852418316707711, -0.28298537896949161]) | |
24727 | res=maximum(arg0,arg1) | |
24728 | ref=Data(numarray.array([0.33852418316707711, -0.28298537896949161]),self.functionspace) | |
24729 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24730 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24731 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24732 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24733 | def test_maximum_constData_rank0_Symbol_rank1(self): | |
24734 | arg0=Data(-0.897659014127,self.functionspace) | |
24735 | arg1=Symbol(shape=(2,)) | |
24736 | res=maximum(arg0,arg1) | |
24737 | s1=numarray.array([-0.82851210466879732, 0.41079203962342792]) | |
24738 | sub=res.substitute({arg1:s1}) | |
24739 | ref=Data(numarray.array([-0.82851210466879732, 0.41079203962342792]),self.functionspace) | |
24740 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24741 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24742 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24743 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24744 | def test_maximum_constData_rank1_Symbol_rank1(self): | |
24745 | arg0=Data(numarray.array([-0.83340176844825109, -0.63521789570698273]),self.functionspace) | |
24746 | arg1=Symbol(shape=(2,)) | |
24747 | res=maximum(arg0,arg1) | |
24748 | s1=numarray.array([0.60550672698957397, 0.38447082907767527]) | |
24749 | sub=res.substitute({arg1:s1}) | |
24750 | ref=Data(numarray.array([0.60550672698957397, 0.38447082907767527]),self.functionspace) | |
24751 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24752 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24753 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24754 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24755 | def test_maximum_constData_rank0_constData_rank1(self): | |
24756 | arg0=Data(-0.159726189832,self.functionspace) | |
24757 | arg1=Data(numarray.array([0.1189612003237861, -0.63087634684158944]),self.functionspace) | |
24758 | res=maximum(arg0,arg1) | |
24759 | ref=Data(numarray.array([0.1189612003237861, -0.15972618983177433]),self.functionspace) | |
24760 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24761 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24762 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24763 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24764 | def test_maximum_constData_rank1_constData_rank1(self): | |
24765 | arg0=Data(numarray.array([-0.740289439487964, 0.50792620718681647]),self.functionspace) | |
24766 | arg1=Data(numarray.array([-0.98869116031302773, -0.030691151152568041]),self.functionspace) | |
24767 | res=maximum(arg0,arg1) | |
24768 | ref=Data(numarray.array([-0.740289439487964, 0.50792620718681647]),self.functionspace) | |
24769 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24770 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24771 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24772 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24773 | def test_maximum_constData_rank0_expandedData_rank1(self): | |
24774 | arg0=Data(0.0787324456408,self.functionspace) | |
24775 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24776 | arg1=msk_arg1*numarray.array([-0.48016870047192817, -0.99662347188520961])+(1.-msk_arg1)*numarray.array([0.58774285667709059, 0.67262794612436538]) | |
24777 | res=maximum(arg0,arg1) | |
24778 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24779 | ref=msk_ref*numarray.array([0.078732445640770532, 0.078732445640770532])+(1.-msk_ref)*numarray.array([0.58774285667709059, 0.67262794612436538]) | |
24780 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24781 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24782 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24783 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24784 | def test_maximum_constData_rank1_expandedData_rank1(self): | |
24785 | arg0=Data(numarray.array([0.17322811204814759, 0.25536817066436801]),self.functionspace) | |
24786 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24787 | arg1=msk_arg1*numarray.array([0.91972158516709168, -0.98465374807727835])+(1.-msk_arg1)*numarray.array([-0.19155853001762169, -0.43931509419045467]) | |
24788 | res=maximum(arg0,arg1) | |
24789 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24790 | ref=msk_ref*numarray.array([0.91972158516709168, 0.25536817066436801])+(1.-msk_ref)*numarray.array([0.17322811204814759, 0.25536817066436801]) | |
24791 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24792 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
24793 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24794 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24795 | def test_maximum_constData_rank0_array_rank2(self): | |
24796 | arg0=Data(-0.590060805237,self.functionspace) | |
24797 | arg1=numarray.array([[-0.46148245190505666, 0.72542064767267411, -0.49628838214418636, 0.36379029454198486, -0.35637937725143498], [0.77716266154028713, -0.0294929702278659, 0.77367789791539621, 0.26018292128939491, -0.0013933338625782277], [-0.71102579607495486, 0.058714555627548126, 0.62191425731141292, -0.9329697856968644, 0.48541403689676299], [-0.78897231411198532, -0.72015354884882865, -0.62803607199062306, -0.96795550516592099, 0.86073050375759519]]) | |
24798 | res=maximum(arg0,arg1) | |
24799 | ref=Data(numarray.array([[-0.46148245190505666, 0.72542064767267411, -0.49628838214418636, 0.36379029454198486, -0.35637937725143498], [0.77716266154028713, -0.0294929702278659, 0.77367789791539621, 0.26018292128939491, -0.0013933338625782277], [-0.59006080523717053, 0.058714555627548126, 0.62191425731141292, -0.59006080523717053, 0.48541403689676299], [-0.59006080523717053, -0.59006080523717053, -0.59006080523717053, -0.59006080523717053, 0.86073050375759519]]),self.functionspace) | |
24800 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24801 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24802 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24803 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24804 | def test_maximum_constData_rank2_array_rank2(self): | |
24805 | arg0=Data(numarray.array([[-0.73760404253705514, 0.50224248181499931, 0.11399712803883166, -0.13254212815072308, 0.74172163669326041], [-0.87041848231795704, 0.84343778201486463, -0.75554993046891106, 0.9855020616978345, -0.54320886383165745], [0.015954104044625605, -0.72612141326347879, -0.34799202711515242, -0.59679759609203797, -0.2575746318844927], [-0.2477036236422252, -0.021811926970866979, 0.81844582541975552, -0.14903149292622531, 0.80053174022124529]]),self.functionspace) | |
24806 | arg1=numarray.array([[-0.86954510950167463, 0.1017003127120133, -0.16951929662470433, 0.70137020593450439, 0.77429037367257458], [0.39247727833147628, -0.71486192220367606, -0.59117959653327024, 0.50948617730426826, -0.88092334234319924], [-0.95167080948153315, 0.021566922221860629, -0.37806539314914223, 0.3191199630251873, 0.21890366409298223], [0.8635367262140623, 0.52741696809771943, 0.40373578351947836, 0.40740580857358721, 0.50991869479490881]]) | |
24807 | res=maximum(arg0,arg1) | |
24808 | ref=Data(numarray.array([[-0.73760404253705514, 0.50224248181499931, 0.11399712803883166, 0.70137020593450439, 0.77429037367257458], [0.39247727833147628, 0.84343778201486463, -0.59117959653327024, 0.9855020616978345, -0.54320886383165745], [0.015954104044625605, 0.021566922221860629, -0.34799202711515242, 0.3191199630251873, 0.21890366409298223], [0.8635367262140623, 0.52741696809771943, 0.81844582541975552, 0.40740580857358721, 0.80053174022124529]]),self.functionspace) | |
24809 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24810 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24811 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24812 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24813 | def test_maximum_constData_rank0_Symbol_rank2(self): | |
24814 | arg0=Data(-0.637272359465,self.functionspace) | |
24815 | arg1=Symbol(shape=(4, 5)) | |
24816 | res=maximum(arg0,arg1) | |
24817 | s1=numarray.array([[-0.93357341361564083, 0.25698632067186034, -0.029720171711117738, -0.30875351618642743, -0.23637628888181861], [-0.2891471305478277, -0.22562638340862384, 0.18787873756952633, -0.15958639681320719, 0.065075144754314529], [0.95073268925174137, 0.71641948960869284, -0.27639016478885536, -0.24411084821371687, 0.69924204387635402], [0.16301313582709676, 0.74483426984036205, 0.62398172084669978, -0.62033142288846022, -0.28915587653777108]]) | |
24818 | sub=res.substitute({arg1:s1}) | |
24819 | ref=Data(numarray.array([[-0.63727235946512772, 0.25698632067186034, -0.029720171711117738, -0.30875351618642743, -0.23637628888181861], [-0.2891471305478277, -0.22562638340862384, 0.18787873756952633, -0.15958639681320719, 0.065075144754314529], [0.95073268925174137, 0.71641948960869284, -0.27639016478885536, -0.24411084821371687, 0.69924204387635402], [0.16301313582709676, 0.74483426984036205, 0.62398172084669978, -0.62033142288846022, -0.28915587653777108]]),self.functionspace) | |
24820 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24821 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24822 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24823 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24824 | def test_maximum_constData_rank2_Symbol_rank2(self): | |
24825 | arg0=Data(numarray.array([[-0.43026101754020685, 0.29811974564127852, 0.79886283172870032, 0.34469882516148398, 0.18440527003717522], [0.76150582417217327, 0.77351247227932407, -0.79713675943526252, 0.79860629299555597, 0.39057038072263506], [0.96977333965043799, -0.33335789993330733, -0.20605599405457475, -0.56915336090245372, 0.89461598602330206], [-0.67604219616426353, 0.88512102393172354, -0.56058686696277871, 0.54575207158615591, -0.32772855161181247]]),self.functionspace) | |
24826 | arg1=Symbol(shape=(4, 5)) | |
24827 | res=maximum(arg0,arg1) | |
24828 | s1=numarray.array([[-0.26119428722177185, 0.37209855196265185, 0.20415898126446064, -0.6225751456475801, 0.80103987500103524], [0.44532467101974893, -0.78274319336812548, -0.48351063332866051, 0.26100507852735033, -0.67050332562669701], [-0.12156255078406208, -0.27744404551457436, -0.71194253302697597, 0.57325927361819717, -0.54571219157485196], [-0.1389333385381808, -0.18545090923672225, -0.28684434823484395, 0.46339245987327771, -0.66451068494091325]]) | |
24829 | sub=res.substitute({arg1:s1}) | |
24830 | ref=Data(numarray.array([[-0.26119428722177185, 0.37209855196265185, 0.79886283172870032, 0.34469882516148398, 0.80103987500103524], [0.76150582417217327, 0.77351247227932407, -0.48351063332866051, 0.79860629299555597, 0.39057038072263506], [0.96977333965043799, -0.27744404551457436, -0.20605599405457475, 0.57325927361819717, 0.89461598602330206], [-0.1389333385381808, 0.88512102393172354, -0.28684434823484395, 0.54575207158615591, -0.32772855161181247]]),self.functionspace) | |
24831 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24832 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24833 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24834 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24835 | def test_maximum_constData_rank0_constData_rank2(self): | |
24836 | arg0=Data(0.471113579692,self.functionspace) | |
24837 | arg1=Data(numarray.array([[0.20278512451424202, 0.46932554124551484, 0.51627101397671771, -0.15806811678484656, 0.90125732162226746], [-0.64525760065047266, -0.99646917035423299, -0.0079700168467822241, -0.1148252168651378, -0.60869273468514651], [-0.81920269598799123, 0.18492463625508537, 0.67703260540557975, 0.38678293776089578, -0.58337450118932721], [-0.85103881319765606, -0.18597068284684348, 0.55532783770806615, -0.3391026116648197, 0.59931507372202009]]),self.functionspace) | |
24838 | res=maximum(arg0,arg1) | |
24839 | ref=Data(numarray.array([[0.47111357969230805, 0.47111357969230805, 0.51627101397671771, 0.47111357969230805, 0.90125732162226746], [0.47111357969230805, 0.47111357969230805, 0.47111357969230805, 0.47111357969230805, 0.47111357969230805], [0.47111357969230805, 0.47111357969230805, 0.67703260540557975, 0.47111357969230805, 0.47111357969230805], [0.47111357969230805, 0.47111357969230805, 0.55532783770806615, 0.47111357969230805, 0.59931507372202009]]),self.functionspace) | |
24840 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24841 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24842 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24843 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24844 | def test_maximum_constData_rank2_constData_rank2(self): | |
24845 | arg0=Data(numarray.array([[-0.17406452878186696, -0.34759214930565996, -0.13708153516362609, 0.93110590449668984, -0.47649961659515139], [-0.35702537789588118, -0.4057682901706241, 0.56892562984164674, 0.20451757373433055, -0.47729926624352892], [-0.55493234840963379, 0.020855045362278224, 0.95156666561071002, 0.14975165550539549, -0.17074783729098764], [-0.2364495010997254, -0.32021782391836329, -0.45843843696539488, -0.47665234638234, -0.41919606212785676]]),self.functionspace) | |
24846 | arg1=Data(numarray.array([[0.64408124666207822, -0.67629542279010635, -0.4931164628479503, -0.96447891179315248, -0.45618690487636582], [0.18569576708094893, -0.085193091641874163, 0.08793086582533971, 0.64570776148383136, -0.5516531478806932], [0.87675126968759676, -0.39508497185268077, -0.97669171907295138, -0.68655710586099006, -0.028857220969970232], [-0.3670380390017618, 0.76258006170069592, -0.31454790037894464, 0.6627659629911522, 0.82734991520477563]]),self.functionspace) | |
24847 | res=maximum(arg0,arg1) | |
24848 | ref=Data(numarray.array([[0.64408124666207822, -0.34759214930565996, -0.13708153516362609, 0.93110590449668984, -0.45618690487636582], [0.18569576708094893, -0.085193091641874163, 0.56892562984164674, 0.64570776148383136, -0.47729926624352892], [0.87675126968759676, 0.020855045362278224, 0.95156666561071002, 0.14975165550539549, -0.028857220969970232], [-0.2364495010997254, 0.76258006170069592, -0.31454790037894464, 0.6627659629911522, 0.82734991520477563]]),self.functionspace) | |
24849 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24850 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24851 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24852 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24853 | def test_maximum_constData_rank0_expandedData_rank2(self): | |
24854 | arg0=Data(-0.0165871765665,self.functionspace) | |
24855 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24856 | arg1=msk_arg1*numarray.array([[-0.73128249610105489, 0.8419999761644652, 0.32706544558055151, 0.98621609382436559, 0.11814390137662678], [0.19794947116873596, 0.31254355907321152, -0.87988550364485918, -0.11555651603083028, -0.71600368849223273], [-0.1893391600405403, 0.90957761312463936, -0.52243082625432802, -0.61123719298866308, 0.33907244894623134], [0.69675393273476094, 0.80610078097181703, -0.025854445517779379, 0.94898341046945389, 0.46113499488993592]])+(1.-msk_arg1)*numarray.array([[0.23505303855840864, 0.99481465040860417, -0.086492983784499877, -0.65370229345838227, 0.10003757203241559], [-0.55539504622389524, -0.97706587559470259, 0.76222581775594289, 0.77064743585593676, 0.37822774452875341], [0.63726139395335868, 0.82448429030660098, -0.98743591219817395, -0.11783271519582783, 0.82622085914926746], [0.79063087780255503, -0.51677954263556924, -0.11079135634696624, 0.55532802164644224, 0.97336607909484085]]) | |
24857 | res=maximum(arg0,arg1) | |
24858 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24859 | ref=msk_ref*numarray.array([[-0.016587176566458695, 0.8419999761644652, 0.32706544558055151, 0.98621609382436559, 0.11814390137662678], [0.19794947116873596, 0.31254355907321152, -0.016587176566458695, -0.016587176566458695, -0.016587176566458695], [-0.016587176566458695, 0.90957761312463936, -0.016587176566458695, -0.016587176566458695, 0.33907244894623134], [0.69675393273476094, 0.80610078097181703, -0.016587176566458695, 0.94898341046945389, 0.46113499488993592]])+(1.-msk_ref)*numarray.array([[0.23505303855840864, 0.99481465040860417, -0.016587176566458695, -0.016587176566458695, 0.10003757203241559], [-0.016587176566458695, -0.016587176566458695, 0.76222581775594289, 0.77064743585593676, 0.37822774452875341], [0.63726139395335868, 0.82448429030660098, -0.016587176566458695, -0.016587176566458695, 0.82622085914926746], [0.79063087780255503, -0.016587176566458695, -0.016587176566458695, 0.55532802164644224, 0.97336607909484085]]) | |
24860 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24861 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24862 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24863 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24864 | def test_maximum_constData_rank2_expandedData_rank2(self): | |
24865 | arg0=Data(numarray.array([[-0.58944550721294209, 0.11789616185996188, 0.72555020927912528, 0.95067825171691411, 0.44929807483372386], [-0.90050975945004685, -0.14027235979416108, -0.50271571837565965, 0.71764496858912841, 0.13936247694569537], [-0.55363895921566852, -0.29692903194729126, -0.12968512147399403, 0.16630251248490757, -0.15779583568993605], [-0.91804262372165168, -0.0058087569025269126, 0.57431208620955165, -0.71561067889580943, -0.22286757830799497]]),self.functionspace) | |
24866 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24867 | arg1=msk_arg1*numarray.array([[-0.99165981962421723, 0.056234396987206559, -0.96929836288649107, 0.85741514845807765, 0.31290702472003784], [0.66879661516796074, 0.74410544323631544, 0.61758123318413549, 0.0023178475410641219, 0.035637036084378515], [0.80734776741943692, -0.93425673113467789, -0.3545773036750044, 0.17713706129968121, -0.78562855023306311], [0.95764289578713813, 0.82592763875748232, 0.56453388909804225, 0.33669515016119256, 0.68270953107335797]])+(1.-msk_arg1)*numarray.array([[0.46121428483489479, 0.77301745076266992, -0.75239767323970663, -0.84007824075301141, 0.54854476434581101], [-0.18306960903719038, 0.22306205318244277, 0.95307177391042264, -0.83728247335587391, -0.64823533348017937], [0.90595429846142239, -0.55842375993133087, 0.69860419850019628, -0.58794473533051539, -0.90321846168159303], [0.19112532041271257, -0.16066829098287294, 0.62710659839874872, -0.58348891958458182, -0.43880626183960802]]) | |
24868 | res=maximum(arg0,arg1) | |
24869 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24870 | ref=msk_ref*numarray.array([[-0.58944550721294209, 0.11789616185996188, 0.72555020927912528, 0.95067825171691411, 0.44929807483372386], [0.66879661516796074, 0.74410544323631544, 0.61758123318413549, 0.71764496858912841, 0.13936247694569537], [0.80734776741943692, -0.29692903194729126, -0.12968512147399403, 0.17713706129968121, -0.15779583568993605], [0.95764289578713813, 0.82592763875748232, 0.57431208620955165, 0.33669515016119256, 0.68270953107335797]])+(1.-msk_ref)*numarray.array([[0.46121428483489479, 0.77301745076266992, 0.72555020927912528, 0.95067825171691411, 0.54854476434581101], [-0.18306960903719038, 0.22306205318244277, 0.95307177391042264, 0.71764496858912841, 0.13936247694569537], [0.90595429846142239, -0.29692903194729126, 0.69860419850019628, 0.16630251248490757, -0.15779583568993605], [0.19112532041271257, -0.0058087569025269126, 0.62710659839874872, -0.58348891958458182, -0.22286757830799497]]) | |
24871 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24872 | self.failUnlessEqual(res.getShape(),(4, 5),"wrong shape of result.") | |
24873 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24874 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24875 | def test_maximum_constData_rank0_array_rank3(self): | |
24876 | arg0=Data(0.516978268542,self.functionspace) | |
24877 | arg1=numarray.array([[[0.1203754261590837, -0.30872063802497229], [-0.54367292398629163, -0.28894544783644749]], [[0.98579636264447745, -0.1617667296901939], [-0.71399942465432775, 0.53397315922387301]], [[-0.30699998747323254, 0.077194107501915799], [0.79875258103307534, 0.80801781194196387]], [[0.15460773887563417, 0.90896321404086278], [0.20719915824628354, 0.51262923866513121]], [[-0.42605851894450963, 0.11121377720978609], [0.83365318051571125, -0.090277192445190391]], [[0.11506747491337666, 0.6855450860006127], [-0.55520344405285305, -0.29122646515827966]]]) | |
24878 | res=maximum(arg0,arg1) | |
24879 | ref=Data(numarray.array([[[0.51697826854212692, 0.51697826854212692], [0.51697826854212692, 0.51697826854212692]], [[0.98579636264447745, 0.51697826854212692], [0.51697826854212692, 0.53397315922387301]], [[0.51697826854212692, 0.51697826854212692], [0.79875258103307534, 0.80801781194196387]], [[0.51697826854212692, 0.90896321404086278], [0.51697826854212692, 0.51697826854212692]], [[0.51697826854212692, 0.51697826854212692], [0.83365318051571125, 0.51697826854212692]], [[0.51697826854212692, 0.6855450860006127], [0.51697826854212692, 0.51697826854212692]]]),self.functionspace) | |
24880 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24881 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24882 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24883 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24884 | def test_maximum_constData_rank3_array_rank3(self): | |
24885 | arg0=Data(numarray.array([[[-0.019064560845273526, -0.66082512842015606], [0.7775245397942645, -0.97863728880489664]], [[0.14796990911746843, -0.14940640351421752], [-0.86829509897198331, 0.37449746403230755]], [[0.37150654719541598, -0.28378634170515826], [-0.50000172789557618, 0.12870803836646894]], [[0.011474562798716059, 0.62211999362561543], [0.20936671603779877, 0.1596384101994337]], [[0.48413175379125017, -0.70455876802613626], [0.95196006961287805, 0.20450770288369013]], [[-0.69630908911115341, -0.40070777001767066], [0.39061204191308385, -0.7494107073434304]]]),self.functionspace) | |
24886 | arg1=numarray.array([[[-0.78977223364983429, -0.39796958371743218], [-0.72434391726505232, -0.52658036061654578]], [[0.30677953915987843, -0.27325740398129361], [-0.44704945638883409, 0.35675189799215068]], [[-0.85496603242765823, -0.49015497061116231], [0.38100286965101793, 0.71258135816204082]], [[-0.69502829292158985, -0.66075782445418518], [0.62742938866730125, -0.0042722353662665302]], [[0.47028792653016804, -0.43167155331296869], [0.46101712703457975, -0.26196273464811326]], [[-0.79525334450742657, 0.58902924204184304], [0.071218600732356085, -0.44930940165988953]]]) | |
24887 | res=maximum(arg0,arg1) | |
24888 | ref=Data(numarray.array([[[-0.019064560845273526, -0.39796958371743218], [0.7775245397942645, -0.52658036061654578]], [[0.30677953915987843, -0.14940640351421752], [-0.44704945638883409, 0.37449746403230755]], [[0.37150654719541598, -0.28378634170515826], [0.38100286965101793, 0.71258135816204082]], [[0.011474562798716059, 0.62211999362561543], [0.62742938866730125, 0.1596384101994337]], [[0.48413175379125017, -0.43167155331296869], [0.95196006961287805, 0.20450770288369013]], [[-0.69630908911115341, 0.58902924204184304], [0.39061204191308385, -0.44930940165988953]]]),self.functionspace) | |
24889 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24890 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24891 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24892 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24893 | def test_maximum_constData_rank0_Symbol_rank3(self): | |
24894 | arg0=Data(-0.301616866911,self.functionspace) | |
24895 | arg1=Symbol(shape=(6, 2, 2)) | |
24896 | res=maximum(arg0,arg1) | |
24897 | s1=numarray.array([[[-0.075914420708843577, 0.66358144119505469], [-0.58087779325539213, -0.29018537386125676]], [[0.23348641898057276, -0.64142675232592739], [0.35482470582420178, -0.67699541518823403]], [[0.36917299179456542, -0.85774610863182055], [0.17824922067142834, 0.47555537122661984]], [[-0.97719261595724527, 0.54833659450404926], [-0.67194747717936876, 0.21998235181108461]], [[0.25195270131078606, 0.070395336399227793], [-0.42779349762042918, 0.3141743449583867]], [[0.20807098525982304, -0.99926821174044345], [-0.33669983271995707, 0.62342319037875926]]]) | |
24898 | sub=res.substitute({arg1:s1}) | |
24899 | ref=Data(numarray.array([[[-0.075914420708843577, 0.66358144119505469], [-0.30161686691078327, -0.29018537386125676]], [[0.23348641898057276, -0.30161686691078327], [0.35482470582420178, -0.30161686691078327]], [[0.36917299179456542, -0.30161686691078327], [0.17824922067142834, 0.47555537122661984]], [[-0.30161686691078327, 0.54833659450404926], [-0.30161686691078327, 0.21998235181108461]], [[0.25195270131078606, 0.070395336399227793], [-0.30161686691078327, 0.3141743449583867]], [[0.20807098525982304, -0.30161686691078327], [-0.30161686691078327, 0.62342319037875926]]]),self.functionspace) | |
24900 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24901 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24902 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24903 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24904 | def test_maximum_constData_rank3_Symbol_rank3(self): | |
24905 | arg0=Data(numarray.array([[[0.25053145075842798, -0.3794274575500276], [-0.2203081336344006, -0.90636103624233622]], [[-0.89360594132235449, -0.044279048286900435], [0.50865438163476706, 0.30050515771416508]], [[0.17151373057705444, 0.3537454996156566], [-0.69271913159458465, -0.64664308190255659]], [[-0.14646556033688141, -0.056658533589058591], [-0.92991614862004801, 0.41532986353549406]], [[-0.63084142928204034, -0.88583877496366781], [-0.93048186777341169, -0.67144597532207717]], [[0.87416304298844172, -0.82914945635714843], [0.36425589944096037, -0.44121106899902984]]]),self.functionspace) | |
24906 | arg1=Symbol(shape=(6, 2, 2)) | |
24907 | res=maximum(arg0,arg1) | |
24908 | s1=numarray.array([[[0.34360762394944211, -0.750307485491571], [0.082385622892501509, 0.78367774116726041]], [[-0.36821289797486978, 0.94549455065763843], [-0.99726764906452803, -0.43481851107125213]], [[0.39446194425583214, -0.9533167476847999], [-0.62274186628347961, -0.20554677331882809]], [[-0.41826475650418771, -0.92753710539749479], [-0.52057150946775099, 0.60511201119510249]], [[-0.68353108574981913, -0.91712769524574145], [-0.014686165499424808, 0.35604294723483321]], [[0.58881786310683792, 0.14736266870876857], [0.72063758010693379, 0.80581576520467024]]]) | |
24909 | sub=res.substitute({arg1:s1}) | |
24910 | ref=Data(numarray.array([[[0.34360762394944211, -0.3794274575500276], [0.082385622892501509, 0.78367774116726041]], [[-0.36821289797486978, 0.94549455065763843], [0.50865438163476706, 0.30050515771416508]], [[0.39446194425583214, 0.3537454996156566], [-0.62274186628347961, -0.20554677331882809]], [[-0.14646556033688141, -0.056658533589058591], [-0.52057150946775099, 0.60511201119510249]], [[-0.63084142928204034, -0.88583877496366781], [-0.014686165499424808, 0.35604294723483321]], [[0.87416304298844172, 0.14736266870876857], [0.72063758010693379, 0.80581576520467024]]]),self.functionspace) | |
24911 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24912 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24913 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24914 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24915 | def test_maximum_constData_rank0_constData_rank3(self): | |
24916 | arg0=Data(-0.520111358301,self.functionspace) | |
24917 | arg1=Data(numarray.array([[[-0.53755593069331176, 0.37344778982644522], [0.90325038776102318, -0.89380296608704612]], [[0.59616188236635415, 0.051917694202589626], [-0.04448028945702287, 0.41100328136339304]], [[0.33171935562963939, -0.24899622688538758], [0.62960041822469925, 0.33958207874297885]], [[0.77867517548268683, 0.42072327881397564], [-0.74938980192739946, 0.81416985659114172]], [[0.3116774006710874, -0.33738332950437711], [0.78527047728394561, -0.74961547941494744]], [[-0.20009722385279827, -0.6571543996337208], [0.17776822203863141, 0.44451143669045345]]]),self.functionspace) | |
24918 | res=maximum(arg0,arg1) | |
24919 | ref=Data(numarray.array([[[-0.52011135830068911, 0.37344778982644522], [0.90325038776102318, -0.52011135830068911]], [[0.59616188236635415, 0.051917694202589626], [-0.04448028945702287, 0.41100328136339304]], [[0.33171935562963939, -0.24899622688538758], [0.62960041822469925, 0.33958207874297885]], [[0.77867517548268683, 0.42072327881397564], [-0.52011135830068911, 0.81416985659114172]], [[0.3116774006710874, -0.33738332950437711], [0.78527047728394561, -0.52011135830068911]], [[-0.20009722385279827, -0.52011135830068911], [0.17776822203863141, 0.44451143669045345]]]),self.functionspace) | |
24920 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24921 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24922 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24923 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24924 | def test_maximum_constData_rank3_constData_rank3(self): | |
24925 | arg0=Data(numarray.array([[[0.22644209225706202, -0.82408753542802948], [-0.3229055658381601, 0.2590293226229694]], [[-0.26905946802022762, 0.2903861382640851], [0.12277829585192546, -0.77850587791871839]], [[-0.89889146053925439, 0.38226490597490859], [0.90580586744844571, 0.55103010631847082]], [[-0.039650312436662727, -0.88676021840684105], [-0.51601766497181489, -0.25197490301551628]], [[0.61158062010002601, 0.29776204958735475], [0.71009302472890323, -0.66290156645868592]], [[0.35864937589582269, 0.39150421091712273], [0.62113215392768795, -0.60699036535846251]]]),self.functionspace) | |
24926 | arg1=Data(numarray.array([[[0.19115277784536788, -0.12179826773639668], [0.93712678010940254, 0.88203929581384566]], [[-0.88435454431013327, 0.9789660191397036], [0.59264976401288116, -0.95487963435415701]], [[-0.63201606726111259, -0.55289610271892187], [-0.28138775032557017, 0.10882077764575948]], [[-0.49427255052853813, -0.052753620845127358], [0.041666359004336684, 0.79096925989660916]], [[-0.41422835506377953, 0.44371821729329164], [0.29584910796715769, 0.32801776168641106]], [[0.48887697683026987, 0.060894815731677765], [0.03438210218260096, 0.012054779031575036]]]),self.functionspace) | |
24927 | res=maximum(arg0,arg1) | |
24928 | ref=Data(numarray.array([[[0.22644209225706202, -0.12179826773639668], [0.93712678010940254, 0.88203929581384566]], [[-0.26905946802022762, 0.9789660191397036], [0.59264976401288116, -0.77850587791871839]], [[-0.63201606726111259, 0.38226490597490859], [0.90580586744844571, 0.55103010631847082]], [[-0.039650312436662727, -0.052753620845127358], [0.041666359004336684, 0.79096925989660916]], [[0.61158062010002601, 0.44371821729329164], [0.71009302472890323, 0.32801776168641106]], [[0.48887697683026987, 0.39150421091712273], [0.62113215392768795, 0.012054779031575036]]]),self.functionspace) | |
24929 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24930 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24931 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24932 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24933 | def test_maximum_constData_rank0_expandedData_rank3(self): | |
24934 | arg0=Data(-0.417160613179,self.functionspace) | |
24935 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24936 | arg1=msk_arg1*numarray.array([[[-0.59344857070579238, 0.57386185515692323], [0.22052027505720551, -0.02253631100635034]], [[-0.79319250300435051, -0.80838786337089852], [0.72156951045421569, 0.79754573800662776]], [[0.44658460292787949, -0.6036139053961691], [-0.0074518374538019572, 0.10259587076510246]], [[-0.67150694427957869, -0.24769554924870607], [0.34642765365536365, 0.40804680401868687]], [[-0.48546098050896314, -0.37273512567714118], [-0.93149112098916875, 0.56189739537971306]], [[0.38968682790960374, 0.6967969004356549], [0.31719546261205389, 0.66755203749869896]]])+(1.-msk_arg1)*numarray.array([[[-0.32798712079017855, 0.91458585203417941], [-0.1858316961301949, 0.10471165389886661]], [[0.25739129223381751, -0.20580522632299081], [-0.77836146736583722, 0.71646905903017921]], [[-0.12213192671753959, 0.2681111999511725], [-0.88598687196668746, -0.10299574975782755]], [[-0.47951968494409059, 0.38762496133793989], [-0.20961640133930182, -0.46499685779521527]], [[-0.63002780928919999, 0.99970479651183686], [-0.28892538074111696, -0.86014943997554583]], [[-0.87521791528084747, -0.2290352438643557], [0.61458437038138758, -0.054295041010556266]]]) | |
24937 | res=maximum(arg0,arg1) | |
24938 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24939 | ref=msk_ref*numarray.array([[[-0.41716061317925801, 0.57386185515692323], [0.22052027505720551, -0.02253631100635034]], [[-0.41716061317925801, -0.41716061317925801], [0.72156951045421569, 0.79754573800662776]], [[0.44658460292787949, -0.41716061317925801], [-0.0074518374538019572, 0.10259587076510246]], [[-0.41716061317925801, -0.24769554924870607], [0.34642765365536365, 0.40804680401868687]], [[-0.41716061317925801, -0.37273512567714118], [-0.41716061317925801, 0.56189739537971306]], [[0.38968682790960374, 0.6967969004356549], [0.31719546261205389, 0.66755203749869896]]])+(1.-msk_ref)*numarray.array([[[-0.32798712079017855, 0.91458585203417941], [-0.1858316961301949, 0.10471165389886661]], [[0.25739129223381751, -0.20580522632299081], [-0.41716061317925801, 0.71646905903017921]], [[-0.12213192671753959, 0.2681111999511725], [-0.41716061317925801, -0.10299574975782755]], [[-0.41716061317925801, 0.38762496133793989], [-0.20961640133930182, -0.41716061317925801]], [[-0.41716061317925801, 0.99970479651183686], [-0.28892538074111696, -0.41716061317925801]], [[-0.41716061317925801, -0.2290352438643557], [0.61458437038138758, -0.054295041010556266]]]) | |
24940 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24941 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24942 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24943 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24944 | def test_maximum_constData_rank3_expandedData_rank3(self): | |
24945 | arg0=Data(numarray.array([[[-0.83383467576998993, -0.83006279778742731], [0.61582380340209775, -0.4064088511087891]], [[-0.4159938969754351, -0.073787477564773329], [-0.021547740656737036, 0.5133460168591264]], [[0.91656606912919014, 0.53167536065528687], [-0.61521902289133901, 0.4664937027114231]], [[0.97834019232877312, -0.93183928685658612], [-0.89297362621765086, 0.98615396264285726]], [[0.34755706158837762, 0.58475703376154442], [-0.15101139759741611, 0.40395116766294437]], [[0.62168225352120166, 0.50496809316394398], [0.72198090495722789, 0.85904449954970996]]]),self.functionspace) | |
24946 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
24947 | arg1=msk_arg1*numarray.array([[[0.19214098611675801, 0.07906975802244931], [0.70387607748340963, 0.73265073793599189]], [[-0.6142258277704653, 0.6255979194324861], [0.46214070326839796, -0.28059147251841399]], [[-0.57130450989061998, 0.5709484739777515], [0.48615540360013054, -0.60718602833024926]], [[0.48182675680934151, -0.66948554719719966], [0.8085115047175595, -0.95171986323783053]], [[0.5870376913405424, 0.59265808147737098], [0.49569538437672511, -0.32465377675760454]], [[0.41879820042914684, 0.82573065216442831], [0.14668313470902383, 0.78600006019282054]]])+(1.-msk_arg1)*numarray.array([[[0.63268720723055161, 0.78130831328720141], [-0.18520848313978489, -0.35202194720092805]], [[0.58179955935294925, 0.1226309312208731], [0.29154247836357272, -0.9060564605671757]], [[0.71741017447493505, 0.96466082998871294], [-0.81353604274588265, -0.098340216808310954]], [[-0.88020377622640522, -0.84721483807877607], [0.6939301069991286, -0.30953811263549613]], [[0.99593228905602715, 0.32599642612508051], [-0.40377432683868597, 0.0021172786571095337]], [[0.69285022412981334, 0.70887735927613194], [0.17846982139165757, 0.33981526774046644]]]) | |
24948 | res=maximum(arg0,arg1) | |
24949 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
24950 | ref=msk_ref*numarray.array([[[0.19214098611675801, 0.07906975802244931], [0.70387607748340963, 0.73265073793599189]], [[-0.4159938969754351, 0.6255979194324861], [0.46214070326839796, 0.5133460168591264]], [[0.91656606912919014, 0.5709484739777515], [0.48615540360013054, 0.4664937027114231]], [[0.97834019232877312, -0.66948554719719966], [0.8085115047175595, 0.98615396264285726]], [[0.5870376913405424, 0.59265808147737098], [0.49569538437672511, 0.40395116766294437]], [[0.62168225352120166, 0.82573065216442831], [0.72198090495722789, 0.85904449954970996]]])+(1.-msk_ref)*numarray.array([[[0.63268720723055161, 0.78130831328720141], [0.61582380340209775, -0.35202194720092805]], [[0.58179955935294925, 0.1226309312208731], [0.29154247836357272, 0.5133460168591264]], [[0.91656606912919014, 0.96466082998871294], [-0.61521902289133901, 0.4664937027114231]], [[0.97834019232877312, -0.84721483807877607], [0.6939301069991286, 0.98615396264285726]], [[0.99593228905602715, 0.58475703376154442], [-0.15101139759741611, 0.40395116766294437]], [[0.69285022412981334, 0.70887735927613194], [0.72198090495722789, 0.85904449954970996]]]) | |
24951 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24952 | self.failUnlessEqual(res.getShape(),(6, 2, 2),"wrong shape of result.") | |
24953 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24954 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24955 | def test_maximum_constData_rank0_array_rank4(self): | |
24956 | arg0=Data(-0.142135287883,self.functionspace) | |
24957 | arg1=numarray.array([[[[-0.3214758956274788, -0.095246696795476593, 0.88428285109896976, 0.16221904765171113], [0.2694361196789572, -0.88687321541037512, 0.02982831555263199, 0.36044697686186544], [0.089838925108686407, 0.1168644540354129, -0.41060659412622824, 0.51404357016969393]], [[-0.7228284299326766, -0.74820755507542192, -0.53859530054671856, -0.10221620366876616], [0.59211782258097068, -0.9868578737653857, 0.51866928562956849, -0.47068533837586557], [0.54008589927595518, 0.30880228975280732, 0.011323333079816589, -0.23519250089433008]]], [[[-0.88835060064517424, 0.97805478155238479, 0.044980281282704704, 0.54172810913588032], [0.50306412490394248, -0.9089797473431025, -0.65257701723518702, -0.81985356457976932], [-0.55532857771618849, 0.90847532179586454, 0.73479685498652625, -0.95360986864558894]], [[-0.070414261238669784, -0.55257468908581853, -0.8087953736998108, -0.88978135385971924], [0.30925435765744647, 0.011985479496297913, -0.94329973754759822, -0.78626227567625295], [-0.80368619190217405, -0.0018149953637613958, -0.64327784734883697, -0.70628255506304627]]], [[[0.21889092381937481, 0.95982372912792258, -0.51545817953418194, -0.79191496743321532], [0.24699184622858739, -0.97716194806902634, -0.74023402440265662, -0.68483112762279252], [-0.80837443342334714, 0.39602906627714529, -0.93722656251851855, -0.36568401963574959]], [[-0.062719970600047636, -0.75215102861789918, 0.80346816982468328, -0.03123166762679852], [0.87032572315546886, -0.26645188225830663, 0.16577077009238161, -0.42846478915247221], [-0.83350849887379552, -0.09057758663591553, -0.72415237677358313, -0.11083229941883377]]]]) | |
24958 | res=maximum(arg0,arg1) | |
24959 | ref=Data(numarray.array([[[[-0.14213528788334617, -0.095246696795476593, 0.88428285109896976, 0.16221904765171113], [0.2694361196789572, -0.14213528788334617, 0.02982831555263199, 0.36044697686186544], [0.089838925108686407, 0.1168644540354129, -0.14213528788334617, 0.51404357016969393]], [[-0.14213528788334617, -0.14213528788334617, -0.14213528788334617, -0.10221620366876616], [0.59211782258097068, -0.14213528788334617, 0.51866928562956849, -0.14213528788334617], [0.54008589927595518, 0.30880228975280732, 0.011323333079816589, -0.14213528788334617]]], [[[-0.14213528788334617, 0.97805478155238479, 0.044980281282704704, 0.54172810913588032], [0.50306412490394248, -0.14213528788334617, -0.14213528788334617, -0.14213528788334617], [-0.14213528788334617, 0.90847532179586454, 0.73479685498652625, -0.14213528788334617]], [[-0.070414261238669784, -0.14213528788334617, -0.14213528788334617, -0.14213528788334617], [0.30925435765744647, 0.011985479496297913, -0.14213528788334617, -0.14213528788334617], [-0.14213528788334617, -0.0018149953637613958, -0.14213528788334617, -0.14213528788334617]]], [[[0.21889092381937481, 0.95982372912792258, -0.14213528788334617, -0.14213528788334617], [0.24699184622858739, -0.14213528788334617, -0.14213528788334617, -0.14213528788334617], [-0.14213528788334617, 0.39602906627714529, -0.14213528788334617, -0.14213528788334617]], [[-0.062719970600047636, -0.14213528788334617, 0.80346816982468328, -0.03123166762679852], [0.87032572315546886, -0.14213528788334617, 0.16577077009238161, -0.14213528788334617], [-0.14213528788334617, -0.09057758663591553, -0.14213528788334617, -0.11083229941883377]]]]),self.functionspace) | |
24960 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24961 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24962 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24963 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24964 | def test_maximum_constData_rank4_array_rank4(self): | |
24965 | arg0=Data(numarray.array([[[[0.46361503964213124, 0.75212103924315676, 0.1517014593635575, 0.63148557170685327], [-0.9875146867756015, 0.42928007237587473, 0.85118517914010172, -0.15509137168645615], [0.15514320286516092, 0.0005342941540116275, -0.89094877398399008, 0.908865463056445]], [[0.45054003146551436, -0.23123539736983156, -0.076540616512914772, 0.10502324913621375], [-0.0071973112790566507, -0.81620273555925849, -0.79541946133102126, 0.26480060384338566], [-0.45249656775626268, 0.010265849576416963, -0.9086687652789831, -0.71275837340643822]]], [[[0.67609301986855086, 0.37746787067053145, -0.42950164086299925, -0.034365339088483715], [0.3373674099598567, 0.18896844133041868, 0.93458147614245779, -0.40631016965933098], [-0.19339720965663387, 0.66853942853358883, 0.56086919503548471, 0.49829638104085539]], [[-0.67730793306659365, -0.93402109411008638, -0.53909789907854089, -0.11494460733501222], [0.47127259923995135, 0.40243458962316581, 0.65232695613202951, 0.87100864021002966], [-0.62331578035775403, -0.78832076452515865, 0.98453152930704513, -0.32270285556445955]]], [[[0.030889419318346212, -0.74436621353272381, -0.41393005003246119, -0.27459836901005485], [0.2727885358054869, 0.39114640764062014, -0.62734280749087201, -0.68278841829167125], [0.45687670732427632, -0.41786887648402415, 0.14358785951974951, 0.20168949679051473]], [[-0.61804283685818384, -0.74947293782095592, 0.47882556396076903, -0.38116235218691275], [-0.16868935807808083, -0.31479531035901021, -0.629767051514182, 0.40666969603452707], [0.47141425542113868, 0.42602189213064201, -0.42510981826215244, 0.35951635388005387]]]]),self.functionspace) | |
24966 | arg1=numarray.array([[[[-0.075878674569879179, -0.39617760413616954, -0.37441304528755759, 0.059028750333119939], [-0.45199615428664996, -0.67982487852801032, -0.43878514017544568, -0.2306154287295592], [-0.028641567153798952, 0.20315619172000665, 0.25175605070668317, -0.62452580082432019]], [[-0.5510023141107756, 0.47087051768615695, -0.20141109488796705, -0.75776728595767517], [0.13680386381556775, -0.43979686709904531, -0.97978303421397572, 0.84162201515236612], [-0.26616111363933515, -0.32677302519872753, -0.74540501454095254, -0.31553251505895985]]], [[[0.0019165847734914365, -0.34429378460591642, -0.6920165333737931, 0.54536804846096953], [-0.21558916120957838, 0.60934895052910298, -0.72555820711554286, 0.81566556247952771], [0.28566419298828816, -0.94399443344238465, -0.11385943971564827, 0.0098538097357632193]], [[0.23053049901245104, -0.63018177830499922, -0.58754298214345324, 0.32371305451881383], [0.34351012374192247, 0.50137166714297887, 0.95947548444362751, 0.42833198450872101], [-0.72876678207075196, -0.016030958882900848, 0.31136367053725356, 0.4736018523880543]]], [[[-0.49061444452775582, 0.81114387212475636, 0.38995779155236199, 0.68167382208379479], [-0.99234885343352053, 0.54948405195911665, 0.67748560641952316, 0.12361771392509757], [0.74957930366266456, 0.29970297400899271, 0.3159611266551301, -0.42046308727640236]], [[0.20950673516815188, -0.088341400215833366, 0.9638973190702973, 0.68199731178218692], [-0.57396477728598105, -0.89652900611840525, 0.019727515752113067, 0.57108671455067683], [0.70179048884165618, -0.72010473438276934, 0.82364341343487069, 0.81816644420876461]]]]) | |
24967 | res=maximum(arg0,arg1) | |
24968 | ref=Data(numarray.array([[[[0.46361503964213124, 0.75212103924315676, 0.1517014593635575, 0.63148557170685327], [-0.45199615428664996, 0.42928007237587473, 0.85118517914010172, -0.15509137168645615], [0.15514320286516092, 0.20315619172000665, 0.25175605070668317, 0.908865463056445]], [[0.45054003146551436, 0.47087051768615695, -0.076540616512914772, 0.10502324913621375], [0.13680386381556775, -0.43979686709904531, -0.79541946133102126, 0.84162201515236612], [-0.26616111363933515, 0.010265849576416963, -0.74540501454095254, -0.31553251505895985]]], [[[0.67609301986855086, 0.37746787067053145, -0.42950164086299925, 0.54536804846096953], [0.3373674099598567, 0.60934895052910298, 0.93458147614245779, 0.81566556247952771], [0.28566419298828816, 0.66853942853358883, 0.56086919503548471, 0.49829638104085539]], [[0.23053049901245104, -0.63018177830499922, -0.53909789907854089, 0.32371305451881383], [0.47127259923995135, 0.50137166714297887, 0.95947548444362751, 0.87100864021002966], [-0.62331578035775403, -0.016030958882900848, 0.98453152930704513, 0.4736018523880543]]], [[[0.030889419318346212, 0.81114387212475636, 0.38995779155236199, 0.68167382208379479], [0.2727885358054869, 0.54948405195911665, 0.67748560641952316, 0.12361771392509757], [0.74957930366266456, 0.29970297400899271, 0.3159611266551301, 0.20168949679051473]], [[0.20950673516815188, -0.088341400215833366, 0.9638973190702973, 0.68199731178218692], [-0.16868935807808083, -0.31479531035901021, 0.019727515752113067, 0.57108671455067683], [0.70179048884165618, 0.42602189213064201, 0.82364341343487069, 0.81816644420876461]]]]),self.functionspace) | |
24969 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
24970 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24971 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24972 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24973 | def test_maximum_constData_rank0_Symbol_rank4(self): | |
24974 | arg0=Data(0.779736643798,self.functionspace) | |
24975 | arg1=Symbol(shape=(3, 2, 3, 4)) | |
24976 | res=maximum(arg0,arg1) | |
24977 | s1=numarray.array([[[[0.63523675174647853, 0.38201082516767793, -0.20793716944450535, -0.63763646646312888], [0.834635387648758, -0.17680511068025861, 0.396315589707259, 0.11161680583935429], [-0.73869666308710835, -0.49009415248425725, 0.91186235080476585, -0.73184937821061569]], [[0.29296083296199282, 0.68080308442172255, -0.28515442484539988, -0.68360700469277513], [-0.27425080713688788, -0.21608242948540779, 0.2641923511851838, -0.98133514226068663], [-0.3814071825404457, -0.10623863191344207, 0.31035955573337604, 0.56608271252944742]]], [[[0.40557289599793145, 0.71289586399346105, 0.18676151577894973, -0.36486848211263023], [0.015987521664037052, -0.61454925338975319, 0.83473516520110924, 0.65255714442596346], [0.53737380711513572, 0.39006109295194147, 0.34144737973591632, -0.51867680380978776]], [[0.62905861891302006, 0.9272306847780154, -0.19029217178583258, 0.83209580335004119], [0.014784510552173336, 0.59641741385026537, -0.10011590287108874, -0.28753968515006356], [0.59953709339077244, -0.77203120330570019, 0.92668220579915639, -0.98693965215801116]]], [[[0.042998917634785805, 0.94576064365865564, -0.97301185415108771, 0.80265301874270079], [0.45826573366446288, 0.53177767011301391, 0.4221224976289133, 0.081570270788827948], [-0.23367502994461908, -0.051912331731638117, 0.49090314291706783, -0.00634503874320691]], [[0.83127420461334278, 0.16630541192993142, 0.54676273477515869, -0.42579432540758377], [0.90427503268496379, -0.9638633447444942, -0.94230249615905826, 0.61536244029307308], [0.4077827929061324, 0.89001033043558708, 0.26837782147501321, -0.034119015798711905]]]]) | |
24978 | sub=res.substitute({arg1:s1}) | |
24979 | ref=Data(numarray.array([[[[0.77973664379814167, 0.77973664379814167, 0.77973664379814167, 0.77973664379814167], [0.834635387648758, 0.77973664379814167, 0.77973664379814167, 0.77973664379814167], [0.77973664379814167, 0.77973664379814167, 0.91186235080476585, 0.77973664379814167]], [[0.77973664379814167, 0.77973664379814167, 0.77973664379814167, 0.77973664379814167], [0.77973664379814167, 0.77973664379814167, 0.77973664379814167, 0.77973664379814167], [0.77973664379814167, 0.77973664379814167, 0.77973664379814167, 0.77973664379814167]]], [[[0.77973664379814167, 0.77973664379814167, 0.77973664379814167, 0.77973664379814167], [0.77973664379814167, 0.77973664379814167, 0.83473516520110924, 0.77973664379814167], [0.77973664379814167, 0.77973664379814167, 0.77973664379814167, 0.77973664379814167]], [[0.77973664379814167, 0.9272306847780154, 0.77973664379814167, 0.83209580335004119], [0.77973664379814167, 0.77973664379814167, 0.77973664379814167, 0.77973664379814167], [0.77973664379814167, 0.77973664379814167, 0.92668220579915639, 0.77973664379814167]]], [[[0.77973664379814167, 0.94576064365865564, 0.77973664379814167, 0.80265301874270079], [0.77973664379814167, 0.77973664379814167, 0.77973664379814167, 0.77973664379814167], [0.77973664379814167, 0.77973664379814167, 0.77973664379814167, 0.77973664379814167]], [[0.83127420461334278, 0.77973664379814167, 0.77973664379814167, 0.77973664379814167], [0.90427503268496379, 0.77973664379814167, 0.77973664379814167, 0.77973664379814167], [0.77973664379814167, 0.89001033043558708, 0.77973664379814167, 0.77973664379814167]]]]),self.functionspace) | |
24980 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24981 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24982 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24983 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24984 | def test_maximum_constData_rank4_Symbol_rank4(self): | |
24985 | arg0=Data(numarray.array([[[[0.11823709792393644, 0.57743427123415247, -0.47743748205799741, -0.25860465344987116], [-0.85342597746354443, 0.11397059023125844, -0.32681677820897659, -0.4288280260721582], [0.4662138324786389, 0.14147352071096919, 0.19750088925070242, 0.94387770790006087]], [[0.46496806851074601, 0.54406435609557624, -0.13736364411105972, -0.1802701617446667], [-0.48294385750438318, -0.90642315431975162, -0.14370791133432848, 0.46285396642950349], [0.57423763420356289, -0.60637963806576178, -0.44242702298232706, 0.60815013943825491]]], [[[-0.38932408289704612, 0.14626247172828211, -0.67169729383052701, -0.17668123573312444], [0.85536638615608918, 0.27777955127024501, -0.22927675627685118, 0.47133043947122588], [0.98633096485626948, -0.67344233684153321, -0.55759479090990816, 0.95392042633643581]], [[0.98926847688099429, -0.099775998668338861, -0.38220886856369973, 0.30538447323514117], [0.4769519856326716, -0.93678787932837371, 0.23713788866934005, -0.039710268152491013], [0.9479451531859, -0.29175471478610504, 0.70374847469318591, 0.45115262591873062]]], [[[0.81351288943358235, -0.3670301216083045, -0.26084469022562451, -0.19412768911684464], [-0.77387156646633315, -0.0018219771195073786, 0.62751947270548869, 0.63243293117888832], [0.96618766991196492, -0.90165237989619973, 0.11374318928241434, 0.26911135553743204]], [[0.82323210574075234, -0.53634841475736783, -0.5667782787281912, -0.2378237881048284], [0.1765664584729234, 0.18583021463594585, -0.11567401544857003, -0.14016246157527679], [0.15134244191084112, -0.94560346887402424, 0.94835435091970544, -0.77704296677274565]]]]),self.functionspace) | |
24986 | arg1=Symbol(shape=(3, 2, 3, 4)) | |
24987 | res=maximum(arg0,arg1) | |
24988 | s1=numarray.array([[[[0.16899177524516928, -0.34732858643370546, -0.79882685938170694, -0.66038397595048615], [0.059068592737719916, -0.8830498377662197, 0.42039477387821811, 0.32883530186540688], [0.8004432686322831, 0.4513771244635616, 0.39893889542471173, 0.38953533377812555]], [[0.8549919640811019, 0.0085317390737900123, 0.9335898541916583, 0.098754781628490163], [0.66089186768623187, 0.84486059895315635, -0.49885852697655153, 0.68792401902966405], [-0.17004486075932879, -0.033475700920452045, -0.0082240694292592398, -0.97121871328749743]]], [[[-0.64603684287873531, -0.67737694403929827, -0.17922106732871224, -0.91211139825890175], [-0.4553044126204413, 0.074503564238266096, -0.21232591403526246, -0.059843420314997564], [-0.38994792354603125, -0.28399207815642069, -0.19705530292188755, -0.18417115963918018]], [[-0.018546350001871215, -0.35927915222869711, -0.27093146477076302, 0.21888297390394529], [0.16698354221314671, -0.77658313684702263, -0.72342182944478717, -0.41851758261220473], [-0.73791291651917956, 0.95640694294369277, 0.79377010505148649, 0.9488141093625535]]], [[[-0.7879905919921153, -0.47441581145629574, -0.75295386253986418, 0.50309712614614854], [0.85117753483747327, 0.16901189435505559, 0.27950826734646883, 0.927929405822288], [-0.11332190163979683, -0.90078094125877928, 0.015048983765326485, -0.35804541069235873]], [[-0.44383068491491673, 0.73699838067473666, -0.16448971670195967, 0.63214802470153497], [-0.030217824939371418, -0.55117960400873911, 0.7891485388245143, -0.020033647442706304], [0.74505558968503083, -0.051569338830459222, -0.54218896195541788, 0.23706541588721119]]]]) | |
24989 | sub=res.substitute({arg1:s1}) | |
24990 | ref=Data(numarray.array([[[[0.16899177524516928, 0.57743427123415247, -0.47743748205799741, -0.25860465344987116], [0.059068592737719916, 0.11397059023125844, 0.42039477387821811, 0.32883530186540688], [0.8004432686322831, 0.4513771244635616, 0.39893889542471173, 0.94387770790006087]], [[0.8549919640811019, 0.54406435609557624, 0.9335898541916583, 0.098754781628490163], [0.66089186768623187, 0.84486059895315635, -0.14370791133432848, 0.68792401902966405], [0.57423763420356289, -0.033475700920452045, -0.0082240694292592398, 0.60815013943825491]]], [[[-0.38932408289704612, 0.14626247172828211, -0.17922106732871224, -0.17668123573312444], [0.85536638615608918, 0.27777955127024501, -0.21232591403526246, 0.47133043947122588], [0.98633096485626948, -0.28399207815642069, -0.19705530292188755, 0.95392042633643581]], [[0.98926847688099429, -0.099775998668338861, -0.27093146477076302, 0.30538447323514117], [0.4769519856326716, -0.77658313684702263, 0.23713788866934005, -0.039710268152491013], [0.9479451531859, 0.95640694294369277, 0.79377010505148649, 0.9488141093625535]]], [[[0.81351288943358235, -0.3670301216083045, -0.26084469022562451, 0.50309712614614854], [0.85117753483747327, 0.16901189435505559, 0.62751947270548869, 0.927929405822288], [0.96618766991196492, -0.90078094125877928, 0.11374318928241434, 0.26911135553743204]], [[0.82323210574075234, 0.73699838067473666, -0.16448971670195967, 0.63214802470153497], [0.1765664584729234, 0.18583021463594585, 0.7891485388245143, -0.020033647442706304], [0.74505558968503083, -0.051569338830459222, 0.94835435091970544, 0.23706541588721119]]]]),self.functionspace) | |
24991 | self.failUnless(isinstance(res,Symbol),"wrong type of result.") | |
24992 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
24993 | self.failUnless(Lsup(sub-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
24994 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
24995 | def test_maximum_constData_rank0_constData_rank4(self): | |
24996 | arg0=Data(-0.893686645203,self.functionspace) | |
24997 | arg1=Data(numarray.array([[[[0.61638843267588261, -0.97285254339522864, 0.39019707596035991, -0.38329856435815723], [-0.39669633259426185, -0.43633677524387782, -0.062118904024617283, 0.52486356486440955], [0.59806243722015462, -0.95562790660740671, 0.89716362287428741, 0.25616048508546663]], [[0.24435399713825645, 0.58840030186856374, -0.11669001468268436, -0.10473414559607241], [0.53850954948156304, -0.21927908342820301, 0.5308446295654845, -0.14536822578932429], [0.90594574080059331, 0.77607397603230743, 0.34830152058308195, 0.53599148614980741]]], [[[0.84897407852148055, -0.54152647293785039, 0.93603932280166657, 0.8311250335877951], [-0.048354616437206177, 0.82001605920812848, 0.92696057539180776, -0.08827000636161686], [0.020618916247708174, 0.98375130765872387, 0.8200458168780016, -0.053631253048684435]], [[-0.37789023552666512, 0.052215678410592714, -0.18675922076149987, 0.43345944086720611], [-0.30827748070532701, -0.66668820782501603, 0.084841064566959279, -0.95519159649105756], [-0.6725560045726664, -0.53620416688473016, -0.25767276940639294, 0.58749559487682013]]], [[[-0.19257594002810241, 0.72549845431588622, 0.39704918849500959, 0.61577341276098552], [0.70773259021309665, -0.22540767589709043, -0.031031950353477278, -0.33370198061247858], [-0.8280003728298464, -0.81439343811994092, 0.95962098528552975, 0.50268932526386201]], [[-0.37240249982818407, -0.92063840650310702, 0.12378723541570058, -0.75766552223525885], [-0.8507935520807457, 0.40017389307358187, -0.23436141671947053, 0.5452149596180087], [0.49123509401676135, -0.2193283129711836, 0.29665843719288354, -0.61641191860539335]]]]),self.functionspace) | |
24998 | res=maximum(arg0,arg1) | |
24999 | ref=Data(numarray.array([[[[0.61638843267588261, -0.89368664520320795, 0.39019707596035991, -0.38329856435815723], [-0.39669633259426185, -0.43633677524387782, -0.062118904024617283, 0.52486356486440955], [0.59806243722015462, -0.89368664520320795, 0.89716362287428741, 0.25616048508546663]], [[0.24435399713825645, 0.58840030186856374, -0.11669001468268436, -0.10473414559607241], [0.53850954948156304, -0.21927908342820301, 0.5308446295654845, -0.14536822578932429], [0.90594574080059331, 0.77607397603230743, 0.34830152058308195, 0.53599148614980741]]], [[[0.84897407852148055, -0.54152647293785039, 0.93603932280166657, 0.8311250335877951], [-0.048354616437206177, 0.82001605920812848, 0.92696057539180776, -0.08827000636161686], [0.020618916247708174, 0.98375130765872387, 0.8200458168780016, -0.053631253048684435]], [[-0.37789023552666512, 0.052215678410592714, -0.18675922076149987, 0.43345944086720611], [-0.30827748070532701, -0.66668820782501603, 0.084841064566959279, -0.89368664520320795], [-0.6725560045726664, -0.53620416688473016, -0.25767276940639294, 0.58749559487682013]]], [[[-0.19257594002810241, 0.72549845431588622, 0.39704918849500959, 0.61577341276098552], [0.70773259021309665, -0.22540767589709043, -0.031031950353477278, -0.33370198061247858], [-0.8280003728298464, -0.81439343811994092, 0.95962098528552975, 0.50268932526386201]], [[-0.37240249982818407, -0.89368664520320795, 0.12378723541570058, -0.75766552223525885], [-0.8507935520807457, 0.40017389307358187, -0.23436141671947053, 0.5452149596180087], [0.49123509401676135, -0.2193283129711836, 0.29665843719288354, -0.61641191860539335]]]]),self.functionspace) | |
25000 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
25001 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
25002 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
25003 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
25004 | def test_maximum_constData_rank4_constData_rank4(self): | |
25005 | arg0=Data(numarray.array([[[[0.96485565509648352, 0.53935464926562759, 0.53077936146728266, -0.73952245406800854], [-0.60881766722021902, 0.66032495037649741, 0.93304470628387515, -0.29318048118189055], [-0.66535631878242762, 0.86695831494535347, -0.14571574174128665, -0.33755901373168684]], [[0.10130701439391632, -0.17559510038495674, 0.48296274631000302, -0.57408428494447028], [-0.27410670377127633, 0.17219315446797312, -0.60634684633721503, 0.20140988897507128], [0.063883370598835532, 0.062627983781888386, -0.2846290129863831, 0.15747009011324331]]], [[[-0.33786498745323823, -0.77773342159826253, -0.43944390559155377, 0.30699880066796359], [0.45721299355990963, -0.93225225636245979, 0.24951116488168035, -0.60399840561802765], [-0.98061260494043778, -0.75645258975794905, 0.27958959667741956, 0.087975846205211594]], [[0.66543448707063324, 0.85514480449431862, 0.82014945665654015, 0.81505258529464553], [0.36193943466925615, -0.43856446384821646, -0.28386557764570841, -0.44311355588507073], [0.8203258501802293, 0.88410934322225532, -0.42070109791391741, 0.095773374554660284]]], [[[-0.27073826415250957, 0.66740636068176817, -0.48896464867053013, -0.94994837491554485], [0.6540939867398663, 0.3623199797026595, -0.46325457322592967, -0.018711908974897273], [-0.35561156732560661, 0.41410104364264733, -0.17250699705434713, -0.25548148839396423]], [[-0.52110139543812939, -0.48803425309908843, 0.96222057216100421, -0.53953717021125525], [-0.50454727047867465, 0.66698964265585015, -0.15287504292958864, 0.50355653533991096], [0.83323461461179282, 0.62448988217093437, 0.4654771267287694, 0.72161921224557446]]]]),self.functionspace) | |
25006 | arg1=Data(numarray.array([[[[-0.57504027263496882, -0.70962427655760041, 0.5000686248515589, 0.22836735474708636], [-0.2456640208529155, 0.55145194339939985, -0.18188128973631157, -0.010052160520559017], [-0.67026258406375816, -0.097417557973243252, 0.78510475463922025, -0.96873477555278131]], [[-0.10002520261013537, 0.63100857099364571, -0.37013228408685617, -0.59175793402432819], [0.77337490554492994, 0.46196627477364838, -0.64798814992967224, 0.60516599121325076], [-0.0017246851860892587, -0.30784264595534161, -0.65209147103284981, -0.88757120178936799]]], [[[0.80040151821525596, 0.43450571239861646, 0.0078842302106048034, -0.55464057489099483], [0.84844302837406849, 0.48335761669393862, 0.018983703352744907, 0.89616530091553726], [-0.57373660097290591, -0.84825568142179031, -0.35092918722312461, 0.92340153576769501]], [[-0.85244829995021609, 0.095947521825416882, -0.18971802853754727, -0.65909953891892914], [0.11749664922727288, 0.13980571669569475, -0.79988329726892982, 0.055016274898991968], [0.35743533014846873, 0.27824733541877245, 0.42999566458196914, 0.3568350967844669]]], [[[0.99608799667364067, -0.5403793610139318, -0.12575108132177171, 0.41721666984548333], [0.875733275967848, 0.9523625165119125, -0.20675560052583641, -0.41564394921784187], [-0.84876383654236665, 0.62662285663526829, 0.49660771467477982, 0.5918409282574939]], [[-0.4729461618005697, -0.64161728948155772, 0.65333699389309863, 0.49984898391509858], [0.43829686077623897, 0.33192534406508289, 0.61100656789543994, 0.073960447209926006], [0.78875551306588365, -0.25000292972836191, 0.99289944129181062, -0.54605870017388525]]]]),self.functionspace) | |
25007 | res=maximum(arg0,arg1) | |
25008 | ref=Data(numarray.array([[[[0.96485565509648352, 0.53935464926562759, 0.53077936146728266, 0.22836735474708636], [-0.2456640208529155, 0.66032495037649741, 0.93304470628387515, -0.010052160520559017], [-0.66535631878242762, 0.86695831494535347, 0.78510475463922025, -0.33755901373168684]], [[0.10130701439391632, 0.63100857099364571, 0.48296274631000302, -0.57408428494447028], [0.77337490554492994, 0.46196627477364838, -0.60634684633721503, 0.60516599121325076], [0.063883370598835532, 0.062627983781888386, -0.2846290129863831, 0.15747009011324331]]], [[[0.80040151821525596, 0.43450571239861646, 0.0078842302106048034, 0.30699880066796359], [0.84844302837406849, 0.48335761669393862, 0.24951116488168035, 0.89616530091553726], [-0.57373660097290591, -0.75645258975794905, 0.27958959667741956, 0.92340153576769501]], [[0.66543448707063324, 0.85514480449431862, 0.82014945665654015, 0.81505258529464553], [0.36193943466925615, 0.13980571669569475, -0.28386557764570841, 0.055016274898991968], [0.8203258501802293, 0.88410934322225532, 0.42999566458196914, 0.3568350967844669]]], [[[0.99608799667364067, 0.66740636068176817, -0.12575108132177171, 0.41721666984548333], [0.875733275967848, 0.9523625165119125, -0.20675560052583641, -0.018711908974897273], [-0.35561156732560661, 0.62662285663526829, 0.49660771467477982, 0.5918409282574939]], [[-0.4729461618005697, -0.48803425309908843, 0.96222057216100421, 0.49984898391509858], [0.43829686077623897, 0.66698964265585015, 0.61100656789543994, 0.50355653533991096], [0.83323461461179282, 0.62448988217093437, 0.99289944129181062, 0.72161921224557446]]]]),self.functionspace) | |
25009 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
25010 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
25011 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
25012 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
25013 | def test_maximum_constData_rank0_expandedData_rank4(self): | |
25014 | arg0=Data(0.216711670991,self.functionspace) | |
25015 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
25016 | arg1=msk_arg1*numarray.array([[[[-0.81879161478097595, 0.23338466982083461, -0.037340658437786667, 0.53960130549007368], [-0.8433547141558082, 0.51986550271704757, -0.22844534933352723, -0.89465705240856908], [-0.11648963460000861, -0.96923924737633538, 0.072867751072468012, 0.65625904184925732]], [[0.27849706772004201, -0.90647830830724296, 0.96202673895146806, 0.22494056179803157], [-0.2684069854476685, -0.42191439566230504, -0.95625432477352734, 0.72510262095158207], [-0.036924511893698497, -0.93553684683379412, -0.76943122405185593, 0.42971341646797767]]], [[[0.89494738055097778, 0.46650780268669378, 0.30405300775028121, -0.084542513395697849], [-0.027722135654347779, -0.59483396322557391, -0.028304510159490759, -0.88731646326202407], [0.34624637943920167, -0.39682309028436302, 0.89367998074843014, 0.56073508085183299]], [[0.63023798830300204, 0.18652798267686688, -0.3328850324391277, -0.21182328663126193], [-0.53239281368561087, 0.22479105625018425, 0.90626113618872939, -7.4251614887721473e-05], [-0.98623780619390233, -0.5666180903186695, -0.30927062686357099, -0.79727648923625138]]], [[[0.59536350392532866, 0.22068473036479674, -0.66623026326771462, 0.10843352912766102], [0.52432284313983835, -0.3431109607082834, -0.23886295117126921, -0.8119295310297503], [-0.54397735011730486, -0.7068782977204644, 0.71740443446430424, -0.31144890281105586]], [[-0.32351391151939302, -0.35563858193171405, 0.65601036166328086, -0.032917953499258745], [0.45870081001448093, 0.3006509634165655, -0.15553712418631416, 0.85594927731050774], [-0.84241444057987591, -0.64337027261577129, 0.32134231645586109, -0.39606743840399128]]]])+(1.-msk_arg1)*numarray.array([[[[0.55712979668912488, -0.80066523551532121, -0.48656514655750849, 0.76097556013292111], [-0.13438565652155154, -0.94821563688317712, -0.31012625194007182, -0.84105859136182715], [-0.20208116248301411, -0.50024164072503563, 0.87481453005108034, 0.13755575289800137]], [[-0.085598442928114249, -0.45841913232395637, -0.18238598324276789, 0.62303900657350142], [-0.79318456738858467, 0.34558408974177413, -0.8550879149504329, 0.8287523579134235], [-0.40328058936497357, -0.83102127169123086, -0.21653057906368112, -0.76688016358972666]]], [[[0.68068340217757584, 0.57860355650918649, -0.19514598498967861, 0.35797229868730107], [-0.940274604582233, -0.52273338186671348, -0.37314192021830439, 0.10804775393755039], [-0.20074283030723383, 0.95964123909155385, -0.98950080490821501, -0.58835700500290256]], [[0.99348893772020896, 0.85220955503331552, 0.41443782029517151, 0.83659124171927268], [-0.65635663807364564, 0.70812110348599355, 0.13053831014253792, 0.91230146888102226], [0.19243965515044836, 0.96567248884233092, -0.28016453566744892, -0.65082014990966219]]], [[[-0.013133698627046275, -0.9481821696335877, 0.63769890160711773, -0.35875665803034429], [-0.65944938772191586, 0.01066509243901459, 0.17762038374459466, -0.21321783232210256], [0.99670034374764271, 0.67813675209818114, 0.37840221867825585, 0.45475310270530489]], [[0.29249236353371622, -0.51219658392539991, 0.22458795099500506, -0.29060307474253499], [-0.86387736284336181, -0.17064143853256808, -0.45438045421185458, 0.9948613071200707], [-0.38789172342813538, 0.052527231540111297, 0.81849101524424928, 0.43381945218064333]]]]) | |
25017 | res=maximum(arg0,arg1) | |
25018 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
25019 | ref=msk_ref*numarray.array([[[[0.21671167099079991, 0.23338466982083461, 0.21671167099079991, 0.53960130549007368], [0.21671167099079991, 0.51986550271704757, 0.21671167099079991, 0.21671167099079991], [0.21671167099079991, 0.21671167099079991, 0.21671167099079991, 0.65625904184925732]], [[0.27849706772004201, 0.21671167099079991, 0.96202673895146806, 0.22494056179803157], [0.21671167099079991, 0.21671167099079991, 0.21671167099079991, 0.72510262095158207], [0.21671167099079991, 0.21671167099079991, 0.21671167099079991, 0.42971341646797767]]], [[[0.89494738055097778, 0.46650780268669378, 0.30405300775028121, 0.21671167099079991], [0.21671167099079991, 0.21671167099079991, 0.21671167099079991, 0.21671167099079991], [0.34624637943920167, 0.21671167099079991, 0.89367998074843014, 0.56073508085183299]], [[0.63023798830300204, 0.21671167099079991, 0.21671167099079991, 0.21671167099079991], [0.21671167099079991, 0.22479105625018425, 0.90626113618872939, 0.21671167099079991], [0.21671167099079991, 0.21671167099079991, 0.21671167099079991, 0.21671167099079991]]], [[[0.59536350392532866, 0.22068473036479674, 0.21671167099079991, 0.21671167099079991], [0.52432284313983835, 0.21671167099079991, 0.21671167099079991, 0.21671167099079991], [0.21671167099079991, 0.21671167099079991, 0.71740443446430424, 0.21671167099079991]], [[0.21671167099079991, 0.21671167099079991, 0.65601036166328086, 0.21671167099079991], [0.45870081001448093, 0.3006509634165655, 0.21671167099079991, 0.85594927731050774], [0.21671167099079991, 0.21671167099079991, 0.32134231645586109, 0.21671167099079991]]]])+(1.-msk_ref)*numarray.array([[[[0.55712979668912488, 0.21671167099079991, 0.21671167099079991, 0.76097556013292111], [0.21671167099079991, 0.21671167099079991, 0.21671167099079991, 0.21671167099079991], [0.21671167099079991, 0.21671167099079991, 0.87481453005108034, 0.21671167099079991]], [[0.21671167099079991, 0.21671167099079991, 0.21671167099079991, 0.62303900657350142], [0.21671167099079991, 0.34558408974177413, 0.21671167099079991, 0.8287523579134235], [0.21671167099079991, 0.21671167099079991, 0.21671167099079991, 0.21671167099079991]]], [[[0.68068340217757584, 0.57860355650918649, 0.21671167099079991, 0.35797229868730107], [0.21671167099079991, 0.21671167099079991, 0.21671167099079991, 0.21671167099079991], [0.21671167099079991, 0.95964123909155385, 0.21671167099079991, 0.21671167099079991]], [[0.99348893772020896, 0.85220955503331552, 0.41443782029517151, 0.83659124171927268], [0.21671167099079991, 0.70812110348599355, 0.21671167099079991, 0.91230146888102226], [0.21671167099079991, 0.96567248884233092, 0.21671167099079991, 0.21671167099079991]]], [[[0.21671167099079991, 0.21671167099079991, 0.63769890160711773, 0.21671167099079991], [0.21671167099079991, 0.21671167099079991, 0.21671167099079991, 0.21671167099079991], [0.99670034374764271, 0.67813675209818114, 0.37840221867825585, 0.45475310270530489]], [[0.29249236353371622, 0.21671167099079991, 0.22458795099500506, 0.21671167099079991], [0.21671167099079991, 0.21671167099079991, 0.21671167099079991, 0.9948613071200707], [0.21671167099079991, 0.21671167099079991, 0.81849101524424928, 0.43381945218064333]]]]) | |
25020 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
25021 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
25022 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
25023 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
25024 | def test_maximum_constData_rank4_expandedData_rank4(self): | |
25025 | arg0=Data(numarray.array([[[[0.9662251484946478, -0.26481381091852141, -0.066210160157844644, 0.40117951882974068], [0.2455027289465177, 0.67324997630420214, 0.79365479453824861, -0.037015541405008623], [-0.86030987461175457, -0.45616271741243231, 0.39179913013670342, -0.10731696095517629]], [[-0.19449522639452876, -0.67751174669485992, 0.28984158743095256, 0.67531831661784203], [-0.49980904983410723, -0.02577831866914404, 0.94104429684279367, 0.74763465415851904], [-0.28985388443946092, -0.90882129286702029, -0.90352359388616366, 0.0516463980384263]]], [[[-0.99639029481638874, 0.23581131279953027, 0.73436613098786441, 0.89956373143685453], [0.70388018442763145, 0.079895063328745408, -0.75367452457404527, 0.56811816966845319], [0.90284242548995652, 0.66397516482541619, -0.99647484543635345, 0.79709159927353346]], [[0.70723973142155505, 0.27467701034793879, -0.79995723813418396, -0.24824137685387848], [0.56082965044735578, 0.73559725370917817, 0.62475940100976302, 0.030745279822806282], [-0.36016041397070708, 0.7839330226446426, -0.69945965257975473, -0.89855265013928132]]], [[[0.33431193949654969, -0.46895691087357716, 0.94874414920913108, 0.35408330328067761], [-0.56725159045543427, -0.11646626979600483, -0.27664126953599744, -0.62696292984368651], [0.15060075336069922, -0.16895232031523566, -0.83212543422584218, 0.37516376063681012]], [[-0.21699302716045343, -0.24013090348080812, 0.73993829114859677, -0.63476480682303671], [-0.34968439152048214, 0.46819693714489508, 0.62165805854076095, -0.3791178743428667], [-0.41700973768159155, 0.79899832669176507, -0.86119824926464239, 0.46575159472502037]]]]),self.functionspace) | |
25026 | msk_arg1=whereNegative(self.functionspace.getX()[0]-0.5) | |
25027 | arg1=msk_arg1*numarray.array([[[[-0.31931488193208657, -0.28905671753527695, 0.85561932051536327, 0.43258332189744197], [-0.022093948889682302, -0.87293800937103039, 0.56614871319438853, 0.86910428719314292], [0.68092117827772292, 0.53186005878844611, 0.28162238085357139, 0.97361457365289072]], [[-0.79666566403785954, 0.37011155709186694, -0.68233116747040423, 0.89387098751104865], [0.42703403901311821, 0.89550507893657039, 0.84501584710121325, -0.66998942788818261], [0.53860906470280701, -0.094095450408768766, -0.35365080444144259, 0.4361075442378417]]], [[[-0.16099982532347235, -0.8651116694760872, 0.52385238626653319, -0.28446906365453173], [0.14671592161598701, 0.71409402259173094, 0.3258739797599115, 0.70362092527950693], [-0.32717756310317503, -0.95828422715748962, 0.68727489580226919, 0.15249900882725109]], [[0.22017885162589113, 0.80937795601648843, 0.35945120041216438, 0.93900043111170084], [0.79190649660945756, 0.57203937052107467, 0.54292126003639929, 0.84571132339638178], [0.23760803956899457, 0.52713270420645153, -0.24975442892820454, -0.72715475618178438]]], [[[-0.84787512935758658, -0.62122949761588964, 0.68568216243118529, 0.34087206419913829], [-0.66077267614956314, 0.88586283683410505, 0.48865077882965502, -0.2823801328248261], [0.24010264814531568, -0.77577498913372622, -0.55288042007565297, -0.34642896895972042]], [[-0.42554067083401659, 0.87743453278083261, 0.50397543167721515, 0.97556159346990001], [0.84530378175248244, 0.66561045498275107, 0.80033289693830301, 0.92226186452120906], [-0.4442108477506006, -0.52692217686024989, -0.85590042003205369, 0.43455207703783549]]]])+(1.-msk_arg1)*numarray.array([[[[0.21605231242464118, 0.32170152972234489, 0.69540488109778908, 0.2547128534596883], [0.34796901405025005, -0.31607291081984523, -0.98038121857023519, -0.93906508361402574], [-0.28276602806278417, -0.62275848697078584, -0.26878568593014385, -0.22758564658522573]], [[0.85908277675070277, 0.70033299040044406, 0.93445045187257891, -0.75943811515314663], [0.50550467560364476, -0.89661957212631349, -0.20586932595053264, 0.74555292517790739], [-0.46974519139411886, -0.064153765304233668, -0.5695552407484461, -0.11199926962703399]]], [[[-0.046076882407277919, -0.4751273456616687, 0.54211989560690821, -0.95839866060661283], [-0.34429450468712863, 0.9945935413627196, 0.12045306605821482, 0.70763311498764381], [-0.93229388462703189, -0.8159573239034752, 0.43375216165599206, -0.58156200439008288]], [[-0.94359110518590672, 0.21676492225881594, -0.57979669038590131, 0.035244336548687416], [-0.13786684734995425, 0.75386861643073622, 0.022898320967623453, 0.66532275876665459], [-0.30607908894667135, -0.066287086564079223, -0.64210438699958949, 0.58486901207821607]]], [[[0.69742093261447113, 0.77935504242461695, 0.28045816177452632, 0.35225109286857292], [-0.96809103221557291, 0.77688458560421636, 0.92713086412266987, 0.49029829063110997], [-0.1905974439471938, 0.14508130554930188, 0.24154428575645048, 0.45490680510213011]], [[-0.021068579578790381, -0.055644755704836957, -0.71431963870922144, -0.65498904995738161], [0.87855331454880914, 0.53311774880814933, 0.18160214068170566, -0.33338460760283883], [-0.49933663079121393, -0.30118428496778038, 0.86142651573184215, -0.99665689200339136]]]]) | |
25028 | res=maximum(arg0,arg1) | |
25029 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
25030 | ref=msk_ref*numarray.array([[[[0.9662251484946478, -0.26481381091852141, 0.85561932051536327, 0.43258332189744197], [0.2455027289465177, 0.67324997630420214, 0.79365479453824861, 0.86910428719314292], [0.68092117827772292, 0.53186005878844611, 0.39179913013670342, 0.97361457365289072]], [[-0.19449522639452876, 0.37011155709186694, 0.28984158743095256, 0.89387098751104865], [0.42703403901311821, 0.89550507893657039, 0.94104429684279367, 0.74763465415851904], [0.53860906470280701, -0.094095450408768766, -0.35365080444144259, 0.4361075442378417]]], [[[-0.16099982532347235, 0.23581131279953027, 0.73436613098786441, 0.89956373143685453], [0.70388018442763145, 0.71409402259173094, 0.3258739797599115, 0.70362092527950693], [0.90284242548995652, 0.66397516482541619, 0.68727489580226919, 0.79709159927353346]], [[0.70723973142155505, 0.80937795601648843, 0.35945120041216438, 0.93900043111170084], [0.79190649660945756, 0.73559725370917817, 0.62475940100976302, 0.84571132339638178], [0.23760803956899457, 0.7839330226446426, -0.24975442892820454, -0.72715475618178438]]], [[[0.33431193949654969, -0.46895691087357716, 0.94874414920913108, 0.35408330328067761], [-0.56725159045543427, 0.88586283683410505, 0.48865077882965502, -0.2823801328248261], [0.24010264814531568, -0.16895232031523566, -0.55288042007565297, 0.37516376063681012]], [[-0.21699302716045343, 0.87743453278083261, 0.73993829114859677, 0.97556159346990001], [0.84530378175248244, 0.66561045498275107, 0.80033289693830301, 0.92226186452120906], [-0.41700973768159155, 0.79899832669176507, -0.85590042003205369, 0.46575159472502037]]]])+(1.-msk_ref)*numarray.array([[[[0.9662251484946478, 0.32170152972234489, 0.69540488109778908, 0.40117951882974068], [0.34796901405025005, 0.67324997630420214, 0.79365479453824861, -0.037015541405008623], [-0.28276602806278417, -0.45616271741243231, 0.39179913013670342, -0.10731696095517629]], [[0.85908277675070277, 0.70033299040044406, 0.93445045187257891, 0.67531831661784203], [0.50550467560364476, -0.02577831866914404, 0.94104429684279367, 0.74763465415851904], [-0.28985388443946092, -0.064153765304233668, -0.5695552407484461, 0.0516463980384263]]], [[[-0.046076882407277919, 0.23581131279953027, 0.73436613098786441, 0.89956373143685453], [0.70388018442763145, 0.9945935413627196, 0.12045306605821482, 0.70763311498764381], [0.90284242548995652, 0.66397516482541619, 0.43375216165599206, 0.79709159927353346]], [[0.70723973142155505, 0.27467701034793879, -0.57979669038590131, 0.035244336548687416], [0.56082965044735578, 0.75386861643073622, 0.62475940100976302, 0.66532275876665459], [-0.30607908894667135, 0.7839330226446426, -0.64210438699958949, 0.58486901207821607]]], [[[0.69742093261447113, 0.77935504242461695, 0.94874414920913108, 0.35408330328067761], [-0.56725159045543427, 0.77688458560421636, 0.92713086412266987, 0.49029829063110997], [0.15060075336069922, 0.14508130554930188, 0.24154428575645048, 0.45490680510213011]], [[-0.021068579578790381, -0.055644755704836957, 0.73993829114859677, -0.63476480682303671], [0.87855331454880914, 0.53311774880814933, 0.62165805854076095, -0.33338460760283883], [-0.41700973768159155, 0.79899832669176507, 0.86142651573184215, 0.46575159472502037]]]]) | |
25031 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
25032 | self.failUnlessEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.") | |
25033 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
25034 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
25035 | def test_maximum_expandedData_rank0_float_rank0(self): | |
25036 | msk_arg0=whereNegative(self.functionspace.getX()[0]-0.5) | |
25037 | arg0=msk_arg0*(0.318576793935)+(1.-msk_arg0)*(-0.920315318998) | |
25038 | arg1=0.264453770493 | |
25039 | res=maximum(arg0,arg1) | |
25040 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
25041 | ref=msk_ref*(0.318576793935)+(1.-msk_ref)*(0.264453770493) | |
25042 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
25043 | self.failUnlessEqual(res.getShape(),(),"wrong shape of result.") | |
25044 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
25045 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
25046 | def test_maximum_expandedData_rank1_float_rank0(self): | |
25047 | msk_arg0=whereNegative(self.functionspace.getX()[0]-0.5) | |
25048 | arg0=msk_arg0*numarray.array([0.61984078319308633, -0.74126411397009218])+(1.-msk_arg0)*numarray.array([-0.36354960922197699, -0.45840304611368676]) | |
25049 | arg1=0.798333407454 | |
25050 | res=maximum(arg0,arg1) | |
25051 | msk_ref=whereNegative(self.functionspace.getX()[0]-0.5) | |
25052 | ref=msk_ref*numarray.array([0.79833340745371917, 0.79833340745371917])+(1.-msk_ref)*numarray.array([0.79833340745371917, 0.79833340745371917]) | |
25053 | self.failUnless(isinstance(res,Data),"wrong type of result.") | |
25054 | self.failUnlessEqual(res.getShape(),(2,),"wrong shape of result.") | |
25055 | self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result") | |
25056 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
25057 | def test_maximum_expandedData_rank2_float_rank0(self): | |
25058 | msk_arg0=whereNegative(self.functionspace.getX()[0]-0.5) | |
25059 | arg0=msk_arg0*numarray.array([[0.56027127038237556, -0.38092190445101282, -0.77591749903008322, -0.36171347397940457, -0.3091925404043383], [0.34776167092224908, -0.37902110057843474, 0.8566813057073317, -0.87799841344488661, 0.61149184516634381], [0.11264186928512365, 0.34551824833197631, 0.4058993843871157, 0.42214558457038209, -0.88397115089856348], [0.57017035572765851, -0.17472794481465992, -0.37739320194928472, 0.24459442745468318, -0.0032651849035065794]])+(1.-msk_arg0)*numarray.array([[-0.63041245210130414, -0.40539069241410175, 0.95484833881413089, 0.76528251808922398, -0.45472655311970289], [-0.34559052794751488, -0.91180569915010246, -0.08113468153701886, 0.31746466254664774, 0.69806708955802943], [0.76702933573803689, -0.24228609093935383, 0.35224880600670572, 0.47231857975553981, -0.88896833667212327], [-0.087726728409511789, -0.23153089968162344, 0.39249534318815371, 0.23502532808353349, 0.68373987182917317]]) | |