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

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

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

revision 429 by gross, Wed Jan 11 05:53:40 2006 UTC revision 433 by gross, Tue Jan 17 23:54:38 2006 UTC
# Line 1485  class Test_util_unary_with_tagged_data(T Line 1485  class Test_util_unary_with_tagged_data(T
1485        self.failUnless(isinstance(res,Data),"wrong type of result.")        self.failUnless(isinstance(res,Data),"wrong type of result.")
1486        self.failUnlessEqual(res.getShape(),(3, 2),"wrong shape of result.")        self.failUnlessEqual(res.getShape(),(3, 2),"wrong shape of result.")
1487        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")        self.failUnless(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
1488       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1489       def test_inverse_taggedData_dim1(self):
1490          arg=Data(numarray.array([[2.9250662348343939]]),self.functionspace)
1491          arg.setTaggedValue(1,numarray.array([[3.9569115924392309]]))
1492          res=inverse(arg)
1493          self.failUnless(isinstance(res,Data),"wrong type of result.")
1494          self.failUnlessEqual(res.getShape(),(1, 1),"wrong shape of result.")
1495          self.failUnless(Lsup(matrixmult(res,arg)-kronecker(1))<=self.RES_TOL,"wrong result")
1496       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1497       def test_inverse_taggedData_dim2(self):
1498          arg=Data(numarray.array([[2.1762682607002422, -0.78050782824831111], [-0.83510184055361858, 2.604492189120557]]),self.functionspace)
1499          arg.setTaggedValue(1,numarray.array([[3.6893612252828687, 0.18096456487937673], [0.89569960507470925, 3.3056638034950092]]))
1500          res=inverse(arg)
1501          self.failUnless(isinstance(res,Data),"wrong type of result.")
1502          self.failUnlessEqual(res.getShape(),(2, 2),"wrong shape of result.")
1503          self.failUnless(Lsup(matrixmult(res,arg)-kronecker(2))<=self.RES_TOL,"wrong result")
1504       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1505       def test_inverse_taggedData_dim3(self):
1506          arg=Data(numarray.array([[1.0566731035132446, -0.23529223422203982, -0.73657527200271922], [-0.90461086237095145, 2.3942152365412581, -0.0078023115760492701], [-0.32951652966235834, 0.5634604257647613, 1.716379935670141]]),self.functionspace)
1507          arg.setTaggedValue(1,numarray.array([[2.047257820397296, -0.099359655049029438, 0.2857664656803518], [0.87552190129350227, 3.9293973128822133, 0.1331903761748936], [-0.63398198479164769, -0.49699750938550524, 2.0757292701325061]]))
1508          res=inverse(arg)
1509          self.failUnless(isinstance(res,Data),"wrong type of result.")
1510          self.failUnlessEqual(res.getShape(),(3, 3),"wrong shape of result.")
1511          self.failUnless(Lsup(matrixmult(res,arg)-kronecker(3))<=self.RES_TOL,"wrong result")

Legend:
Removed from v.429  
changed lines
  Added in v.433

  ViewVC Help
Powered by ViewVC 1.1.26