/[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 587 by gross, Fri Mar 10 02:26:50 2006 UTC revision 588 by gross, Fri Mar 10 04:45:04 2006 UTC
# Line 1820  class Test_util_unary_with_tagged_data(T Line 1820  class Test_util_unary_with_tagged_data(T
1820        self.failUnless(Lsup(matrixmult(arg,res[1][:,0])-res[0][0]*res[1][:,0])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 0")        self.failUnless(Lsup(matrixmult(arg,res[1][:,0])-res[0][0]*res[1][:,0])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 0")
1821        self.failUnless(Lsup(matrixmult(arg,res[1][:,1])-res[0][1]*res[1][:,1])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 1")        self.failUnless(Lsup(matrixmult(arg,res[1][:,1])-res[0][1]*res[1][:,1])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 1")
1822        self.failUnless(Lsup(matrixmult(transpose(res[1]),res[1])-kronecker(2))<=self.RES_TOL,"eigenvectors are not orthonormal")        self.failUnless(Lsup(matrixmult(transpose(res[1]),res[1])-kronecker(2))<=self.RES_TOL,"eigenvectors are not orthonormal")
1823       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1824       def test_eigenvalues_and_eigenvectors_taggedData_dim3_case0(self):
1825          arg=Data(numarray.array([[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]),self.functionspace)
1826          arg.setTaggedValue(1,numarray.array([[10.0, 0.0, 0.0], [0.0, 10.0, 0.0], [0.0, 0.0, 10.0]]))
1827          res=eigenvalues_and_eigenvectors(arg)
1828          ref_ev=Data(numarray.array([0.0, 0.0, 0.0]),self.functionspace)
1829          ref_ev.setTaggedValue(1,numarray.array([10.0, 10.0, 10.0]))
1830          self.failUnless(isinstance(res[0],Data),"wrong type of result for eigenvalues.")
1831          self.failUnlessEqual(res[0].getShape(),(3,),"wrong shape of result for eigenvalues.")
1832          self.failUnless(isinstance(res[1],Data),"wrong type of result for eigenvectors.")
1833          self.failUnlessEqual(res[1].getShape(),(3, 3),"wrong shape of result for eigenvectors.")
1834          self.failUnless(Lsup(res[0]-ref_ev)<=self.RES_TOL*Lsup(ref_ev),"wrong eigenvalues")
1835          self.failUnless(Lsup(matrixmult(arg,res[1][:,0])-res[0][0]*res[1][:,0])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 0")
1836          self.failUnless(Lsup(matrixmult(arg,res[1][:,1])-res[0][1]*res[1][:,1])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 1")
1837          self.failUnless(Lsup(matrixmult(arg,res[1][:,2])-res[0][2]*res[1][:,2])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 2")
1838          self.failUnless(Lsup(matrixmult(transpose(res[1]),res[1])-kronecker(3))<=self.RES_TOL,"eigenvectors are not orthonormal")
1839       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1840       def test_eigenvalues_and_eigenvectors_taggedData_dim3_case10(self):
1841          arg=Data(numarray.array([[0.9, 0.0, 0.0], [0.0, 0.9, 0.0], [0.0, 0.0, 1.0]]),self.functionspace)
1842          arg.setTaggedValue(1,numarray.array([[0.9, 0.0, 0.0], [0.0, 0.97060899725040983, -0.045555123008643325], [0.0, -0.045555123008643339, 0.92939100274959041]]))
1843          res=eigenvalues_and_eigenvectors(arg)
1844          ref_ev=Data(numarray.array([0.9, 0.9, 1.0]),self.functionspace)
1845          ref_ev.setTaggedValue(1,numarray.array([0.9, 0.9, 1.0]))
1846          self.failUnless(isinstance(res[0],Data),"wrong type of result for eigenvalues.")
1847          self.failUnlessEqual(res[0].getShape(),(3,),"wrong shape of result for eigenvalues.")
1848          self.failUnless(isinstance(res[1],Data),"wrong type of result for eigenvectors.")
1849          self.failUnlessEqual(res[1].getShape(),(3, 3),"wrong shape of result for eigenvectors.")
1850          self.failUnless(Lsup(res[0]-ref_ev)<=self.RES_TOL*Lsup(ref_ev),"wrong eigenvalues")
1851          self.failUnless(Lsup(matrixmult(arg,res[1][:,0])-res[0][0]*res[1][:,0])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 0")
1852          self.failUnless(Lsup(matrixmult(arg,res[1][:,1])-res[0][1]*res[1][:,1])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 1")
1853          self.failUnless(Lsup(matrixmult(arg,res[1][:,2])-res[0][2]*res[1][:,2])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 2")
1854          self.failUnless(Lsup(matrixmult(transpose(res[1]),res[1])-kronecker(3))<=self.RES_TOL,"eigenvectors are not orthonormal")
1855       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1856       def test_eigenvalues_and_eigenvectors_taggedData_dim3_case12(self):
1857          arg=Data(numarray.array([[0.92694799760252555, 0.0, 0.044368966468320177], [0.0, 0.9, 0.0], [0.044368966468320184, 0.0, 0.97305200239747425]]),self.functionspace)
1858          arg.setTaggedValue(1,numarray.array([[1.0, 0.0, 0.0], [0.0, 0.9, 0.0], [0.0, 0.0, 0.9]]))
1859          res=eigenvalues_and_eigenvectors(arg)
1860          ref_ev=Data(numarray.array([0.9, 0.9, 1.0]),self.functionspace)
1861          ref_ev.setTaggedValue(1,numarray.array([0.9, 0.9, 1.0]))
1862          self.failUnless(isinstance(res[0],Data),"wrong type of result for eigenvalues.")
1863          self.failUnlessEqual(res[0].getShape(),(3,),"wrong shape of result for eigenvalues.")
1864          self.failUnless(isinstance(res[1],Data),"wrong type of result for eigenvectors.")
1865          self.failUnlessEqual(res[1].getShape(),(3, 3),"wrong shape of result for eigenvectors.")
1866          self.failUnless(Lsup(res[0]-ref_ev)<=self.RES_TOL*Lsup(ref_ev),"wrong eigenvalues")
1867          self.failUnless(Lsup(matrixmult(arg,res[1][:,0])-res[0][0]*res[1][:,0])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 0")
1868          self.failUnless(Lsup(matrixmult(arg,res[1][:,1])-res[0][1]*res[1][:,1])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 1")
1869          self.failUnless(Lsup(matrixmult(arg,res[1][:,2])-res[0][2]*res[1][:,2])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 2")
1870          self.failUnless(Lsup(matrixmult(transpose(res[1]),res[1])-kronecker(3))<=self.RES_TOL,"eigenvectors are not orthonormal")
1871       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1872       def test_eigenvalues_and_eigenvectors_taggedData_dim3_case14(self):
1873          arg=Data(numarray.array([[0.92379770619813639, 0.041031106298491521, -0.011396846732439278], [0.041031106298491535, 0.97074428392640366, -0.019650012730342326], [-0.011396846732439236, -0.019650012730342337, 0.90545800987545966]]),self.functionspace)
1874          arg.setTaggedValue(1,numarray.array([[1.0, 0.0, 0.0], [0.0, 1.1, 0.0], [0.0, 0.0, 1.1]]))
1875          res=eigenvalues_and_eigenvectors(arg)
1876          ref_ev=Data(numarray.array([0.9, 0.9, 1.0]),self.functionspace)
1877          ref_ev.setTaggedValue(1,numarray.array([1.0, 1.1, 1.1]))
1878          self.failUnless(isinstance(res[0],Data),"wrong type of result for eigenvalues.")
1879          self.failUnlessEqual(res[0].getShape(),(3,),"wrong shape of result for eigenvalues.")
1880          self.failUnless(isinstance(res[1],Data),"wrong type of result for eigenvectors.")
1881          self.failUnlessEqual(res[1].getShape(),(3, 3),"wrong shape of result for eigenvectors.")
1882          self.failUnless(Lsup(res[0]-ref_ev)<=self.RES_TOL*Lsup(ref_ev),"wrong eigenvalues")
1883          self.failUnless(Lsup(matrixmult(arg,res[1][:,0])-res[0][0]*res[1][:,0])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 0")
1884          self.failUnless(Lsup(matrixmult(arg,res[1][:,1])-res[0][1]*res[1][:,1])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 1")
1885          self.failUnless(Lsup(matrixmult(arg,res[1][:,2])-res[0][2]*res[1][:,2])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 2")
1886          self.failUnless(Lsup(matrixmult(transpose(res[1]),res[1])-kronecker(3))<=self.RES_TOL,"eigenvectors are not orthonormal")
1887       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1888       def test_eigenvalues_and_eigenvectors_taggedData_dim3_case17(self):
1889          arg=Data(numarray.array([[1.0269479976025255, 0.0, 0.044368966468320309], [0.0, 1.1, 0.0], [0.044368966468320295, 0.0, 1.0730520023974743]]),self.functionspace)
1890          arg.setTaggedValue(1,numarray.array([[1.1, 0.0, 0.0], [0.0, 1.0153410887977139, -0.036038311201720394], [0.0, -0.036038311201720373, 1.084658911202286]]))
1891          res=eigenvalues_and_eigenvectors(arg)
1892          ref_ev=Data(numarray.array([1.0, 1.1, 1.1]),self.functionspace)
1893          ref_ev.setTaggedValue(1,numarray.array([1.0, 1.1, 1.1]))
1894          self.failUnless(isinstance(res[0],Data),"wrong type of result for eigenvalues.")
1895          self.failUnlessEqual(res[0].getShape(),(3,),"wrong shape of result for eigenvalues.")
1896          self.failUnless(isinstance(res[1],Data),"wrong type of result for eigenvectors.")
1897          self.failUnlessEqual(res[1].getShape(),(3, 3),"wrong shape of result for eigenvectors.")
1898          self.failUnless(Lsup(res[0]-ref_ev)<=self.RES_TOL*Lsup(ref_ev),"wrong eigenvalues")
1899          self.failUnless(Lsup(matrixmult(arg,res[1][:,0])-res[0][0]*res[1][:,0])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 0")
1900          self.failUnless(Lsup(matrixmult(arg,res[1][:,1])-res[0][1]*res[1][:,1])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 1")
1901          self.failUnless(Lsup(matrixmult(arg,res[1][:,2])-res[0][2]*res[1][:,2])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 2")
1902          self.failUnless(Lsup(matrixmult(transpose(res[1]),res[1])-kronecker(3))<=self.RES_TOL,"eigenvectors are not orthonormal")
1903       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1904       def test_eigenvalues_and_eigenvectors_taggedData_dim3_case19(self):
1905          arg=Data(numarray.array([[1.035487967756175, 0.026317079185831614, -0.039960133424212368], [0.026317079185831618, 1.0892641940924184, 0.016301362071911414], [-0.039960133424212355, 0.016301362071911431, 1.0752478381514063]]),self.functionspace)
1906          arg.setTaggedValue(1,numarray.array([[1.0, 0.0, 0.0], [0.0, 2.0, 0.0], [0.0, 0.0, 3.0]]))
1907          res=eigenvalues_and_eigenvectors(arg)
1908          ref_ev=Data(numarray.array([1.0, 1.1, 1.1]),self.functionspace)
1909          ref_ev.setTaggedValue(1,numarray.array([1.0, 2.0, 3.0]))
1910          self.failUnless(isinstance(res[0],Data),"wrong type of result for eigenvalues.")
1911          self.failUnlessEqual(res[0].getShape(),(3,),"wrong shape of result for eigenvalues.")
1912          self.failUnless(isinstance(res[1],Data),"wrong type of result for eigenvectors.")
1913          self.failUnlessEqual(res[1].getShape(),(3, 3),"wrong shape of result for eigenvectors.")
1914          self.failUnless(Lsup(res[0]-ref_ev)<=self.RES_TOL*Lsup(ref_ev),"wrong eigenvalues")
1915          self.failUnless(Lsup(matrixmult(arg,res[1][:,0])-res[0][0]*res[1][:,0])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 0")
1916          self.failUnless(Lsup(matrixmult(arg,res[1][:,1])-res[0][1]*res[1][:,1])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 1")
1917          self.failUnless(Lsup(matrixmult(arg,res[1][:,2])-res[0][2]*res[1][:,2])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 2")
1918          self.failUnless(Lsup(matrixmult(transpose(res[1]),res[1])-kronecker(3))<=self.RES_TOL,"eigenvectors are not orthonormal")
1919       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1920       def test_eigenvalues_and_eigenvectors_taggedData_dim3_case21(self):
1921          arg=Data(numarray.array([[1.0, 0.0, 0.0], [0.0, 2.7060899725040968, -0.45555123008643206], [0.0, -0.45555123008643228, 2.2939100274959037]]),self.functionspace)
1922          arg.setTaggedValue(1,numarray.array([[1.5389599520505153, 0.0, 0.88737932936638753], [0.0, 2.0, 0.0], [0.88737932936638753, 0.0, 2.4610400479494858]]))
1923          res=eigenvalues_and_eigenvectors(arg)
1924          ref_ev=Data(numarray.array([1.0, 2.0, 3.0]),self.functionspace)
1925          ref_ev.setTaggedValue(1,numarray.array([1.0, 2.0, 3.0]))
1926          self.failUnless(isinstance(res[0],Data),"wrong type of result for eigenvalues.")
1927          self.failUnlessEqual(res[0].getShape(),(3,),"wrong shape of result for eigenvalues.")
1928          self.failUnless(isinstance(res[1],Data),"wrong type of result for eigenvectors.")
1929          self.failUnlessEqual(res[1].getShape(),(3, 3),"wrong shape of result for eigenvectors.")
1930          self.failUnless(Lsup(res[0]-ref_ev)<=self.RES_TOL*Lsup(ref_ev),"wrong eigenvalues")
1931          self.failUnless(Lsup(matrixmult(arg,res[1][:,0])-res[0][0]*res[1][:,0])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 0")
1932          self.failUnless(Lsup(matrixmult(arg,res[1][:,1])-res[0][1]*res[1][:,1])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 1")
1933          self.failUnless(Lsup(matrixmult(arg,res[1][:,2])-res[0][2]*res[1][:,2])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 2")
1934          self.failUnless(Lsup(matrixmult(transpose(res[1]),res[1])-kronecker(3))<=self.RES_TOL,"eigenvectors are not orthonormal")
1935       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1936       def test_eigenvalues_and_eigenvectors_taggedData_dim3_case23(self):
1937          arg=Data(numarray.array([[3.0, 0.0, 0.0], [0.0, 1.153410887977139, -0.36038311201720391], [0.0, -0.36038311201720391, 1.8465891120228608]]),self.functionspace)
1938          arg.setTaggedValue(1,numarray.array([[1.5928567395431172, 0.67348185484323142, -0.51356980156651744], [0.67348185484323153, 2.6000847801882254, -0.033486506584313548], [-0.51356980156651744, -0.033486506584313541, 1.8070584802686565]]))
1939          res=eigenvalues_and_eigenvectors(arg)
1940          ref_ev=Data(numarray.array([1.0, 2.0, 3.0]),self.functionspace)
1941          ref_ev.setTaggedValue(1,numarray.array([1.0, 2.0, 3.0]))
1942          self.failUnless(isinstance(res[0],Data),"wrong type of result for eigenvalues.")
1943          self.failUnlessEqual(res[0].getShape(),(3,),"wrong shape of result for eigenvalues.")
1944          self.failUnless(isinstance(res[1],Data),"wrong type of result for eigenvectors.")
1945          self.failUnlessEqual(res[1].getShape(),(3, 3),"wrong shape of result for eigenvectors.")
1946          self.failUnless(Lsup(res[0]-ref_ev)<=self.RES_TOL*Lsup(ref_ev),"wrong eigenvalues")
1947          self.failUnless(Lsup(matrixmult(arg,res[1][:,0])-res[0][0]*res[1][:,0])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 0")
1948          self.failUnless(Lsup(matrixmult(arg,res[1][:,1])-res[0][1]*res[1][:,1])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 1")
1949          self.failUnless(Lsup(matrixmult(arg,res[1][:,2])-res[0][2]*res[1][:,2])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 2")
1950          self.failUnless(Lsup(matrixmult(transpose(res[1]),res[1])-kronecker(3))<=self.RES_TOL,"eigenvectors are not orthonormal")
1951       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1952       def test_eigenvalues_and_eigenvectors_taggedData_dim3_case25(self):
1953          arg=Data(numarray.array([[1.0, 0.0, 0.0], [0.0, 2.0, 0.0], [0.0, 0.0, 30000.0]]),self.functionspace)
1954          arg.setTaggedValue(1,numarray.array([[1.0, 0.0, 0.0], [0.0, 21183.286995177881, -13665.625800132779], [0.0, -13665.625800132779, 8818.7130048221279]]))
1955          res=eigenvalues_and_eigenvectors(arg)
1956          ref_ev=Data(numarray.array([1.0, 2.0, 30000.0]),self.functionspace)
1957          ref_ev.setTaggedValue(1,numarray.array([1.0, 2.0, 30000.0]))
1958          self.failUnless(isinstance(res[0],Data),"wrong type of result for eigenvalues.")
1959          self.failUnlessEqual(res[0].getShape(),(3,),"wrong shape of result for eigenvalues.")
1960          self.failUnless(isinstance(res[1],Data),"wrong type of result for eigenvectors.")
1961          self.failUnlessEqual(res[1].getShape(),(3, 3),"wrong shape of result for eigenvectors.")
1962          self.failUnless(Lsup(res[0]-ref_ev)<=self.RES_TOL*Lsup(ref_ev),"wrong eigenvalues")
1963          self.failUnless(Lsup(matrixmult(arg,res[1][:,0])-res[0][0]*res[1][:,0])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 0")
1964          self.failUnless(Lsup(matrixmult(arg,res[1][:,1])-res[0][1]*res[1][:,1])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 1")
1965          self.failUnless(Lsup(matrixmult(arg,res[1][:,2])-res[0][2]*res[1][:,2])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 2")
1966          self.failUnless(Lsup(matrixmult(transpose(res[1]),res[1])-kronecker(3))<=self.RES_TOL,"eigenvectors are not orthonormal")
1967       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1968       def test_eigenvalues_and_eigenvectors_taggedData_dim3_case27(self):
1969          arg=Data(numarray.array([[8085.1298007817086, 0.0, 13310.246250831115], [0.0, 2.0, 0.0], [13310.246250831115, 0.0, 21915.870199218316]]),self.functionspace)
1970          arg.setTaggedValue(1,numarray.array([[30000.0, 0.0, 0.0], [0.0, 1.153410887977139, -0.36038311201720391], [0.0, -0.36038311201720391, 1.8465891120228608]]))
1971          res=eigenvalues_and_eigenvectors(arg)
1972          ref_ev=Data(numarray.array([1.0, 2.0, 30000.0]),self.functionspace)
1973          ref_ev.setTaggedValue(1,numarray.array([1.0, 2.0, 30000.0]))
1974          self.failUnless(isinstance(res[0],Data),"wrong type of result for eigenvalues.")
1975          self.failUnlessEqual(res[0].getShape(),(3,),"wrong shape of result for eigenvalues.")
1976          self.failUnless(isinstance(res[1],Data),"wrong type of result for eigenvectors.")
1977          self.failUnlessEqual(res[1].getShape(),(3, 3),"wrong shape of result for eigenvectors.")
1978          self.failUnless(Lsup(res[0]-ref_ev)<=self.RES_TOL*Lsup(ref_ev),"wrong eigenvalues")
1979          self.failUnless(Lsup(matrixmult(arg,res[1][:,0])-res[0][0]*res[1][:,0])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 0")
1980          self.failUnless(Lsup(matrixmult(arg,res[1][:,1])-res[0][1]*res[1][:,1])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 1")
1981          self.failUnless(Lsup(matrixmult(arg,res[1][:,2])-res[0][2]*res[1][:,2])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 2")
1982          self.failUnless(Lsup(matrixmult(transpose(res[1]),res[1])-kronecker(3))<=self.RES_TOL,"eigenvectors are not orthonormal")
1983       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1984       def test_eigenvalues_and_eigenvectors_taggedData_dim3_case29(self):
1985          arg=Data(numarray.array([[7140.1907849945546, 12308.774438213351, -3419.2256841313947], [12308.774438213351, 21223.762934183575, -5894.4478052274408], [-3419.2256841313947, -5894.4478052274408, 1639.0462808218595]]),self.functionspace)
1986          arg.setTaggedValue(1,numarray.array([[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]))
1987          res=eigenvalues_and_eigenvectors(arg)
1988          ref_ev=Data(numarray.array([1.0, 2.0, 30000.0]),self.functionspace)
1989          ref_ev.setTaggedValue(1,numarray.array([0.0, 0.0, 0.0]))
1990          self.failUnless(isinstance(res[0],Data),"wrong type of result for eigenvalues.")
1991          self.failUnlessEqual(res[0].getShape(),(3,),"wrong shape of result for eigenvalues.")
1992          self.failUnless(isinstance(res[1],Data),"wrong type of result for eigenvectors.")
1993          self.failUnlessEqual(res[1].getShape(),(3, 3),"wrong shape of result for eigenvectors.")
1994          self.failUnless(Lsup(res[0]-ref_ev)<=self.RES_TOL*Lsup(ref_ev),"wrong eigenvalues")
1995          self.failUnless(Lsup(matrixmult(arg,res[1][:,0])-res[0][0]*res[1][:,0])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 0")
1996          self.failUnless(Lsup(matrixmult(arg,res[1][:,1])-res[0][1]*res[1][:,1])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 1")
1997          self.failUnless(Lsup(matrixmult(arg,res[1][:,2])-res[0][2]*res[1][:,2])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 2")
1998          self.failUnless(Lsup(matrixmult(transpose(res[1]),res[1])-kronecker(3))<=self.RES_TOL,"eigenvectors are not orthonormal")
1999       #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2000       def test_eigenvalues_and_eigenvectors_taggedData_dim1_case0(self):
2001          arg=Data(numarray.array([[0.0]]),self.functionspace)
2002          arg.setTaggedValue(1,numarray.array([[1.0]]))
2003          res=eigenvalues_and_eigenvectors(arg)
2004          ref_ev=Data(numarray.array([0.0]),self.functionspace)
2005          ref_ev.setTaggedValue(1,numarray.array([1.0]))
2006          self.failUnless(isinstance(res[0],Data),"wrong type of result for eigenvalues.")
2007          self.failUnlessEqual(res[0].getShape(),(1,),"wrong shape of result for eigenvalues.")
2008          self.failUnless(isinstance(res[1],Data),"wrong type of result for eigenvectors.")
2009          self.failUnlessEqual(res[1].getShape(),(1, 1),"wrong shape of result for eigenvectors.")
2010          self.failUnless(Lsup(res[0]-ref_ev)<=self.RES_TOL*Lsup(ref_ev),"wrong eigenvalues")
2011          self.failUnless(Lsup(matrixmult(arg,res[1][:,0])-res[0][0]*res[1][:,0])<=self.RES_TOL*Lsup(res[0]),"wrong eigenvector 0")
2012          self.failUnless(Lsup(matrixmult(transpose(res[1]),res[1])-kronecker(1))<=self.RES_TOL,"eigenvectors are not orthonormal")

Legend:
Removed from v.587  
changed lines
  Added in v.588

  ViewVC Help
Powered by ViewVC 1.1.26