/[escript]/branches/symbolic_from_3470/escript/test/python/test_util_base.py
ViewVC logotype

Diff of /branches/symbolic_from_3470/escript/test/python/test_util_base.py

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

revision 3492 by caltinay, Tue Mar 15 04:23:54 2011 UTC revision 3493 by caltinay, Mon Apr 4 04:37:02 2011 UTC
# Line 604  class Test_util_base(unittest.TestCase): Line 604  class Test_util_base(unittest.TestCase):
604           self.failUnless(Lsup(val[0]-1.0)<=self.RES_TOL,"wrong value for 0 in the 0 vector")           self.failUnless(Lsup(val[0]-1.0)<=self.RES_TOL,"wrong value for 0 in the 0 vector")
605           self.failUnless(Lsup(val[1]-0.0)<=self.RES_TOL,"wrong value for 1 in the 0 vector")           self.failUnless(Lsup(val[1]-0.0)<=self.RES_TOL,"wrong value for 1 in the 0 vector")
606           self.failUnless(Lsup(val[2]-0.0)<=self.RES_TOL,"wrong value for 2 in the 0 vector")           self.failUnless(Lsup(val[2]-0.0)<=self.RES_TOL,"wrong value for 2 in the 0 vector")
 #=========================================================  
 #  Symbols  
 #=========================================================  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank0_dNone_nargs0(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(),dim=None,args=[])  
       self.failUnlessEqual(s.getRank(),0,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),None,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[],"wrong arguments.")  
607    
       ss=s.substitute({s:numpy.zeros(())})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,float),"ds/ds() has wrong type.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(3, 2, 3, 4)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(3, 2, 3, 4) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(3, 2, 3, 4),"ds/ds(3, 2, 3, 4) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(3, 2, 3, 4) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,float),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds,1.,"ds/ds has wrong value.")  
   
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),0,"wrong number of substituted arguments")  
   
       self.failUnless(s.isAppropriateValue(10.),"10. is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(10),"10 is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(),dim=None)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros(())),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank0_dNone_nargs1(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(),dim=None,args=[s2])  
       self.failUnlessEqual(s.getRank(),0,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),None,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[s2],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros(())})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,float),"ds/ds() has wrong type.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(3, 2, 3, 4)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(3, 2, 3, 4) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(3, 2, 3, 4),"ds/ds(3, 2, 3, 4) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(3, 2, 3, 4) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,float),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds,1.,"ds/ds has wrong value.")  
   
       self.failUnlessEqual(s.getArgument(0),s2,"wrong argument 0.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),1,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],-10,"wrongly substituted argument 0.")  
   
       self.failUnless(s.isAppropriateValue(10.),"10. is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(10),"10 is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(),dim=None)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros(())),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank0_dNone_nargs2(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(),dim=None,args=[1, -1.0])  
       self.failUnlessEqual(s.getRank(),0,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),None,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[1, -1.0],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros(())})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,float),"ds/ds() has wrong type.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(3, 2, 3, 4)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(3, 2, 3, 4) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(3, 2, 3, 4),"ds/ds(3, 2, 3, 4) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(3, 2, 3, 4) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,float),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds,1.,"ds/ds has wrong value.")  
   
       self.failUnlessEqual(s.getArgument(0),1,"wrong argument 0.")  
       self.failUnlessEqual(s.getArgument(1),-1.0,"wrong argument 1.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),2,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],1,"wrongly substituted argument 0.")  
       self.failUnlessEqual(sa[1],-1.0,"wrongly substituted argument 1.")  
   
       self.failUnless(s.isAppropriateValue(10.),"10. is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(10),"10 is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(),dim=None)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros(())),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank0_dd_nargs0(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(),dim=self.functionspace.getDim(),args=[])  
       self.failUnlessEqual(s.getRank(),0,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),self.functionspace.getDim(),"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros(())})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,float),"ds/ds() has wrong type.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(3, 2, 3, 4)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(3, 2, 3, 4) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(3, 2, 3, 4),"ds/ds(3, 2, 3, 4) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(3, 2, 3, 4) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,float),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds,1.,"ds/ds has wrong value.")  
   
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),0,"wrong number of substituted arguments")  
   
       self.failUnless(s.isAppropriateValue(10.),"10. is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(10),"10 is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(),dim=self.functionspace.getDim())),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(escript.Data(0.,(),self.functionspace)),"Data is appropriate substitute")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros(())),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank0_dd_nargs1(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(),dim=self.functionspace.getDim(),args=[s2])  
       self.failUnlessEqual(s.getRank(),0,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),self.functionspace.getDim(),"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[s2],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros(())})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,float),"ds/ds() has wrong type.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(3, 2, 3, 4)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(3, 2, 3, 4) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(3, 2, 3, 4),"ds/ds(3, 2, 3, 4) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(3, 2, 3, 4) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,float),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds,1.,"ds/ds has wrong value.")  
   
       self.failUnlessEqual(s.getArgument(0),s2,"wrong argument 0.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),1,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],-10,"wrongly substituted argument 0.")  
   
       self.failUnless(s.isAppropriateValue(10.),"10. is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(10),"10 is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(),dim=self.functionspace.getDim())),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(escript.Data(0.,(),self.functionspace)),"Data is appropriate substitute")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros(())),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank0_dd_nargs2(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(),dim=self.functionspace.getDim(),args=[1, -1.0])  
       self.failUnlessEqual(s.getRank(),0,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),self.functionspace.getDim(),"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[1, -1.0],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros(())})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,float),"ds/ds() has wrong type.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(3, 2, 3, 4)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(3, 2, 3, 4) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(3, 2, 3, 4),"ds/ds(3, 2, 3, 4) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(3, 2, 3, 4) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,float),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds,1.,"ds/ds has wrong value.")  
   
       self.failUnlessEqual(s.getArgument(0),1,"wrong argument 0.")  
       self.failUnlessEqual(s.getArgument(1),-1.0,"wrong argument 1.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),2,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],1,"wrongly substituted argument 0.")  
       self.failUnlessEqual(sa[1],-1.0,"wrongly substituted argument 1.")  
   
       self.failUnless(s.isAppropriateValue(10.),"10. is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(10),"10 is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(),dim=self.functionspace.getDim())),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(escript.Data(0.,(),self.functionspace)),"Data is appropriate substitute")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros(())),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank0_d1_nargs0(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(),dim=1,args=[])  
       self.failUnlessEqual(s.getRank(),0,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),1,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros(())})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,float),"ds/ds() has wrong type.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(3, 2, 3, 4)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(3, 2, 3, 4) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(3, 2, 3, 4),"ds/ds(3, 2, 3, 4) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(3, 2, 3, 4) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,float),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds,1.,"ds/ds has wrong value.")  
   
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),0,"wrong number of substituted arguments")  
   
       self.failUnless(s.isAppropriateValue(10.),"10. is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(10),"10 is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(),dim=1)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(),dim=2)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros(())),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank0_d1_nargs1(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(),dim=1,args=[s2])  
       self.failUnlessEqual(s.getRank(),0,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),1,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[s2],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros(())})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,float),"ds/ds() has wrong type.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(3, 2, 3, 4)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(3, 2, 3, 4) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(3, 2, 3, 4),"ds/ds(3, 2, 3, 4) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(3, 2, 3, 4) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,float),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds,1.,"ds/ds has wrong value.")  
   
       self.failUnlessEqual(s.getArgument(0),s2,"wrong argument 0.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),1,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],-10,"wrongly substituted argument 0.")  
   
       self.failUnless(s.isAppropriateValue(10.),"10. is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(10),"10 is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(),dim=1)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(),dim=2)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros(())),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank0_d1_nargs2(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(),dim=1,args=[1, -1.0])  
       self.failUnlessEqual(s.getRank(),0,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),1,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[1, -1.0],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros(())})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,float),"ds/ds() has wrong type.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(3, 2, 3, 4)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(3, 2, 3, 4) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(3, 2, 3, 4),"ds/ds(3, 2, 3, 4) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(3, 2, 3, 4) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,float),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds,1.,"ds/ds has wrong value.")  
   
       self.failUnlessEqual(s.getArgument(0),1,"wrong argument 0.")  
       self.failUnlessEqual(s.getArgument(1),-1.0,"wrong argument 1.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),2,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],1,"wrongly substituted argument 0.")  
       self.failUnlessEqual(sa[1],-1.0,"wrongly substituted argument 1.")  
   
       self.failUnless(s.isAppropriateValue(10.),"10. is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(10),"10 is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(),dim=1)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(),dim=2)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros(())),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank0_d2_nargs0(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(),dim=2,args=[])  
       self.failUnlessEqual(s.getRank(),0,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),2,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros(())})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,float),"ds/ds() has wrong type.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(3, 2, 3, 4)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(3, 2, 3, 4) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(3, 2, 3, 4),"ds/ds(3, 2, 3, 4) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(3, 2, 3, 4) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,float),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds,1.,"ds/ds has wrong value.")  
   
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),0,"wrong number of substituted arguments")  
   
       self.failUnless(s.isAppropriateValue(10.),"10. is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(10),"10 is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(),dim=2)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(),dim=3)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros(())),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank0_d2_nargs1(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(),dim=2,args=[s2])  
       self.failUnlessEqual(s.getRank(),0,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),2,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[s2],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros(())})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,float),"ds/ds() has wrong type.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(3, 2, 3, 4)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(3, 2, 3, 4) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(3, 2, 3, 4),"ds/ds(3, 2, 3, 4) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(3, 2, 3, 4) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,float),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds,1.,"ds/ds has wrong value.")  
   
       self.failUnlessEqual(s.getArgument(0),s2,"wrong argument 0.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),1,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],-10,"wrongly substituted argument 0.")  
   
       self.failUnless(s.isAppropriateValue(10.),"10. is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(10),"10 is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(),dim=2)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(),dim=3)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros(())),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank0_d2_nargs2(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(),dim=2,args=[1, -1.0])  
       self.failUnlessEqual(s.getRank(),0,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),2,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[1, -1.0],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros(())})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,float),"ds/ds() has wrong type.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(3, 2, 3, 4)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(3, 2, 3, 4) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(3, 2, 3, 4),"ds/ds(3, 2, 3, 4) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(3, 2, 3, 4) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,float),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds,1.,"ds/ds has wrong value.")  
   
       self.failUnlessEqual(s.getArgument(0),1,"wrong argument 0.")  
       self.failUnlessEqual(s.getArgument(1),-1.0,"wrong argument 1.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),2,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],1,"wrongly substituted argument 0.")  
       self.failUnlessEqual(sa[1],-1.0,"wrongly substituted argument 1.")  
   
       self.failUnless(s.isAppropriateValue(10.),"10. is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(10),"10 is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(),dim=2)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(),dim=3)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros(())),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank0_d3_nargs0(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(),dim=3,args=[])  
       self.failUnlessEqual(s.getRank(),0,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),3,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros(())})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,float),"ds/ds() has wrong type.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(3, 2, 3, 4)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(3, 2, 3, 4) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(3, 2, 3, 4),"ds/ds(3, 2, 3, 4) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(3, 2, 3, 4) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,float),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds,1.,"ds/ds has wrong value.")  
   
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),0,"wrong number of substituted arguments")  
   
       self.failUnless(s.isAppropriateValue(10.),"10. is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(10),"10 is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(),dim=3)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(),dim=4)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros(())),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank0_d3_nargs1(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(),dim=3,args=[s2])  
       self.failUnlessEqual(s.getRank(),0,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),3,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[s2],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros(())})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,float),"ds/ds() has wrong type.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(3, 2, 3, 4)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(3, 2, 3, 4) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(3, 2, 3, 4),"ds/ds(3, 2, 3, 4) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(3, 2, 3, 4) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,float),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds,1.,"ds/ds has wrong value.")  
   
       self.failUnlessEqual(s.getArgument(0),s2,"wrong argument 0.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),1,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],-10,"wrongly substituted argument 0.")  
   
       self.failUnless(s.isAppropriateValue(10.),"10. is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(10),"10 is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(),dim=3)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(),dim=4)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros(())),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank0_d3_nargs2(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(),dim=3,args=[1, -1.0])  
       self.failUnlessEqual(s.getRank(),0,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),3,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[1, -1.0],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros(())})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,float),"ds/ds() has wrong type.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(3, 2, 3, 4)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(3, 2, 3, 4) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(3, 2, 3, 4),"ds/ds(3, 2, 3, 4) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(3, 2, 3, 4) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,float),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds,1.,"ds/ds has wrong value.")  
   
       self.failUnlessEqual(s.getArgument(0),1,"wrong argument 0.")  
       self.failUnlessEqual(s.getArgument(1),-1.0,"wrong argument 1.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),2,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],1,"wrongly substituted argument 0.")  
       self.failUnlessEqual(sa[1],-1.0,"wrongly substituted argument 1.")  
   
       self.failUnless(s.isAppropriateValue(10.),"10. is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(10),"10 is appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(),dim=3)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(),dim=4)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros(())),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank1_dNone_nargs0(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(2,),dim=None,args=[])  
       self.failUnlessEqual(s.getRank(),1,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(2,),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),None,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((2,))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(2,),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(2, 2),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0],1.0,"ds/ds has wrong value at (0,0).")  
       self.failUnlessEqual(dsds[0,1],0.0,"ds/ds has wrong value at (0,1).")  
       self.failUnlessEqual(dsds[1,0],0.0,"ds/ds has wrong value at (1,0).")  
       self.failUnlessEqual(dsds[1,1],1.0,"ds/ds has wrong value at (1,1).")  
   
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),0,"wrong number of substituted arguments")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(2,),dim=None)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((2,))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank1_dNone_nargs1(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(2,),dim=None,args=[s2])  
       self.failUnlessEqual(s.getRank(),1,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(2,),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),None,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[s2],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((2,))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(2,),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(2, 2),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0],1.0,"ds/ds has wrong value at (0,0).")  
       self.failUnlessEqual(dsds[0,1],0.0,"ds/ds has wrong value at (0,1).")  
       self.failUnlessEqual(dsds[1,0],0.0,"ds/ds has wrong value at (1,0).")  
       self.failUnlessEqual(dsds[1,1],1.0,"ds/ds has wrong value at (1,1).")  
   
       self.failUnlessEqual(s.getArgument(0),s2,"wrong argument 0.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),1,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],-10,"wrongly substituted argument 0.")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(2,),dim=None)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((2,))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank1_dNone_nargs2(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(2,),dim=None,args=[1, -1.0])  
       self.failUnlessEqual(s.getRank(),1,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(2,),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),None,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[1, -1.0],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((2,))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(2,),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(2, 2),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0],1.0,"ds/ds has wrong value at (0,0).")  
       self.failUnlessEqual(dsds[0,1],0.0,"ds/ds has wrong value at (0,1).")  
       self.failUnlessEqual(dsds[1,0],0.0,"ds/ds has wrong value at (1,0).")  
       self.failUnlessEqual(dsds[1,1],1.0,"ds/ds has wrong value at (1,1).")  
   
       self.failUnlessEqual(s.getArgument(0),1,"wrong argument 0.")  
       self.failUnlessEqual(s.getArgument(1),-1.0,"wrong argument 1.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),2,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],1,"wrongly substituted argument 0.")  
       self.failUnlessEqual(sa[1],-1.0,"wrongly substituted argument 1.")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(2,),dim=None)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((2,))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank1_dd_nargs0(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(2,),dim=self.functionspace.getDim(),args=[])  
       self.failUnlessEqual(s.getRank(),1,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(2,),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),self.functionspace.getDim(),"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((2,))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(2,),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(2, 2),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0],1.0,"ds/ds has wrong value at (0,0).")  
       self.failUnlessEqual(dsds[0,1],0.0,"ds/ds has wrong value at (0,1).")  
       self.failUnlessEqual(dsds[1,0],0.0,"ds/ds has wrong value at (1,0).")  
       self.failUnlessEqual(dsds[1,1],1.0,"ds/ds has wrong value at (1,1).")  
   
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),0,"wrong number of substituted arguments")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(2,),dim=self.functionspace.getDim())),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(escript.Data(0.,(2,),self.functionspace)),"Data is appropriate substitute")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((2,))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank1_dd_nargs1(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(2,),dim=self.functionspace.getDim(),args=[s2])  
       self.failUnlessEqual(s.getRank(),1,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(2,),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),self.functionspace.getDim(),"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[s2],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((2,))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(2,),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(2, 2),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0],1.0,"ds/ds has wrong value at (0,0).")  
       self.failUnlessEqual(dsds[0,1],0.0,"ds/ds has wrong value at (0,1).")  
       self.failUnlessEqual(dsds[1,0],0.0,"ds/ds has wrong value at (1,0).")  
       self.failUnlessEqual(dsds[1,1],1.0,"ds/ds has wrong value at (1,1).")  
   
       self.failUnlessEqual(s.getArgument(0),s2,"wrong argument 0.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),1,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],-10,"wrongly substituted argument 0.")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(2,),dim=self.functionspace.getDim())),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(escript.Data(0.,(2,),self.functionspace)),"Data is appropriate substitute")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((2,))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank1_dd_nargs2(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(2,),dim=self.functionspace.getDim(),args=[1, -1.0])  
       self.failUnlessEqual(s.getRank(),1,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(2,),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),self.functionspace.getDim(),"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[1, -1.0],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((2,))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(2,),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(2, 2),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0],1.0,"ds/ds has wrong value at (0,0).")  
       self.failUnlessEqual(dsds[0,1],0.0,"ds/ds has wrong value at (0,1).")  
       self.failUnlessEqual(dsds[1,0],0.0,"ds/ds has wrong value at (1,0).")  
       self.failUnlessEqual(dsds[1,1],1.0,"ds/ds has wrong value at (1,1).")  
   
       self.failUnlessEqual(s.getArgument(0),1,"wrong argument 0.")  
       self.failUnlessEqual(s.getArgument(1),-1.0,"wrong argument 1.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),2,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],1,"wrongly substituted argument 0.")  
       self.failUnlessEqual(sa[1],-1.0,"wrongly substituted argument 1.")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(2,),dim=self.functionspace.getDim())),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(escript.Data(0.,(2,),self.functionspace)),"Data is appropriate substitute")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((2,))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank1_d1_nargs0(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(2,),dim=1,args=[])  
       self.failUnlessEqual(s.getRank(),1,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(2,),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),1,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((2,))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(2,),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(2, 2),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0],1.0,"ds/ds has wrong value at (0,0).")  
       self.failUnlessEqual(dsds[0,1],0.0,"ds/ds has wrong value at (0,1).")  
       self.failUnlessEqual(dsds[1,0],0.0,"ds/ds has wrong value at (1,0).")  
       self.failUnlessEqual(dsds[1,1],1.0,"ds/ds has wrong value at (1,1).")  
   
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),0,"wrong number of substituted arguments")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(2,),dim=1)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(2,),dim=2)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((2,))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank1_d1_nargs1(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(2,),dim=1,args=[s2])  
       self.failUnlessEqual(s.getRank(),1,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(2,),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),1,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[s2],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((2,))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(2,),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(2, 2),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0],1.0,"ds/ds has wrong value at (0,0).")  
       self.failUnlessEqual(dsds[0,1],0.0,"ds/ds has wrong value at (0,1).")  
       self.failUnlessEqual(dsds[1,0],0.0,"ds/ds has wrong value at (1,0).")  
       self.failUnlessEqual(dsds[1,1],1.0,"ds/ds has wrong value at (1,1).")  
   
       self.failUnlessEqual(s.getArgument(0),s2,"wrong argument 0.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),1,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],-10,"wrongly substituted argument 0.")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(2,),dim=1)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(2,),dim=2)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((2,))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank1_d1_nargs2(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(2,),dim=1,args=[1, -1.0])  
       self.failUnlessEqual(s.getRank(),1,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(2,),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),1,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[1, -1.0],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((2,))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(2,),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(2, 2),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0],1.0,"ds/ds has wrong value at (0,0).")  
       self.failUnlessEqual(dsds[0,1],0.0,"ds/ds has wrong value at (0,1).")  
       self.failUnlessEqual(dsds[1,0],0.0,"ds/ds has wrong value at (1,0).")  
       self.failUnlessEqual(dsds[1,1],1.0,"ds/ds has wrong value at (1,1).")  
   
       self.failUnlessEqual(s.getArgument(0),1,"wrong argument 0.")  
       self.failUnlessEqual(s.getArgument(1),-1.0,"wrong argument 1.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),2,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],1,"wrongly substituted argument 0.")  
       self.failUnlessEqual(sa[1],-1.0,"wrongly substituted argument 1.")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(2,),dim=1)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(2,),dim=2)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((2,))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank1_d2_nargs0(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(2,),dim=2,args=[])  
       self.failUnlessEqual(s.getRank(),1,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(2,),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),2,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((2,))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(2,),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(2, 2),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0],1.0,"ds/ds has wrong value at (0,0).")  
       self.failUnlessEqual(dsds[0,1],0.0,"ds/ds has wrong value at (0,1).")  
       self.failUnlessEqual(dsds[1,0],0.0,"ds/ds has wrong value at (1,0).")  
       self.failUnlessEqual(dsds[1,1],1.0,"ds/ds has wrong value at (1,1).")  
   
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),0,"wrong number of substituted arguments")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(2,),dim=2)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(2,),dim=3)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((2,))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank1_d2_nargs1(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(2,),dim=2,args=[s2])  
       self.failUnlessEqual(s.getRank(),1,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(2,),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),2,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[s2],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((2,))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(2,),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(2, 2),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0],1.0,"ds/ds has wrong value at (0,0).")  
       self.failUnlessEqual(dsds[0,1],0.0,"ds/ds has wrong value at (0,1).")  
       self.failUnlessEqual(dsds[1,0],0.0,"ds/ds has wrong value at (1,0).")  
       self.failUnlessEqual(dsds[1,1],1.0,"ds/ds has wrong value at (1,1).")  
   
       self.failUnlessEqual(s.getArgument(0),s2,"wrong argument 0.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),1,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],-10,"wrongly substituted argument 0.")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(2,),dim=2)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(2,),dim=3)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((2,))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank1_d2_nargs2(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(2,),dim=2,args=[1, -1.0])  
       self.failUnlessEqual(s.getRank(),1,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(2,),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),2,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[1, -1.0],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((2,))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(2,),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(2, 2),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0],1.0,"ds/ds has wrong value at (0,0).")  
       self.failUnlessEqual(dsds[0,1],0.0,"ds/ds has wrong value at (0,1).")  
       self.failUnlessEqual(dsds[1,0],0.0,"ds/ds has wrong value at (1,0).")  
       self.failUnlessEqual(dsds[1,1],1.0,"ds/ds has wrong value at (1,1).")  
   
       self.failUnlessEqual(s.getArgument(0),1,"wrong argument 0.")  
       self.failUnlessEqual(s.getArgument(1),-1.0,"wrong argument 1.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),2,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],1,"wrongly substituted argument 0.")  
       self.failUnlessEqual(sa[1],-1.0,"wrongly substituted argument 1.")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(2,),dim=2)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(2,),dim=3)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((2,))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank1_d3_nargs0(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(2,),dim=3,args=[])  
       self.failUnlessEqual(s.getRank(),1,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(2,),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),3,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((2,))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(2,),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(2, 2),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0],1.0,"ds/ds has wrong value at (0,0).")  
       self.failUnlessEqual(dsds[0,1],0.0,"ds/ds has wrong value at (0,1).")  
       self.failUnlessEqual(dsds[1,0],0.0,"ds/ds has wrong value at (1,0).")  
       self.failUnlessEqual(dsds[1,1],1.0,"ds/ds has wrong value at (1,1).")  
   
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),0,"wrong number of substituted arguments")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(2,),dim=3)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(2,),dim=4)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((2,))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank1_d3_nargs1(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(2,),dim=3,args=[s2])  
       self.failUnlessEqual(s.getRank(),1,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(2,),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),3,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[s2],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((2,))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(2,),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(2, 2),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0],1.0,"ds/ds has wrong value at (0,0).")  
       self.failUnlessEqual(dsds[0,1],0.0,"ds/ds has wrong value at (0,1).")  
       self.failUnlessEqual(dsds[1,0],0.0,"ds/ds has wrong value at (1,0).")  
       self.failUnlessEqual(dsds[1,1],1.0,"ds/ds has wrong value at (1,1).")  
   
       self.failUnlessEqual(s.getArgument(0),s2,"wrong argument 0.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),1,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],-10,"wrongly substituted argument 0.")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(2,),dim=3)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(2,),dim=4)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((2,))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank1_d3_nargs2(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(2,),dim=3,args=[1, -1.0])  
       self.failUnlessEqual(s.getRank(),1,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(2,),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),3,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[1, -1.0],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((2,))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(2,),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2,),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(6, 2, 2)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(6, 2, 2) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(2, 6, 2, 2),"ds/ds(6, 2, 2) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(6, 2, 2) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(2, 2),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0],1.0,"ds/ds has wrong value at (0,0).")  
       self.failUnlessEqual(dsds[0,1],0.0,"ds/ds has wrong value at (0,1).")  
       self.failUnlessEqual(dsds[1,0],0.0,"ds/ds has wrong value at (1,0).")  
       self.failUnlessEqual(dsds[1,1],1.0,"ds/ds has wrong value at (1,1).")  
   
       self.failUnlessEqual(s.getArgument(0),1,"wrong argument 0.")  
       self.failUnlessEqual(s.getArgument(1),-1.0,"wrong argument 1.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),2,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],1,"wrongly substituted argument 0.")  
       self.failUnlessEqual(sa[1],-1.0,"wrongly substituted argument 1.")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(2,),dim=3)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(2,),dim=4)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((2,))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank2_dNone_nargs0(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(4, 5),dim=None,args=[])  
       self.failUnlessEqual(s.getRank(),2,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(4, 5),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),None,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((4, 5))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(4, 5),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(4, 5, 4, 5),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0,0,0],1.0,"ds/ds has wrong value at (0,0,0,0).")  
       self.failUnlessEqual(dsds[0,0,0,1],0.0,"ds/ds has wrong value at (0,0,0,1).")  
       self.failUnlessEqual(dsds[0,0,0,2],0.0,"ds/ds has wrong value at (0,0,0,2).")  
       self.failUnlessEqual(dsds[0,0,0,3],0.0,"ds/ds has wrong value at (0,0,0,3).")  
       self.failUnlessEqual(dsds[0,0,0,4],0.0,"ds/ds has wrong value at (0,0,0,4).")  
       self.failUnlessEqual(dsds[0,0,1,0],0.0,"ds/ds has wrong value at (0,0,1,0).")  
       self.failUnlessEqual(dsds[0,0,1,1],0.0,"ds/ds has wrong value at (0,0,1,1).")  
       self.failUnlessEqual(dsds[0,0,1,2],0.0,"ds/ds has wrong value at (0,0,1,2).")  
       self.failUnlessEqual(dsds[0,0,1,3],0.0,"ds/ds has wrong value at (0,0,1,3).")  
       self.failUnlessEqual(dsds[0,0,1,4],0.0,"ds/ds has wrong value at (0,0,1,4).")  
       self.failUnlessEqual(dsds[0,0,2,0],0.0,"ds/ds has wrong value at (0,0,2,0).")  
       self.failUnlessEqual(dsds[0,0,2,1],0.0,"ds/ds has wrong value at (0,0,2,1).")  
       self.failUnlessEqual(dsds[0,0,2,2],0.0,"ds/ds has wrong value at (0,0,2,2).")  
       self.failUnlessEqual(dsds[0,0,2,3],0.0,"ds/ds has wrong value at (0,0,2,3).")  
       self.failUnlessEqual(dsds[0,0,2,4],0.0,"ds/ds has wrong value at (0,0,2,4).")  
       self.failUnlessEqual(dsds[0,0,3,0],0.0,"ds/ds has wrong value at (0,0,3,0).")  
       self.failUnlessEqual(dsds[0,0,3,1],0.0,"ds/ds has wrong value at (0,0,3,1).")  
       self.failUnlessEqual(dsds[0,0,3,2],0.0,"ds/ds has wrong value at (0,0,3,2).")  
       self.failUnlessEqual(dsds[0,0,3,3],0.0,"ds/ds has wrong value at (0,0,3,3).")  
       self.failUnlessEqual(dsds[0,0,3,4],0.0,"ds/ds has wrong value at (0,0,3,4).")  
       self.failUnlessEqual(dsds[0,1,0,0],0.0,"ds/ds has wrong value at (0,1,0,0).")  
       self.failUnlessEqual(dsds[0,1,0,1],1.0,"ds/ds has wrong value at (0,1,0,1).")  
       self.failUnlessEqual(dsds[0,1,0,2],0.0,"ds/ds has wrong value at (0,1,0,2).")  
       self.failUnlessEqual(dsds[0,1,0,3],0.0,"ds/ds has wrong value at (0,1,0,3).")  
       self.failUnlessEqual(dsds[0,1,0,4],0.0,"ds/ds has wrong value at (0,1,0,4).")  
       self.failUnlessEqual(dsds[0,1,1,0],0.0,"ds/ds has wrong value at (0,1,1,0).")  
       self.failUnlessEqual(dsds[0,1,1,1],0.0,"ds/ds has wrong value at (0,1,1,1).")  
       self.failUnlessEqual(dsds[0,1,1,2],0.0,"ds/ds has wrong value at (0,1,1,2).")  
       self.failUnlessEqual(dsds[0,1,1,3],0.0,"ds/ds has wrong value at (0,1,1,3).")  
       self.failUnlessEqual(dsds[0,1,1,4],0.0,"ds/ds has wrong value at (0,1,1,4).")  
       self.failUnlessEqual(dsds[0,1,2,0],0.0,"ds/ds has wrong value at (0,1,2,0).")  
       self.failUnlessEqual(dsds[0,1,2,1],0.0,"ds/ds has wrong value at (0,1,2,1).")  
       self.failUnlessEqual(dsds[0,1,2,2],0.0,"ds/ds has wrong value at (0,1,2,2).")  
       self.failUnlessEqual(dsds[0,1,2,3],0.0,"ds/ds has wrong value at (0,1,2,3).")  
       self.failUnlessEqual(dsds[0,1,2,4],0.0,"ds/ds has wrong value at (0,1,2,4).")  
       self.failUnlessEqual(dsds[0,1,3,0],0.0,"ds/ds has wrong value at (0,1,3,0).")  
       self.failUnlessEqual(dsds[0,1,3,1],0.0,"ds/ds has wrong value at (0,1,3,1).")  
       self.failUnlessEqual(dsds[0,1,3,2],0.0,"ds/ds has wrong value at (0,1,3,2).")  
       self.failUnlessEqual(dsds[0,1,3,3],0.0,"ds/ds has wrong value at (0,1,3,3).")  
       self.failUnlessEqual(dsds[0,1,3,4],0.0,"ds/ds has wrong value at (0,1,3,4).")  
       self.failUnlessEqual(dsds[0,2,0,0],0.0,"ds/ds has wrong value at (0,2,0,0).")  
       self.failUnlessEqual(dsds[0,2,0,1],0.0,"ds/ds has wrong value at (0,2,0,1).")  
       self.failUnlessEqual(dsds[0,2,0,2],1.0,"ds/ds has wrong value at (0,2,0,2).")  
       self.failUnlessEqual(dsds[0,2,0,3],0.0,"ds/ds has wrong value at (0,2,0,3).")  
       self.failUnlessEqual(dsds[0,2,0,4],0.0,"ds/ds has wrong value at (0,2,0,4).")  
       self.failUnlessEqual(dsds[0,2,1,0],0.0,"ds/ds has wrong value at (0,2,1,0).")  
       self.failUnlessEqual(dsds[0,2,1,1],0.0,"ds/ds has wrong value at (0,2,1,1).")  
       self.failUnlessEqual(dsds[0,2,1,2],0.0,"ds/ds has wrong value at (0,2,1,2).")  
       self.failUnlessEqual(dsds[0,2,1,3],0.0,"ds/ds has wrong value at (0,2,1,3).")  
       self.failUnlessEqual(dsds[0,2,1,4],0.0,"ds/ds has wrong value at (0,2,1,4).")  
       self.failUnlessEqual(dsds[0,2,2,0],0.0,"ds/ds has wrong value at (0,2,2,0).")  
       self.failUnlessEqual(dsds[0,2,2,1],0.0,"ds/ds has wrong value at (0,2,2,1).")  
       self.failUnlessEqual(dsds[0,2,2,2],0.0,"ds/ds has wrong value at (0,2,2,2).")  
       self.failUnlessEqual(dsds[0,2,2,3],0.0,"ds/ds has wrong value at (0,2,2,3).")  
       self.failUnlessEqual(dsds[0,2,2,4],0.0,"ds/ds has wrong value at (0,2,2,4).")  
       self.failUnlessEqual(dsds[0,2,3,0],0.0,"ds/ds has wrong value at (0,2,3,0).")  
       self.failUnlessEqual(dsds[0,2,3,1],0.0,"ds/ds has wrong value at (0,2,3,1).")  
       self.failUnlessEqual(dsds[0,2,3,2],0.0,"ds/ds has wrong value at (0,2,3,2).")  
       self.failUnlessEqual(dsds[0,2,3,3],0.0,"ds/ds has wrong value at (0,2,3,3).")  
       self.failUnlessEqual(dsds[0,2,3,4],0.0,"ds/ds has wrong value at (0,2,3,4).")  
       self.failUnlessEqual(dsds[0,3,0,0],0.0,"ds/ds has wrong value at (0,3,0,0).")  
       self.failUnlessEqual(dsds[0,3,0,1],0.0,"ds/ds has wrong value at (0,3,0,1).")  
       self.failUnlessEqual(dsds[0,3,0,2],0.0,"ds/ds has wrong value at (0,3,0,2).")  
       self.failUnlessEqual(dsds[0,3,0,3],1.0,"ds/ds has wrong value at (0,3,0,3).")  
       self.failUnlessEqual(dsds[0,3,0,4],0.0,"ds/ds has wrong value at (0,3,0,4).")  
       self.failUnlessEqual(dsds[0,3,1,0],0.0,"ds/ds has wrong value at (0,3,1,0).")  
       self.failUnlessEqual(dsds[0,3,1,1],0.0,"ds/ds has wrong value at (0,3,1,1).")  
       self.failUnlessEqual(dsds[0,3,1,2],0.0,"ds/ds has wrong value at (0,3,1,2).")  
       self.failUnlessEqual(dsds[0,3,1,3],0.0,"ds/ds has wrong value at (0,3,1,3).")  
       self.failUnlessEqual(dsds[0,3,1,4],0.0,"ds/ds has wrong value at (0,3,1,4).")  
       self.failUnlessEqual(dsds[0,3,2,0],0.0,"ds/ds has wrong value at (0,3,2,0).")  
       self.failUnlessEqual(dsds[0,3,2,1],0.0,"ds/ds has wrong value at (0,3,2,1).")  
       self.failUnlessEqual(dsds[0,3,2,2],0.0,"ds/ds has wrong value at (0,3,2,2).")  
       self.failUnlessEqual(dsds[0,3,2,3],0.0,"ds/ds has wrong value at (0,3,2,3).")  
       self.failUnlessEqual(dsds[0,3,2,4],0.0,"ds/ds has wrong value at (0,3,2,4).")  
       self.failUnlessEqual(dsds[0,3,3,0],0.0,"ds/ds has wrong value at (0,3,3,0).")  
       self.failUnlessEqual(dsds[0,3,3,1],0.0,"ds/ds has wrong value at (0,3,3,1).")  
       self.failUnlessEqual(dsds[0,3,3,2],0.0,"ds/ds has wrong value at (0,3,3,2).")  
       self.failUnlessEqual(dsds[0,3,3,3],0.0,"ds/ds has wrong value at (0,3,3,3).")  
       self.failUnlessEqual(dsds[0,3,3,4],0.0,"ds/ds has wrong value at (0,3,3,4).")  
       self.failUnlessEqual(dsds[0,4,0,0],0.0,"ds/ds has wrong value at (0,4,0,0).")  
       self.failUnlessEqual(dsds[0,4,0,1],0.0,"ds/ds has wrong value at (0,4,0,1).")  
       self.failUnlessEqual(dsds[0,4,0,2],0.0,"ds/ds has wrong value at (0,4,0,2).")  
       self.failUnlessEqual(dsds[0,4,0,3],0.0,"ds/ds has wrong value at (0,4,0,3).")  
       self.failUnlessEqual(dsds[0,4,0,4],1.0,"ds/ds has wrong value at (0,4,0,4).")  
       self.failUnlessEqual(dsds[0,4,1,0],0.0,"ds/ds has wrong value at (0,4,1,0).")  
       self.failUnlessEqual(dsds[0,4,1,1],0.0,"ds/ds has wrong value at (0,4,1,1).")  
       self.failUnlessEqual(dsds[0,4,1,2],0.0,"ds/ds has wrong value at (0,4,1,2).")  
       self.failUnlessEqual(dsds[0,4,1,3],0.0,"ds/ds has wrong value at (0,4,1,3).")  
       self.failUnlessEqual(dsds[0,4,1,4],0.0,"ds/ds has wrong value at (0,4,1,4).")  
       self.failUnlessEqual(dsds[0,4,2,0],0.0,"ds/ds has wrong value at (0,4,2,0).")  
       self.failUnlessEqual(dsds[0,4,2,1],0.0,"ds/ds has wrong value at (0,4,2,1).")  
       self.failUnlessEqual(dsds[0,4,2,2],0.0,"ds/ds has wrong value at (0,4,2,2).")  
       self.failUnlessEqual(dsds[0,4,2,3],0.0,"ds/ds has wrong value at (0,4,2,3).")  
       self.failUnlessEqual(dsds[0,4,2,4],0.0,"ds/ds has wrong value at (0,4,2,4).")  
       self.failUnlessEqual(dsds[0,4,3,0],0.0,"ds/ds has wrong value at (0,4,3,0).")  
       self.failUnlessEqual(dsds[0,4,3,1],0.0,"ds/ds has wrong value at (0,4,3,1).")  
       self.failUnlessEqual(dsds[0,4,3,2],0.0,"ds/ds has wrong value at (0,4,3,2).")  
       self.failUnlessEqual(dsds[0,4,3,3],0.0,"ds/ds has wrong value at (0,4,3,3).")  
       self.failUnlessEqual(dsds[0,4,3,4],0.0,"ds/ds has wrong value at (0,4,3,4).")  
       self.failUnlessEqual(dsds[1,0,0,0],0.0,"ds/ds has wrong value at (1,0,0,0).")  
       self.failUnlessEqual(dsds[1,0,0,1],0.0,"ds/ds has wrong value at (1,0,0,1).")  
       self.failUnlessEqual(dsds[1,0,0,2],0.0,"ds/ds has wrong value at (1,0,0,2).")  
       self.failUnlessEqual(dsds[1,0,0,3],0.0,"ds/ds has wrong value at (1,0,0,3).")  
       self.failUnlessEqual(dsds[1,0,0,4],0.0,"ds/ds has wrong value at (1,0,0,4).")  
       self.failUnlessEqual(dsds[1,0,1,0],1.0,"ds/ds has wrong value at (1,0,1,0).")  
       self.failUnlessEqual(dsds[1,0,1,1],0.0,"ds/ds has wrong value at (1,0,1,1).")  
       self.failUnlessEqual(dsds[1,0,1,2],0.0,"ds/ds has wrong value at (1,0,1,2).")  
       self.failUnlessEqual(dsds[1,0,1,3],0.0,"ds/ds has wrong value at (1,0,1,3).")  
       self.failUnlessEqual(dsds[1,0,1,4],0.0,"ds/ds has wrong value at (1,0,1,4).")  
       self.failUnlessEqual(dsds[1,0,2,0],0.0,"ds/ds has wrong value at (1,0,2,0).")  
       self.failUnlessEqual(dsds[1,0,2,1],0.0,"ds/ds has wrong value at (1,0,2,1).")  
       self.failUnlessEqual(dsds[1,0,2,2],0.0,"ds/ds has wrong value at (1,0,2,2).")  
       self.failUnlessEqual(dsds[1,0,2,3],0.0,"ds/ds has wrong value at (1,0,2,3).")  
       self.failUnlessEqual(dsds[1,0,2,4],0.0,"ds/ds has wrong value at (1,0,2,4).")  
       self.failUnlessEqual(dsds[1,0,3,0],0.0,"ds/ds has wrong value at (1,0,3,0).")  
       self.failUnlessEqual(dsds[1,0,3,1],0.0,"ds/ds has wrong value at (1,0,3,1).")  
       self.failUnlessEqual(dsds[1,0,3,2],0.0,"ds/ds has wrong value at (1,0,3,2).")  
       self.failUnlessEqual(dsds[1,0,3,3],0.0,"ds/ds has wrong value at (1,0,3,3).")  
       self.failUnlessEqual(dsds[1,0,3,4],0.0,"ds/ds has wrong value at (1,0,3,4).")  
       self.failUnlessEqual(dsds[1,1,0,0],0.0,"ds/ds has wrong value at (1,1,0,0).")  
       self.failUnlessEqual(dsds[1,1,0,1],0.0,"ds/ds has wrong value at (1,1,0,1).")  
       self.failUnlessEqual(dsds[1,1,0,2],0.0,"ds/ds has wrong value at (1,1,0,2).")  
       self.failUnlessEqual(dsds[1,1,0,3],0.0,"ds/ds has wrong value at (1,1,0,3).")  
       self.failUnlessEqual(dsds[1,1,0,4],0.0,"ds/ds has wrong value at (1,1,0,4).")  
       self.failUnlessEqual(dsds[1,1,1,0],0.0,"ds/ds has wrong value at (1,1,1,0).")  
       self.failUnlessEqual(dsds[1,1,1,1],1.0,"ds/ds has wrong value at (1,1,1,1).")  
       self.failUnlessEqual(dsds[1,1,1,2],0.0,"ds/ds has wrong value at (1,1,1,2).")  
       self.failUnlessEqual(dsds[1,1,1,3],0.0,"ds/ds has wrong value at (1,1,1,3).")  
       self.failUnlessEqual(dsds[1,1,1,4],0.0,"ds/ds has wrong value at (1,1,1,4).")  
       self.failUnlessEqual(dsds[1,1,2,0],0.0,"ds/ds has wrong value at (1,1,2,0).")  
       self.failUnlessEqual(dsds[1,1,2,1],0.0,"ds/ds has wrong value at (1,1,2,1).")  
       self.failUnlessEqual(dsds[1,1,2,2],0.0,"ds/ds has wrong value at (1,1,2,2).")  
       self.failUnlessEqual(dsds[1,1,2,3],0.0,"ds/ds has wrong value at (1,1,2,3).")  
       self.failUnlessEqual(dsds[1,1,2,4],0.0,"ds/ds has wrong value at (1,1,2,4).")  
       self.failUnlessEqual(dsds[1,1,3,0],0.0,"ds/ds has wrong value at (1,1,3,0).")  
       self.failUnlessEqual(dsds[1,1,3,1],0.0,"ds/ds has wrong value at (1,1,3,1).")  
       self.failUnlessEqual(dsds[1,1,3,2],0.0,"ds/ds has wrong value at (1,1,3,2).")  
       self.failUnlessEqual(dsds[1,1,3,3],0.0,"ds/ds has wrong value at (1,1,3,3).")  
       self.failUnlessEqual(dsds[1,1,3,4],0.0,"ds/ds has wrong value at (1,1,3,4).")  
       self.failUnlessEqual(dsds[1,2,0,0],0.0,"ds/ds has wrong value at (1,2,0,0).")  
       self.failUnlessEqual(dsds[1,2,0,1],0.0,"ds/ds has wrong value at (1,2,0,1).")  
       self.failUnlessEqual(dsds[1,2,0,2],0.0,"ds/ds has wrong value at (1,2,0,2).")  
       self.failUnlessEqual(dsds[1,2,0,3],0.0,"ds/ds has wrong value at (1,2,0,3).")  
       self.failUnlessEqual(dsds[1,2,0,4],0.0,"ds/ds has wrong value at (1,2,0,4).")  
       self.failUnlessEqual(dsds[1,2,1,0],0.0,"ds/ds has wrong value at (1,2,1,0).")  
       self.failUnlessEqual(dsds[1,2,1,1],0.0,"ds/ds has wrong value at (1,2,1,1).")  
       self.failUnlessEqual(dsds[1,2,1,2],1.0,"ds/ds has wrong value at (1,2,1,2).")  
       self.failUnlessEqual(dsds[1,2,1,3],0.0,"ds/ds has wrong value at (1,2,1,3).")  
       self.failUnlessEqual(dsds[1,2,1,4],0.0,"ds/ds has wrong value at (1,2,1,4).")  
       self.failUnlessEqual(dsds[1,2,2,0],0.0,"ds/ds has wrong value at (1,2,2,0).")  
       self.failUnlessEqual(dsds[1,2,2,1],0.0,"ds/ds has wrong value at (1,2,2,1).")  
       self.failUnlessEqual(dsds[1,2,2,2],0.0,"ds/ds has wrong value at (1,2,2,2).")  
       self.failUnlessEqual(dsds[1,2,2,3],0.0,"ds/ds has wrong value at (1,2,2,3).")  
       self.failUnlessEqual(dsds[1,2,2,4],0.0,"ds/ds has wrong value at (1,2,2,4).")  
       self.failUnlessEqual(dsds[1,2,3,0],0.0,"ds/ds has wrong value at (1,2,3,0).")  
       self.failUnlessEqual(dsds[1,2,3,1],0.0,"ds/ds has wrong value at (1,2,3,1).")  
       self.failUnlessEqual(dsds[1,2,3,2],0.0,"ds/ds has wrong value at (1,2,3,2).")  
       self.failUnlessEqual(dsds[1,2,3,3],0.0,"ds/ds has wrong value at (1,2,3,3).")  
       self.failUnlessEqual(dsds[1,2,3,4],0.0,"ds/ds has wrong value at (1,2,3,4).")  
       self.failUnlessEqual(dsds[1,3,0,0],0.0,"ds/ds has wrong value at (1,3,0,0).")  
       self.failUnlessEqual(dsds[1,3,0,1],0.0,"ds/ds has wrong value at (1,3,0,1).")  
       self.failUnlessEqual(dsds[1,3,0,2],0.0,"ds/ds has wrong value at (1,3,0,2).")  
       self.failUnlessEqual(dsds[1,3,0,3],0.0,"ds/ds has wrong value at (1,3,0,3).")  
       self.failUnlessEqual(dsds[1,3,0,4],0.0,"ds/ds has wrong value at (1,3,0,4).")  
       self.failUnlessEqual(dsds[1,3,1,0],0.0,"ds/ds has wrong value at (1,3,1,0).")  
       self.failUnlessEqual(dsds[1,3,1,1],0.0,"ds/ds has wrong value at (1,3,1,1).")  
       self.failUnlessEqual(dsds[1,3,1,2],0.0,"ds/ds has wrong value at (1,3,1,2).")  
       self.failUnlessEqual(dsds[1,3,1,3],1.0,"ds/ds has wrong value at (1,3,1,3).")  
       self.failUnlessEqual(dsds[1,3,1,4],0.0,"ds/ds has wrong value at (1,3,1,4).")  
       self.failUnlessEqual(dsds[1,3,2,0],0.0,"ds/ds has wrong value at (1,3,2,0).")  
       self.failUnlessEqual(dsds[1,3,2,1],0.0,"ds/ds has wrong value at (1,3,2,1).")  
       self.failUnlessEqual(dsds[1,3,2,2],0.0,"ds/ds has wrong value at (1,3,2,2).")  
       self.failUnlessEqual(dsds[1,3,2,3],0.0,"ds/ds has wrong value at (1,3,2,3).")  
       self.failUnlessEqual(dsds[1,3,2,4],0.0,"ds/ds has wrong value at (1,3,2,4).")  
       self.failUnlessEqual(dsds[1,3,3,0],0.0,"ds/ds has wrong value at (1,3,3,0).")  
       self.failUnlessEqual(dsds[1,3,3,1],0.0,"ds/ds has wrong value at (1,3,3,1).")  
       self.failUnlessEqual(dsds[1,3,3,2],0.0,"ds/ds has wrong value at (1,3,3,2).")  
       self.failUnlessEqual(dsds[1,3,3,3],0.0,"ds/ds has wrong value at (1,3,3,3).")  
       self.failUnlessEqual(dsds[1,3,3,4],0.0,"ds/ds has wrong value at (1,3,3,4).")  
       self.failUnlessEqual(dsds[1,4,0,0],0.0,"ds/ds has wrong value at (1,4,0,0).")  
       self.failUnlessEqual(dsds[1,4,0,1],0.0,"ds/ds has wrong value at (1,4,0,1).")  
       self.failUnlessEqual(dsds[1,4,0,2],0.0,"ds/ds has wrong value at (1,4,0,2).")  
       self.failUnlessEqual(dsds[1,4,0,3],0.0,"ds/ds has wrong value at (1,4,0,3).")  
       self.failUnlessEqual(dsds[1,4,0,4],0.0,"ds/ds has wrong value at (1,4,0,4).")  
       self.failUnlessEqual(dsds[1,4,1,0],0.0,"ds/ds has wrong value at (1,4,1,0).")  
       self.failUnlessEqual(dsds[1,4,1,1],0.0,"ds/ds has wrong value at (1,4,1,1).")  
       self.failUnlessEqual(dsds[1,4,1,2],0.0,"ds/ds has wrong value at (1,4,1,2).")  
       self.failUnlessEqual(dsds[1,4,1,3],0.0,"ds/ds has wrong value at (1,4,1,3).")  
       self.failUnlessEqual(dsds[1,4,1,4],1.0,"ds/ds has wrong value at (1,4,1,4).")  
       self.failUnlessEqual(dsds[1,4,2,0],0.0,"ds/ds has wrong value at (1,4,2,0).")  
       self.failUnlessEqual(dsds[1,4,2,1],0.0,"ds/ds has wrong value at (1,4,2,1).")  
       self.failUnlessEqual(dsds[1,4,2,2],0.0,"ds/ds has wrong value at (1,4,2,2).")  
       self.failUnlessEqual(dsds[1,4,2,3],0.0,"ds/ds has wrong value at (1,4,2,3).")  
       self.failUnlessEqual(dsds[1,4,2,4],0.0,"ds/ds has wrong value at (1,4,2,4).")  
       self.failUnlessEqual(dsds[1,4,3,0],0.0,"ds/ds has wrong value at (1,4,3,0).")  
       self.failUnlessEqual(dsds[1,4,3,1],0.0,"ds/ds has wrong value at (1,4,3,1).")  
       self.failUnlessEqual(dsds[1,4,3,2],0.0,"ds/ds has wrong value at (1,4,3,2).")  
       self.failUnlessEqual(dsds[1,4,3,3],0.0,"ds/ds has wrong value at (1,4,3,3).")  
       self.failUnlessEqual(dsds[1,4,3,4],0.0,"ds/ds has wrong value at (1,4,3,4).")  
       self.failUnlessEqual(dsds[2,0,0,0],0.0,"ds/ds has wrong value at (2,0,0,0).")  
       self.failUnlessEqual(dsds[2,0,0,1],0.0,"ds/ds has wrong value at (2,0,0,1).")  
       self.failUnlessEqual(dsds[2,0,0,2],0.0,"ds/ds has wrong value at (2,0,0,2).")  
       self.failUnlessEqual(dsds[2,0,0,3],0.0,"ds/ds has wrong value at (2,0,0,3).")  
       self.failUnlessEqual(dsds[2,0,0,4],0.0,"ds/ds has wrong value at (2,0,0,4).")  
       self.failUnlessEqual(dsds[2,0,1,0],0.0,"ds/ds has wrong value at (2,0,1,0).")  
       self.failUnlessEqual(dsds[2,0,1,1],0.0,"ds/ds has wrong value at (2,0,1,1).")  
       self.failUnlessEqual(dsds[2,0,1,2],0.0,"ds/ds has wrong value at (2,0,1,2).")  
       self.failUnlessEqual(dsds[2,0,1,3],0.0,"ds/ds has wrong value at (2,0,1,3).")  
       self.failUnlessEqual(dsds[2,0,1,4],0.0,"ds/ds has wrong value at (2,0,1,4).")  
       self.failUnlessEqual(dsds[2,0,2,0],1.0,"ds/ds has wrong value at (2,0,2,0).")  
       self.failUnlessEqual(dsds[2,0,2,1],0.0,"ds/ds has wrong value at (2,0,2,1).")  
       self.failUnlessEqual(dsds[2,0,2,2],0.0,"ds/ds has wrong value at (2,0,2,2).")  
       self.failUnlessEqual(dsds[2,0,2,3],0.0,"ds/ds has wrong value at (2,0,2,3).")  
       self.failUnlessEqual(dsds[2,0,2,4],0.0,"ds/ds has wrong value at (2,0,2,4).")  
       self.failUnlessEqual(dsds[2,0,3,0],0.0,"ds/ds has wrong value at (2,0,3,0).")  
       self.failUnlessEqual(dsds[2,0,3,1],0.0,"ds/ds has wrong value at (2,0,3,1).")  
       self.failUnlessEqual(dsds[2,0,3,2],0.0,"ds/ds has wrong value at (2,0,3,2).")  
       self.failUnlessEqual(dsds[2,0,3,3],0.0,"ds/ds has wrong value at (2,0,3,3).")  
       self.failUnlessEqual(dsds[2,0,3,4],0.0,"ds/ds has wrong value at (2,0,3,4).")  
       self.failUnlessEqual(dsds[2,1,0,0],0.0,"ds/ds has wrong value at (2,1,0,0).")  
       self.failUnlessEqual(dsds[2,1,0,1],0.0,"ds/ds has wrong value at (2,1,0,1).")  
       self.failUnlessEqual(dsds[2,1,0,2],0.0,"ds/ds has wrong value at (2,1,0,2).")  
       self.failUnlessEqual(dsds[2,1,0,3],0.0,"ds/ds has wrong value at (2,1,0,3).")  
       self.failUnlessEqual(dsds[2,1,0,4],0.0,"ds/ds has wrong value at (2,1,0,4).")  
       self.failUnlessEqual(dsds[2,1,1,0],0.0,"ds/ds has wrong value at (2,1,1,0).")  
       self.failUnlessEqual(dsds[2,1,1,1],0.0,"ds/ds has wrong value at (2,1,1,1).")  
       self.failUnlessEqual(dsds[2,1,1,2],0.0,"ds/ds has wrong value at (2,1,1,2).")  
       self.failUnlessEqual(dsds[2,1,1,3],0.0,"ds/ds has wrong value at (2,1,1,3).")  
       self.failUnlessEqual(dsds[2,1,1,4],0.0,"ds/ds has wrong value at (2,1,1,4).")  
       self.failUnlessEqual(dsds[2,1,2,0],0.0,"ds/ds has wrong value at (2,1,2,0).")  
       self.failUnlessEqual(dsds[2,1,2,1],1.0,"ds/ds has wrong value at (2,1,2,1).")  
       self.failUnlessEqual(dsds[2,1,2,2],0.0,"ds/ds has wrong value at (2,1,2,2).")  
       self.failUnlessEqual(dsds[2,1,2,3],0.0,"ds/ds has wrong value at (2,1,2,3).")  
       self.failUnlessEqual(dsds[2,1,2,4],0.0,"ds/ds has wrong value at (2,1,2,4).")  
       self.failUnlessEqual(dsds[2,1,3,0],0.0,"ds/ds has wrong value at (2,1,3,0).")  
       self.failUnlessEqual(dsds[2,1,3,1],0.0,"ds/ds has wrong value at (2,1,3,1).")  
       self.failUnlessEqual(dsds[2,1,3,2],0.0,"ds/ds has wrong value at (2,1,3,2).")  
       self.failUnlessEqual(dsds[2,1,3,3],0.0,"ds/ds has wrong value at (2,1,3,3).")  
       self.failUnlessEqual(dsds[2,1,3,4],0.0,"ds/ds has wrong value at (2,1,3,4).")  
       self.failUnlessEqual(dsds[2,2,0,0],0.0,"ds/ds has wrong value at (2,2,0,0).")  
       self.failUnlessEqual(dsds[2,2,0,1],0.0,"ds/ds has wrong value at (2,2,0,1).")  
       self.failUnlessEqual(dsds[2,2,0,2],0.0,"ds/ds has wrong value at (2,2,0,2).")  
       self.failUnlessEqual(dsds[2,2,0,3],0.0,"ds/ds has wrong value at (2,2,0,3).")  
       self.failUnlessEqual(dsds[2,2,0,4],0.0,"ds/ds has wrong value at (2,2,0,4).")  
       self.failUnlessEqual(dsds[2,2,1,0],0.0,"ds/ds has wrong value at (2,2,1,0).")  
       self.failUnlessEqual(dsds[2,2,1,1],0.0,"ds/ds has wrong value at (2,2,1,1).")  
       self.failUnlessEqual(dsds[2,2,1,2],0.0,"ds/ds has wrong value at (2,2,1,2).")  
       self.failUnlessEqual(dsds[2,2,1,3],0.0,"ds/ds has wrong value at (2,2,1,3).")  
       self.failUnlessEqual(dsds[2,2,1,4],0.0,"ds/ds has wrong value at (2,2,1,4).")  
       self.failUnlessEqual(dsds[2,2,2,0],0.0,"ds/ds has wrong value at (2,2,2,0).")  
       self.failUnlessEqual(dsds[2,2,2,1],0.0,"ds/ds has wrong value at (2,2,2,1).")  
       self.failUnlessEqual(dsds[2,2,2,2],1.0,"ds/ds has wrong value at (2,2,2,2).")  
       self.failUnlessEqual(dsds[2,2,2,3],0.0,"ds/ds has wrong value at (2,2,2,3).")  
       self.failUnlessEqual(dsds[2,2,2,4],0.0,"ds/ds has wrong value at (2,2,2,4).")  
       self.failUnlessEqual(dsds[2,2,3,0],0.0,"ds/ds has wrong value at (2,2,3,0).")  
       self.failUnlessEqual(dsds[2,2,3,1],0.0,"ds/ds has wrong value at (2,2,3,1).")  
       self.failUnlessEqual(dsds[2,2,3,2],0.0,"ds/ds has wrong value at (2,2,3,2).")  
       self.failUnlessEqual(dsds[2,2,3,3],0.0,"ds/ds has wrong value at (2,2,3,3).")  
       self.failUnlessEqual(dsds[2,2,3,4],0.0,"ds/ds has wrong value at (2,2,3,4).")  
       self.failUnlessEqual(dsds[2,3,0,0],0.0,"ds/ds has wrong value at (2,3,0,0).")  
       self.failUnlessEqual(dsds[2,3,0,1],0.0,"ds/ds has wrong value at (2,3,0,1).")  
       self.failUnlessEqual(dsds[2,3,0,2],0.0,"ds/ds has wrong value at (2,3,0,2).")  
       self.failUnlessEqual(dsds[2,3,0,3],0.0,"ds/ds has wrong value at (2,3,0,3).")  
       self.failUnlessEqual(dsds[2,3,0,4],0.0,"ds/ds has wrong value at (2,3,0,4).")  
       self.failUnlessEqual(dsds[2,3,1,0],0.0,"ds/ds has wrong value at (2,3,1,0).")  
       self.failUnlessEqual(dsds[2,3,1,1],0.0,"ds/ds has wrong value at (2,3,1,1).")  
       self.failUnlessEqual(dsds[2,3,1,2],0.0,"ds/ds has wrong value at (2,3,1,2).")  
       self.failUnlessEqual(dsds[2,3,1,3],0.0,"ds/ds has wrong value at (2,3,1,3).")  
       self.failUnlessEqual(dsds[2,3,1,4],0.0,"ds/ds has wrong value at (2,3,1,4).")  
       self.failUnlessEqual(dsds[2,3,2,0],0.0,"ds/ds has wrong value at (2,3,2,0).")  
       self.failUnlessEqual(dsds[2,3,2,1],0.0,"ds/ds has wrong value at (2,3,2,1).")  
       self.failUnlessEqual(dsds[2,3,2,2],0.0,"ds/ds has wrong value at (2,3,2,2).")  
       self.failUnlessEqual(dsds[2,3,2,3],1.0,"ds/ds has wrong value at (2,3,2,3).")  
       self.failUnlessEqual(dsds[2,3,2,4],0.0,"ds/ds has wrong value at (2,3,2,4).")  
       self.failUnlessEqual(dsds[2,3,3,0],0.0,"ds/ds has wrong value at (2,3,3,0).")  
       self.failUnlessEqual(dsds[2,3,3,1],0.0,"ds/ds has wrong value at (2,3,3,1).")  
       self.failUnlessEqual(dsds[2,3,3,2],0.0,"ds/ds has wrong value at (2,3,3,2).")  
       self.failUnlessEqual(dsds[2,3,3,3],0.0,"ds/ds has wrong value at (2,3,3,3).")  
       self.failUnlessEqual(dsds[2,3,3,4],0.0,"ds/ds has wrong value at (2,3,3,4).")  
       self.failUnlessEqual(dsds[2,4,0,0],0.0,"ds/ds has wrong value at (2,4,0,0).")  
       self.failUnlessEqual(dsds[2,4,0,1],0.0,"ds/ds has wrong value at (2,4,0,1).")  
       self.failUnlessEqual(dsds[2,4,0,2],0.0,"ds/ds has wrong value at (2,4,0,2).")  
       self.failUnlessEqual(dsds[2,4,0,3],0.0,"ds/ds has wrong value at (2,4,0,3).")  
       self.failUnlessEqual(dsds[2,4,0,4],0.0,"ds/ds has wrong value at (2,4,0,4).")  
       self.failUnlessEqual(dsds[2,4,1,0],0.0,"ds/ds has wrong value at (2,4,1,0).")  
       self.failUnlessEqual(dsds[2,4,1,1],0.0,"ds/ds has wrong value at (2,4,1,1).")  
       self.failUnlessEqual(dsds[2,4,1,2],0.0,"ds/ds has wrong value at (2,4,1,2).")  
       self.failUnlessEqual(dsds[2,4,1,3],0.0,"ds/ds has wrong value at (2,4,1,3).")  
       self.failUnlessEqual(dsds[2,4,1,4],0.0,"ds/ds has wrong value at (2,4,1,4).")  
       self.failUnlessEqual(dsds[2,4,2,0],0.0,"ds/ds has wrong value at (2,4,2,0).")  
       self.failUnlessEqual(dsds[2,4,2,1],0.0,"ds/ds has wrong value at (2,4,2,1).")  
       self.failUnlessEqual(dsds[2,4,2,2],0.0,"ds/ds has wrong value at (2,4,2,2).")  
       self.failUnlessEqual(dsds[2,4,2,3],0.0,"ds/ds has wrong value at (2,4,2,3).")  
       self.failUnlessEqual(dsds[2,4,2,4],1.0,"ds/ds has wrong value at (2,4,2,4).")  
       self.failUnlessEqual(dsds[2,4,3,0],0.0,"ds/ds has wrong value at (2,4,3,0).")  
       self.failUnlessEqual(dsds[2,4,3,1],0.0,"ds/ds has wrong value at (2,4,3,1).")  
       self.failUnlessEqual(dsds[2,4,3,2],0.0,"ds/ds has wrong value at (2,4,3,2).")  
       self.failUnlessEqual(dsds[2,4,3,3],0.0,"ds/ds has wrong value at (2,4,3,3).")  
       self.failUnlessEqual(dsds[2,4,3,4],0.0,"ds/ds has wrong value at (2,4,3,4).")  
       self.failUnlessEqual(dsds[3,0,0,0],0.0,"ds/ds has wrong value at (3,0,0,0).")  
       self.failUnlessEqual(dsds[3,0,0,1],0.0,"ds/ds has wrong value at (3,0,0,1).")  
       self.failUnlessEqual(dsds[3,0,0,2],0.0,"ds/ds has wrong value at (3,0,0,2).")  
       self.failUnlessEqual(dsds[3,0,0,3],0.0,"ds/ds has wrong value at (3,0,0,3).")  
       self.failUnlessEqual(dsds[3,0,0,4],0.0,"ds/ds has wrong value at (3,0,0,4).")  
       self.failUnlessEqual(dsds[3,0,1,0],0.0,"ds/ds has wrong value at (3,0,1,0).")  
       self.failUnlessEqual(dsds[3,0,1,1],0.0,"ds/ds has wrong value at (3,0,1,1).")  
       self.failUnlessEqual(dsds[3,0,1,2],0.0,"ds/ds has wrong value at (3,0,1,2).")  
       self.failUnlessEqual(dsds[3,0,1,3],0.0,"ds/ds has wrong value at (3,0,1,3).")  
       self.failUnlessEqual(dsds[3,0,1,4],0.0,"ds/ds has wrong value at (3,0,1,4).")  
       self.failUnlessEqual(dsds[3,0,2,0],0.0,"ds/ds has wrong value at (3,0,2,0).")  
       self.failUnlessEqual(dsds[3,0,2,1],0.0,"ds/ds has wrong value at (3,0,2,1).")  
       self.failUnlessEqual(dsds[3,0,2,2],0.0,"ds/ds has wrong value at (3,0,2,2).")  
       self.failUnlessEqual(dsds[3,0,2,3],0.0,"ds/ds has wrong value at (3,0,2,3).")  
       self.failUnlessEqual(dsds[3,0,2,4],0.0,"ds/ds has wrong value at (3,0,2,4).")  
       self.failUnlessEqual(dsds[3,0,3,0],1.0,"ds/ds has wrong value at (3,0,3,0).")  
       self.failUnlessEqual(dsds[3,0,3,1],0.0,"ds/ds has wrong value at (3,0,3,1).")  
       self.failUnlessEqual(dsds[3,0,3,2],0.0,"ds/ds has wrong value at (3,0,3,2).")  
       self.failUnlessEqual(dsds[3,0,3,3],0.0,"ds/ds has wrong value at (3,0,3,3).")  
       self.failUnlessEqual(dsds[3,0,3,4],0.0,"ds/ds has wrong value at (3,0,3,4).")  
       self.failUnlessEqual(dsds[3,1,0,0],0.0,"ds/ds has wrong value at (3,1,0,0).")  
       self.failUnlessEqual(dsds[3,1,0,1],0.0,"ds/ds has wrong value at (3,1,0,1).")  
       self.failUnlessEqual(dsds[3,1,0,2],0.0,"ds/ds has wrong value at (3,1,0,2).")  
       self.failUnlessEqual(dsds[3,1,0,3],0.0,"ds/ds has wrong value at (3,1,0,3).")  
       self.failUnlessEqual(dsds[3,1,0,4],0.0,"ds/ds has wrong value at (3,1,0,4).")  
       self.failUnlessEqual(dsds[3,1,1,0],0.0,"ds/ds has wrong value at (3,1,1,0).")  
       self.failUnlessEqual(dsds[3,1,1,1],0.0,"ds/ds has wrong value at (3,1,1,1).")  
       self.failUnlessEqual(dsds[3,1,1,2],0.0,"ds/ds has wrong value at (3,1,1,2).")  
       self.failUnlessEqual(dsds[3,1,1,3],0.0,"ds/ds has wrong value at (3,1,1,3).")  
       self.failUnlessEqual(dsds[3,1,1,4],0.0,"ds/ds has wrong value at (3,1,1,4).")  
       self.failUnlessEqual(dsds[3,1,2,0],0.0,"ds/ds has wrong value at (3,1,2,0).")  
       self.failUnlessEqual(dsds[3,1,2,1],0.0,"ds/ds has wrong value at (3,1,2,1).")  
       self.failUnlessEqual(dsds[3,1,2,2],0.0,"ds/ds has wrong value at (3,1,2,2).")  
       self.failUnlessEqual(dsds[3,1,2,3],0.0,"ds/ds has wrong value at (3,1,2,3).")  
       self.failUnlessEqual(dsds[3,1,2,4],0.0,"ds/ds has wrong value at (3,1,2,4).")  
       self.failUnlessEqual(dsds[3,1,3,0],0.0,"ds/ds has wrong value at (3,1,3,0).")  
       self.failUnlessEqual(dsds[3,1,3,1],1.0,"ds/ds has wrong value at (3,1,3,1).")  
       self.failUnlessEqual(dsds[3,1,3,2],0.0,"ds/ds has wrong value at (3,1,3,2).")  
       self.failUnlessEqual(dsds[3,1,3,3],0.0,"ds/ds has wrong value at (3,1,3,3).")  
       self.failUnlessEqual(dsds[3,1,3,4],0.0,"ds/ds has wrong value at (3,1,3,4).")  
       self.failUnlessEqual(dsds[3,2,0,0],0.0,"ds/ds has wrong value at (3,2,0,0).")  
       self.failUnlessEqual(dsds[3,2,0,1],0.0,"ds/ds has wrong value at (3,2,0,1).")  
       self.failUnlessEqual(dsds[3,2,0,2],0.0,"ds/ds has wrong value at (3,2,0,2).")  
       self.failUnlessEqual(dsds[3,2,0,3],0.0,"ds/ds has wrong value at (3,2,0,3).")  
       self.failUnlessEqual(dsds[3,2,0,4],0.0,"ds/ds has wrong value at (3,2,0,4).")  
       self.failUnlessEqual(dsds[3,2,1,0],0.0,"ds/ds has wrong value at (3,2,1,0).")  
       self.failUnlessEqual(dsds[3,2,1,1],0.0,"ds/ds has wrong value at (3,2,1,1).")  
       self.failUnlessEqual(dsds[3,2,1,2],0.0,"ds/ds has wrong value at (3,2,1,2).")  
       self.failUnlessEqual(dsds[3,2,1,3],0.0,"ds/ds has wrong value at (3,2,1,3).")  
       self.failUnlessEqual(dsds[3,2,1,4],0.0,"ds/ds has wrong value at (3,2,1,4).")  
       self.failUnlessEqual(dsds[3,2,2,0],0.0,"ds/ds has wrong value at (3,2,2,0).")  
       self.failUnlessEqual(dsds[3,2,2,1],0.0,"ds/ds has wrong value at (3,2,2,1).")  
       self.failUnlessEqual(dsds[3,2,2,2],0.0,"ds/ds has wrong value at (3,2,2,2).")  
       self.failUnlessEqual(dsds[3,2,2,3],0.0,"ds/ds has wrong value at (3,2,2,3).")  
       self.failUnlessEqual(dsds[3,2,2,4],0.0,"ds/ds has wrong value at (3,2,2,4).")  
       self.failUnlessEqual(dsds[3,2,3,0],0.0,"ds/ds has wrong value at (3,2,3,0).")  
       self.failUnlessEqual(dsds[3,2,3,1],0.0,"ds/ds has wrong value at (3,2,3,1).")  
       self.failUnlessEqual(dsds[3,2,3,2],1.0,"ds/ds has wrong value at (3,2,3,2).")  
       self.failUnlessEqual(dsds[3,2,3,3],0.0,"ds/ds has wrong value at (3,2,3,3).")  
       self.failUnlessEqual(dsds[3,2,3,4],0.0,"ds/ds has wrong value at (3,2,3,4).")  
       self.failUnlessEqual(dsds[3,3,0,0],0.0,"ds/ds has wrong value at (3,3,0,0).")  
       self.failUnlessEqual(dsds[3,3,0,1],0.0,"ds/ds has wrong value at (3,3,0,1).")  
       self.failUnlessEqual(dsds[3,3,0,2],0.0,"ds/ds has wrong value at (3,3,0,2).")  
       self.failUnlessEqual(dsds[3,3,0,3],0.0,"ds/ds has wrong value at (3,3,0,3).")  
       self.failUnlessEqual(dsds[3,3,0,4],0.0,"ds/ds has wrong value at (3,3,0,4).")  
       self.failUnlessEqual(dsds[3,3,1,0],0.0,"ds/ds has wrong value at (3,3,1,0).")  
       self.failUnlessEqual(dsds[3,3,1,1],0.0,"ds/ds has wrong value at (3,3,1,1).")  
       self.failUnlessEqual(dsds[3,3,1,2],0.0,"ds/ds has wrong value at (3,3,1,2).")  
       self.failUnlessEqual(dsds[3,3,1,3],0.0,"ds/ds has wrong value at (3,3,1,3).")  
       self.failUnlessEqual(dsds[3,3,1,4],0.0,"ds/ds has wrong value at (3,3,1,4).")  
       self.failUnlessEqual(dsds[3,3,2,0],0.0,"ds/ds has wrong value at (3,3,2,0).")  
       self.failUnlessEqual(dsds[3,3,2,1],0.0,"ds/ds has wrong value at (3,3,2,1).")  
       self.failUnlessEqual(dsds[3,3,2,2],0.0,"ds/ds has wrong value at (3,3,2,2).")  
       self.failUnlessEqual(dsds[3,3,2,3],0.0,"ds/ds has wrong value at (3,3,2,3).")  
       self.failUnlessEqual(dsds[3,3,2,4],0.0,"ds/ds has wrong value at (3,3,2,4).")  
       self.failUnlessEqual(dsds[3,3,3,0],0.0,"ds/ds has wrong value at (3,3,3,0).")  
       self.failUnlessEqual(dsds[3,3,3,1],0.0,"ds/ds has wrong value at (3,3,3,1).")  
       self.failUnlessEqual(dsds[3,3,3,2],0.0,"ds/ds has wrong value at (3,3,3,2).")  
       self.failUnlessEqual(dsds[3,3,3,3],1.0,"ds/ds has wrong value at (3,3,3,3).")  
       self.failUnlessEqual(dsds[3,3,3,4],0.0,"ds/ds has wrong value at (3,3,3,4).")  
       self.failUnlessEqual(dsds[3,4,0,0],0.0,"ds/ds has wrong value at (3,4,0,0).")  
       self.failUnlessEqual(dsds[3,4,0,1],0.0,"ds/ds has wrong value at (3,4,0,1).")  
       self.failUnlessEqual(dsds[3,4,0,2],0.0,"ds/ds has wrong value at (3,4,0,2).")  
       self.failUnlessEqual(dsds[3,4,0,3],0.0,"ds/ds has wrong value at (3,4,0,3).")  
       self.failUnlessEqual(dsds[3,4,0,4],0.0,"ds/ds has wrong value at (3,4,0,4).")  
       self.failUnlessEqual(dsds[3,4,1,0],0.0,"ds/ds has wrong value at (3,4,1,0).")  
       self.failUnlessEqual(dsds[3,4,1,1],0.0,"ds/ds has wrong value at (3,4,1,1).")  
       self.failUnlessEqual(dsds[3,4,1,2],0.0,"ds/ds has wrong value at (3,4,1,2).")  
       self.failUnlessEqual(dsds[3,4,1,3],0.0,"ds/ds has wrong value at (3,4,1,3).")  
       self.failUnlessEqual(dsds[3,4,1,4],0.0,"ds/ds has wrong value at (3,4,1,4).")  
       self.failUnlessEqual(dsds[3,4,2,0],0.0,"ds/ds has wrong value at (3,4,2,0).")  
       self.failUnlessEqual(dsds[3,4,2,1],0.0,"ds/ds has wrong value at (3,4,2,1).")  
       self.failUnlessEqual(dsds[3,4,2,2],0.0,"ds/ds has wrong value at (3,4,2,2).")  
       self.failUnlessEqual(dsds[3,4,2,3],0.0,"ds/ds has wrong value at (3,4,2,3).")  
       self.failUnlessEqual(dsds[3,4,2,4],0.0,"ds/ds has wrong value at (3,4,2,4).")  
       self.failUnlessEqual(dsds[3,4,3,0],0.0,"ds/ds has wrong value at (3,4,3,0).")  
       self.failUnlessEqual(dsds[3,4,3,1],0.0,"ds/ds has wrong value at (3,4,3,1).")  
       self.failUnlessEqual(dsds[3,4,3,2],0.0,"ds/ds has wrong value at (3,4,3,2).")  
       self.failUnlessEqual(dsds[3,4,3,3],0.0,"ds/ds has wrong value at (3,4,3,3).")  
       self.failUnlessEqual(dsds[3,4,3,4],1.0,"ds/ds has wrong value at (3,4,3,4).")  
   
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),0,"wrong number of substituted arguments")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(4, 5),dim=None)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((4, 5))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank2_dNone_nargs1(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(4, 5),dim=None,args=[s2])  
       self.failUnlessEqual(s.getRank(),2,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(4, 5),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),None,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[s2],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((4, 5))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(4, 5),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(4, 5, 4, 5),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0,0,0],1.0,"ds/ds has wrong value at (0,0,0,0).")  
       self.failUnlessEqual(dsds[0,0,0,1],0.0,"ds/ds has wrong value at (0,0,0,1).")  
       self.failUnlessEqual(dsds[0,0,0,2],0.0,"ds/ds has wrong value at (0,0,0,2).")  
       self.failUnlessEqual(dsds[0,0,0,3],0.0,"ds/ds has wrong value at (0,0,0,3).")  
       self.failUnlessEqual(dsds[0,0,0,4],0.0,"ds/ds has wrong value at (0,0,0,4).")  
       self.failUnlessEqual(dsds[0,0,1,0],0.0,"ds/ds has wrong value at (0,0,1,0).")  
       self.failUnlessEqual(dsds[0,0,1,1],0.0,"ds/ds has wrong value at (0,0,1,1).")  
       self.failUnlessEqual(dsds[0,0,1,2],0.0,"ds/ds has wrong value at (0,0,1,2).")  
       self.failUnlessEqual(dsds[0,0,1,3],0.0,"ds/ds has wrong value at (0,0,1,3).")  
       self.failUnlessEqual(dsds[0,0,1,4],0.0,"ds/ds has wrong value at (0,0,1,4).")  
       self.failUnlessEqual(dsds[0,0,2,0],0.0,"ds/ds has wrong value at (0,0,2,0).")  
       self.failUnlessEqual(dsds[0,0,2,1],0.0,"ds/ds has wrong value at (0,0,2,1).")  
       self.failUnlessEqual(dsds[0,0,2,2],0.0,"ds/ds has wrong value at (0,0,2,2).")  
       self.failUnlessEqual(dsds[0,0,2,3],0.0,"ds/ds has wrong value at (0,0,2,3).")  
       self.failUnlessEqual(dsds[0,0,2,4],0.0,"ds/ds has wrong value at (0,0,2,4).")  
       self.failUnlessEqual(dsds[0,0,3,0],0.0,"ds/ds has wrong value at (0,0,3,0).")  
       self.failUnlessEqual(dsds[0,0,3,1],0.0,"ds/ds has wrong value at (0,0,3,1).")  
       self.failUnlessEqual(dsds[0,0,3,2],0.0,"ds/ds has wrong value at (0,0,3,2).")  
       self.failUnlessEqual(dsds[0,0,3,3],0.0,"ds/ds has wrong value at (0,0,3,3).")  
       self.failUnlessEqual(dsds[0,0,3,4],0.0,"ds/ds has wrong value at (0,0,3,4).")  
       self.failUnlessEqual(dsds[0,1,0,0],0.0,"ds/ds has wrong value at (0,1,0,0).")  
       self.failUnlessEqual(dsds[0,1,0,1],1.0,"ds/ds has wrong value at (0,1,0,1).")  
       self.failUnlessEqual(dsds[0,1,0,2],0.0,"ds/ds has wrong value at (0,1,0,2).")  
       self.failUnlessEqual(dsds[0,1,0,3],0.0,"ds/ds has wrong value at (0,1,0,3).")  
       self.failUnlessEqual(dsds[0,1,0,4],0.0,"ds/ds has wrong value at (0,1,0,4).")  
       self.failUnlessEqual(dsds[0,1,1,0],0.0,"ds/ds has wrong value at (0,1,1,0).")  
       self.failUnlessEqual(dsds[0,1,1,1],0.0,"ds/ds has wrong value at (0,1,1,1).")  
       self.failUnlessEqual(dsds[0,1,1,2],0.0,"ds/ds has wrong value at (0,1,1,2).")  
       self.failUnlessEqual(dsds[0,1,1,3],0.0,"ds/ds has wrong value at (0,1,1,3).")  
       self.failUnlessEqual(dsds[0,1,1,4],0.0,"ds/ds has wrong value at (0,1,1,4).")  
       self.failUnlessEqual(dsds[0,1,2,0],0.0,"ds/ds has wrong value at (0,1,2,0).")  
       self.failUnlessEqual(dsds[0,1,2,1],0.0,"ds/ds has wrong value at (0,1,2,1).")  
       self.failUnlessEqual(dsds[0,1,2,2],0.0,"ds/ds has wrong value at (0,1,2,2).")  
       self.failUnlessEqual(dsds[0,1,2,3],0.0,"ds/ds has wrong value at (0,1,2,3).")  
       self.failUnlessEqual(dsds[0,1,2,4],0.0,"ds/ds has wrong value at (0,1,2,4).")  
       self.failUnlessEqual(dsds[0,1,3,0],0.0,"ds/ds has wrong value at (0,1,3,0).")  
       self.failUnlessEqual(dsds[0,1,3,1],0.0,"ds/ds has wrong value at (0,1,3,1).")  
       self.failUnlessEqual(dsds[0,1,3,2],0.0,"ds/ds has wrong value at (0,1,3,2).")  
       self.failUnlessEqual(dsds[0,1,3,3],0.0,"ds/ds has wrong value at (0,1,3,3).")  
       self.failUnlessEqual(dsds[0,1,3,4],0.0,"ds/ds has wrong value at (0,1,3,4).")  
       self.failUnlessEqual(dsds[0,2,0,0],0.0,"ds/ds has wrong value at (0,2,0,0).")  
       self.failUnlessEqual(dsds[0,2,0,1],0.0,"ds/ds has wrong value at (0,2,0,1).")  
       self.failUnlessEqual(dsds[0,2,0,2],1.0,"ds/ds has wrong value at (0,2,0,2).")  
       self.failUnlessEqual(dsds[0,2,0,3],0.0,"ds/ds has wrong value at (0,2,0,3).")  
       self.failUnlessEqual(dsds[0,2,0,4],0.0,"ds/ds has wrong value at (0,2,0,4).")  
       self.failUnlessEqual(dsds[0,2,1,0],0.0,"ds/ds has wrong value at (0,2,1,0).")  
       self.failUnlessEqual(dsds[0,2,1,1],0.0,"ds/ds has wrong value at (0,2,1,1).")  
       self.failUnlessEqual(dsds[0,2,1,2],0.0,"ds/ds has wrong value at (0,2,1,2).")  
       self.failUnlessEqual(dsds[0,2,1,3],0.0,"ds/ds has wrong value at (0,2,1,3).")  
       self.failUnlessEqual(dsds[0,2,1,4],0.0,"ds/ds has wrong value at (0,2,1,4).")  
       self.failUnlessEqual(dsds[0,2,2,0],0.0,"ds/ds has wrong value at (0,2,2,0).")  
       self.failUnlessEqual(dsds[0,2,2,1],0.0,"ds/ds has wrong value at (0,2,2,1).")  
       self.failUnlessEqual(dsds[0,2,2,2],0.0,"ds/ds has wrong value at (0,2,2,2).")  
       self.failUnlessEqual(dsds[0,2,2,3],0.0,"ds/ds has wrong value at (0,2,2,3).")  
       self.failUnlessEqual(dsds[0,2,2,4],0.0,"ds/ds has wrong value at (0,2,2,4).")  
       self.failUnlessEqual(dsds[0,2,3,0],0.0,"ds/ds has wrong value at (0,2,3,0).")  
       self.failUnlessEqual(dsds[0,2,3,1],0.0,"ds/ds has wrong value at (0,2,3,1).")  
       self.failUnlessEqual(dsds[0,2,3,2],0.0,"ds/ds has wrong value at (0,2,3,2).")  
       self.failUnlessEqual(dsds[0,2,3,3],0.0,"ds/ds has wrong value at (0,2,3,3).")  
       self.failUnlessEqual(dsds[0,2,3,4],0.0,"ds/ds has wrong value at (0,2,3,4).")  
       self.failUnlessEqual(dsds[0,3,0,0],0.0,"ds/ds has wrong value at (0,3,0,0).")  
       self.failUnlessEqual(dsds[0,3,0,1],0.0,"ds/ds has wrong value at (0,3,0,1).")  
       self.failUnlessEqual(dsds[0,3,0,2],0.0,"ds/ds has wrong value at (0,3,0,2).")  
       self.failUnlessEqual(dsds[0,3,0,3],1.0,"ds/ds has wrong value at (0,3,0,3).")  
       self.failUnlessEqual(dsds[0,3,0,4],0.0,"ds/ds has wrong value at (0,3,0,4).")  
       self.failUnlessEqual(dsds[0,3,1,0],0.0,"ds/ds has wrong value at (0,3,1,0).")  
       self.failUnlessEqual(dsds[0,3,1,1],0.0,"ds/ds has wrong value at (0,3,1,1).")  
       self.failUnlessEqual(dsds[0,3,1,2],0.0,"ds/ds has wrong value at (0,3,1,2).")  
       self.failUnlessEqual(dsds[0,3,1,3],0.0,"ds/ds has wrong value at (0,3,1,3).")  
       self.failUnlessEqual(dsds[0,3,1,4],0.0,"ds/ds has wrong value at (0,3,1,4).")  
       self.failUnlessEqual(dsds[0,3,2,0],0.0,"ds/ds has wrong value at (0,3,2,0).")  
       self.failUnlessEqual(dsds[0,3,2,1],0.0,"ds/ds has wrong value at (0,3,2,1).")  
       self.failUnlessEqual(dsds[0,3,2,2],0.0,"ds/ds has wrong value at (0,3,2,2).")  
       self.failUnlessEqual(dsds[0,3,2,3],0.0,"ds/ds has wrong value at (0,3,2,3).")  
       self.failUnlessEqual(dsds[0,3,2,4],0.0,"ds/ds has wrong value at (0,3,2,4).")  
       self.failUnlessEqual(dsds[0,3,3,0],0.0,"ds/ds has wrong value at (0,3,3,0).")  
       self.failUnlessEqual(dsds[0,3,3,1],0.0,"ds/ds has wrong value at (0,3,3,1).")  
       self.failUnlessEqual(dsds[0,3,3,2],0.0,"ds/ds has wrong value at (0,3,3,2).")  
       self.failUnlessEqual(dsds[0,3,3,3],0.0,"ds/ds has wrong value at (0,3,3,3).")  
       self.failUnlessEqual(dsds[0,3,3,4],0.0,"ds/ds has wrong value at (0,3,3,4).")  
       self.failUnlessEqual(dsds[0,4,0,0],0.0,"ds/ds has wrong value at (0,4,0,0).")  
       self.failUnlessEqual(dsds[0,4,0,1],0.0,"ds/ds has wrong value at (0,4,0,1).")  
       self.failUnlessEqual(dsds[0,4,0,2],0.0,"ds/ds has wrong value at (0,4,0,2).")  
       self.failUnlessEqual(dsds[0,4,0,3],0.0,"ds/ds has wrong value at (0,4,0,3).")  
       self.failUnlessEqual(dsds[0,4,0,4],1.0,"ds/ds has wrong value at (0,4,0,4).")  
       self.failUnlessEqual(dsds[0,4,1,0],0.0,"ds/ds has wrong value at (0,4,1,0).")  
       self.failUnlessEqual(dsds[0,4,1,1],0.0,"ds/ds has wrong value at (0,4,1,1).")  
       self.failUnlessEqual(dsds[0,4,1,2],0.0,"ds/ds has wrong value at (0,4,1,2).")  
       self.failUnlessEqual(dsds[0,4,1,3],0.0,"ds/ds has wrong value at (0,4,1,3).")  
       self.failUnlessEqual(dsds[0,4,1,4],0.0,"ds/ds has wrong value at (0,4,1,4).")  
       self.failUnlessEqual(dsds[0,4,2,0],0.0,"ds/ds has wrong value at (0,4,2,0).")  
       self.failUnlessEqual(dsds[0,4,2,1],0.0,"ds/ds has wrong value at (0,4,2,1).")  
       self.failUnlessEqual(dsds[0,4,2,2],0.0,"ds/ds has wrong value at (0,4,2,2).")  
       self.failUnlessEqual(dsds[0,4,2,3],0.0,"ds/ds has wrong value at (0,4,2,3).")  
       self.failUnlessEqual(dsds[0,4,2,4],0.0,"ds/ds has wrong value at (0,4,2,4).")  
       self.failUnlessEqual(dsds[0,4,3,0],0.0,"ds/ds has wrong value at (0,4,3,0).")  
       self.failUnlessEqual(dsds[0,4,3,1],0.0,"ds/ds has wrong value at (0,4,3,1).")  
       self.failUnlessEqual(dsds[0,4,3,2],0.0,"ds/ds has wrong value at (0,4,3,2).")  
       self.failUnlessEqual(dsds[0,4,3,3],0.0,"ds/ds has wrong value at (0,4,3,3).")  
       self.failUnlessEqual(dsds[0,4,3,4],0.0,"ds/ds has wrong value at (0,4,3,4).")  
       self.failUnlessEqual(dsds[1,0,0,0],0.0,"ds/ds has wrong value at (1,0,0,0).")  
       self.failUnlessEqual(dsds[1,0,0,1],0.0,"ds/ds has wrong value at (1,0,0,1).")  
       self.failUnlessEqual(dsds[1,0,0,2],0.0,"ds/ds has wrong value at (1,0,0,2).")  
       self.failUnlessEqual(dsds[1,0,0,3],0.0,"ds/ds has wrong value at (1,0,0,3).")  
       self.failUnlessEqual(dsds[1,0,0,4],0.0,"ds/ds has wrong value at (1,0,0,4).")  
       self.failUnlessEqual(dsds[1,0,1,0],1.0,"ds/ds has wrong value at (1,0,1,0).")  
       self.failUnlessEqual(dsds[1,0,1,1],0.0,"ds/ds has wrong value at (1,0,1,1).")  
       self.failUnlessEqual(dsds[1,0,1,2],0.0,"ds/ds has wrong value at (1,0,1,2).")  
       self.failUnlessEqual(dsds[1,0,1,3],0.0,"ds/ds has wrong value at (1,0,1,3).")  
       self.failUnlessEqual(dsds[1,0,1,4],0.0,"ds/ds has wrong value at (1,0,1,4).")  
       self.failUnlessEqual(dsds[1,0,2,0],0.0,"ds/ds has wrong value at (1,0,2,0).")  
       self.failUnlessEqual(dsds[1,0,2,1],0.0,"ds/ds has wrong value at (1,0,2,1).")  
       self.failUnlessEqual(dsds[1,0,2,2],0.0,"ds/ds has wrong value at (1,0,2,2).")  
       self.failUnlessEqual(dsds[1,0,2,3],0.0,"ds/ds has wrong value at (1,0,2,3).")  
       self.failUnlessEqual(dsds[1,0,2,4],0.0,"ds/ds has wrong value at (1,0,2,4).")  
       self.failUnlessEqual(dsds[1,0,3,0],0.0,"ds/ds has wrong value at (1,0,3,0).")  
       self.failUnlessEqual(dsds[1,0,3,1],0.0,"ds/ds has wrong value at (1,0,3,1).")  
       self.failUnlessEqual(dsds[1,0,3,2],0.0,"ds/ds has wrong value at (1,0,3,2).")  
       self.failUnlessEqual(dsds[1,0,3,3],0.0,"ds/ds has wrong value at (1,0,3,3).")  
       self.failUnlessEqual(dsds[1,0,3,4],0.0,"ds/ds has wrong value at (1,0,3,4).")  
       self.failUnlessEqual(dsds[1,1,0,0],0.0,"ds/ds has wrong value at (1,1,0,0).")  
       self.failUnlessEqual(dsds[1,1,0,1],0.0,"ds/ds has wrong value at (1,1,0,1).")  
       self.failUnlessEqual(dsds[1,1,0,2],0.0,"ds/ds has wrong value at (1,1,0,2).")  
       self.failUnlessEqual(dsds[1,1,0,3],0.0,"ds/ds has wrong value at (1,1,0,3).")  
       self.failUnlessEqual(dsds[1,1,0,4],0.0,"ds/ds has wrong value at (1,1,0,4).")  
       self.failUnlessEqual(dsds[1,1,1,0],0.0,"ds/ds has wrong value at (1,1,1,0).")  
       self.failUnlessEqual(dsds[1,1,1,1],1.0,"ds/ds has wrong value at (1,1,1,1).")  
       self.failUnlessEqual(dsds[1,1,1,2],0.0,"ds/ds has wrong value at (1,1,1,2).")  
       self.failUnlessEqual(dsds[1,1,1,3],0.0,"ds/ds has wrong value at (1,1,1,3).")  
       self.failUnlessEqual(dsds[1,1,1,4],0.0,"ds/ds has wrong value at (1,1,1,4).")  
       self.failUnlessEqual(dsds[1,1,2,0],0.0,"ds/ds has wrong value at (1,1,2,0).")  
       self.failUnlessEqual(dsds[1,1,2,1],0.0,"ds/ds has wrong value at (1,1,2,1).")  
       self.failUnlessEqual(dsds[1,1,2,2],0.0,"ds/ds has wrong value at (1,1,2,2).")  
       self.failUnlessEqual(dsds[1,1,2,3],0.0,"ds/ds has wrong value at (1,1,2,3).")  
       self.failUnlessEqual(dsds[1,1,2,4],0.0,"ds/ds has wrong value at (1,1,2,4).")  
       self.failUnlessEqual(dsds[1,1,3,0],0.0,"ds/ds has wrong value at (1,1,3,0).")  
       self.failUnlessEqual(dsds[1,1,3,1],0.0,"ds/ds has wrong value at (1,1,3,1).")  
       self.failUnlessEqual(dsds[1,1,3,2],0.0,"ds/ds has wrong value at (1,1,3,2).")  
       self.failUnlessEqual(dsds[1,1,3,3],0.0,"ds/ds has wrong value at (1,1,3,3).")  
       self.failUnlessEqual(dsds[1,1,3,4],0.0,"ds/ds has wrong value at (1,1,3,4).")  
       self.failUnlessEqual(dsds[1,2,0,0],0.0,"ds/ds has wrong value at (1,2,0,0).")  
       self.failUnlessEqual(dsds[1,2,0,1],0.0,"ds/ds has wrong value at (1,2,0,1).")  
       self.failUnlessEqual(dsds[1,2,0,2],0.0,"ds/ds has wrong value at (1,2,0,2).")  
       self.failUnlessEqual(dsds[1,2,0,3],0.0,"ds/ds has wrong value at (1,2,0,3).")  
       self.failUnlessEqual(dsds[1,2,0,4],0.0,"ds/ds has wrong value at (1,2,0,4).")  
       self.failUnlessEqual(dsds[1,2,1,0],0.0,"ds/ds has wrong value at (1,2,1,0).")  
       self.failUnlessEqual(dsds[1,2,1,1],0.0,"ds/ds has wrong value at (1,2,1,1).")  
       self.failUnlessEqual(dsds[1,2,1,2],1.0,"ds/ds has wrong value at (1,2,1,2).")  
       self.failUnlessEqual(dsds[1,2,1,3],0.0,"ds/ds has wrong value at (1,2,1,3).")  
       self.failUnlessEqual(dsds[1,2,1,4],0.0,"ds/ds has wrong value at (1,2,1,4).")  
       self.failUnlessEqual(dsds[1,2,2,0],0.0,"ds/ds has wrong value at (1,2,2,0).")  
       self.failUnlessEqual(dsds[1,2,2,1],0.0,"ds/ds has wrong value at (1,2,2,1).")  
       self.failUnlessEqual(dsds[1,2,2,2],0.0,"ds/ds has wrong value at (1,2,2,2).")  
       self.failUnlessEqual(dsds[1,2,2,3],0.0,"ds/ds has wrong value at (1,2,2,3).")  
       self.failUnlessEqual(dsds[1,2,2,4],0.0,"ds/ds has wrong value at (1,2,2,4).")  
       self.failUnlessEqual(dsds[1,2,3,0],0.0,"ds/ds has wrong value at (1,2,3,0).")  
       self.failUnlessEqual(dsds[1,2,3,1],0.0,"ds/ds has wrong value at (1,2,3,1).")  
       self.failUnlessEqual(dsds[1,2,3,2],0.0,"ds/ds has wrong value at (1,2,3,2).")  
       self.failUnlessEqual(dsds[1,2,3,3],0.0,"ds/ds has wrong value at (1,2,3,3).")  
       self.failUnlessEqual(dsds[1,2,3,4],0.0,"ds/ds has wrong value at (1,2,3,4).")  
       self.failUnlessEqual(dsds[1,3,0,0],0.0,"ds/ds has wrong value at (1,3,0,0).")  
       self.failUnlessEqual(dsds[1,3,0,1],0.0,"ds/ds has wrong value at (1,3,0,1).")  
       self.failUnlessEqual(dsds[1,3,0,2],0.0,"ds/ds has wrong value at (1,3,0,2).")  
       self.failUnlessEqual(dsds[1,3,0,3],0.0,"ds/ds has wrong value at (1,3,0,3).")  
       self.failUnlessEqual(dsds[1,3,0,4],0.0,"ds/ds has wrong value at (1,3,0,4).")  
       self.failUnlessEqual(dsds[1,3,1,0],0.0,"ds/ds has wrong value at (1,3,1,0).")  
       self.failUnlessEqual(dsds[1,3,1,1],0.0,"ds/ds has wrong value at (1,3,1,1).")  
       self.failUnlessEqual(dsds[1,3,1,2],0.0,"ds/ds has wrong value at (1,3,1,2).")  
       self.failUnlessEqual(dsds[1,3,1,3],1.0,"ds/ds has wrong value at (1,3,1,3).")  
       self.failUnlessEqual(dsds[1,3,1,4],0.0,"ds/ds has wrong value at (1,3,1,4).")  
       self.failUnlessEqual(dsds[1,3,2,0],0.0,"ds/ds has wrong value at (1,3,2,0).")  
       self.failUnlessEqual(dsds[1,3,2,1],0.0,"ds/ds has wrong value at (1,3,2,1).")  
       self.failUnlessEqual(dsds[1,3,2,2],0.0,"ds/ds has wrong value at (1,3,2,2).")  
       self.failUnlessEqual(dsds[1,3,2,3],0.0,"ds/ds has wrong value at (1,3,2,3).")  
       self.failUnlessEqual(dsds[1,3,2,4],0.0,"ds/ds has wrong value at (1,3,2,4).")  
       self.failUnlessEqual(dsds[1,3,3,0],0.0,"ds/ds has wrong value at (1,3,3,0).")  
       self.failUnlessEqual(dsds[1,3,3,1],0.0,"ds/ds has wrong value at (1,3,3,1).")  
       self.failUnlessEqual(dsds[1,3,3,2],0.0,"ds/ds has wrong value at (1,3,3,2).")  
       self.failUnlessEqual(dsds[1,3,3,3],0.0,"ds/ds has wrong value at (1,3,3,3).")  
       self.failUnlessEqual(dsds[1,3,3,4],0.0,"ds/ds has wrong value at (1,3,3,4).")  
       self.failUnlessEqual(dsds[1,4,0,0],0.0,"ds/ds has wrong value at (1,4,0,0).")  
       self.failUnlessEqual(dsds[1,4,0,1],0.0,"ds/ds has wrong value at (1,4,0,1).")  
       self.failUnlessEqual(dsds[1,4,0,2],0.0,"ds/ds has wrong value at (1,4,0,2).")  
       self.failUnlessEqual(dsds[1,4,0,3],0.0,"ds/ds has wrong value at (1,4,0,3).")  
       self.failUnlessEqual(dsds[1,4,0,4],0.0,"ds/ds has wrong value at (1,4,0,4).")  
       self.failUnlessEqual(dsds[1,4,1,0],0.0,"ds/ds has wrong value at (1,4,1,0).")  
       self.failUnlessEqual(dsds[1,4,1,1],0.0,"ds/ds has wrong value at (1,4,1,1).")  
       self.failUnlessEqual(dsds[1,4,1,2],0.0,"ds/ds has wrong value at (1,4,1,2).")  
       self.failUnlessEqual(dsds[1,4,1,3],0.0,"ds/ds has wrong value at (1,4,1,3).")  
       self.failUnlessEqual(dsds[1,4,1,4],1.0,"ds/ds has wrong value at (1,4,1,4).")  
       self.failUnlessEqual(dsds[1,4,2,0],0.0,"ds/ds has wrong value at (1,4,2,0).")  
       self.failUnlessEqual(dsds[1,4,2,1],0.0,"ds/ds has wrong value at (1,4,2,1).")  
       self.failUnlessEqual(dsds[1,4,2,2],0.0,"ds/ds has wrong value at (1,4,2,2).")  
       self.failUnlessEqual(dsds[1,4,2,3],0.0,"ds/ds has wrong value at (1,4,2,3).")  
       self.failUnlessEqual(dsds[1,4,2,4],0.0,"ds/ds has wrong value at (1,4,2,4).")  
       self.failUnlessEqual(dsds[1,4,3,0],0.0,"ds/ds has wrong value at (1,4,3,0).")  
       self.failUnlessEqual(dsds[1,4,3,1],0.0,"ds/ds has wrong value at (1,4,3,1).")  
       self.failUnlessEqual(dsds[1,4,3,2],0.0,"ds/ds has wrong value at (1,4,3,2).")  
       self.failUnlessEqual(dsds[1,4,3,3],0.0,"ds/ds has wrong value at (1,4,3,3).")  
       self.failUnlessEqual(dsds[1,4,3,4],0.0,"ds/ds has wrong value at (1,4,3,4).")  
       self.failUnlessEqual(dsds[2,0,0,0],0.0,"ds/ds has wrong value at (2,0,0,0).")  
       self.failUnlessEqual(dsds[2,0,0,1],0.0,"ds/ds has wrong value at (2,0,0,1).")  
       self.failUnlessEqual(dsds[2,0,0,2],0.0,"ds/ds has wrong value at (2,0,0,2).")  
       self.failUnlessEqual(dsds[2,0,0,3],0.0,"ds/ds has wrong value at (2,0,0,3).")  
       self.failUnlessEqual(dsds[2,0,0,4],0.0,"ds/ds has wrong value at (2,0,0,4).")  
       self.failUnlessEqual(dsds[2,0,1,0],0.0,"ds/ds has wrong value at (2,0,1,0).")  
       self.failUnlessEqual(dsds[2,0,1,1],0.0,"ds/ds has wrong value at (2,0,1,1).")  
       self.failUnlessEqual(dsds[2,0,1,2],0.0,"ds/ds has wrong value at (2,0,1,2).")  
       self.failUnlessEqual(dsds[2,0,1,3],0.0,"ds/ds has wrong value at (2,0,1,3).")  
       self.failUnlessEqual(dsds[2,0,1,4],0.0,"ds/ds has wrong value at (2,0,1,4).")  
       self.failUnlessEqual(dsds[2,0,2,0],1.0,"ds/ds has wrong value at (2,0,2,0).")  
       self.failUnlessEqual(dsds[2,0,2,1],0.0,"ds/ds has wrong value at (2,0,2,1).")  
       self.failUnlessEqual(dsds[2,0,2,2],0.0,"ds/ds has wrong value at (2,0,2,2).")  
       self.failUnlessEqual(dsds[2,0,2,3],0.0,"ds/ds has wrong value at (2,0,2,3).")  
       self.failUnlessEqual(dsds[2,0,2,4],0.0,"ds/ds has wrong value at (2,0,2,4).")  
       self.failUnlessEqual(dsds[2,0,3,0],0.0,"ds/ds has wrong value at (2,0,3,0).")  
       self.failUnlessEqual(dsds[2,0,3,1],0.0,"ds/ds has wrong value at (2,0,3,1).")  
       self.failUnlessEqual(dsds[2,0,3,2],0.0,"ds/ds has wrong value at (2,0,3,2).")  
       self.failUnlessEqual(dsds[2,0,3,3],0.0,"ds/ds has wrong value at (2,0,3,3).")  
       self.failUnlessEqual(dsds[2,0,3,4],0.0,"ds/ds has wrong value at (2,0,3,4).")  
       self.failUnlessEqual(dsds[2,1,0,0],0.0,"ds/ds has wrong value at (2,1,0,0).")  
       self.failUnlessEqual(dsds[2,1,0,1],0.0,"ds/ds has wrong value at (2,1,0,1).")  
       self.failUnlessEqual(dsds[2,1,0,2],0.0,"ds/ds has wrong value at (2,1,0,2).")  
       self.failUnlessEqual(dsds[2,1,0,3],0.0,"ds/ds has wrong value at (2,1,0,3).")  
       self.failUnlessEqual(dsds[2,1,0,4],0.0,"ds/ds has wrong value at (2,1,0,4).")  
       self.failUnlessEqual(dsds[2,1,1,0],0.0,"ds/ds has wrong value at (2,1,1,0).")  
       self.failUnlessEqual(dsds[2,1,1,1],0.0,"ds/ds has wrong value at (2,1,1,1).")  
       self.failUnlessEqual(dsds[2,1,1,2],0.0,"ds/ds has wrong value at (2,1,1,2).")  
       self.failUnlessEqual(dsds[2,1,1,3],0.0,"ds/ds has wrong value at (2,1,1,3).")  
       self.failUnlessEqual(dsds[2,1,1,4],0.0,"ds/ds has wrong value at (2,1,1,4).")  
       self.failUnlessEqual(dsds[2,1,2,0],0.0,"ds/ds has wrong value at (2,1,2,0).")  
       self.failUnlessEqual(dsds[2,1,2,1],1.0,"ds/ds has wrong value at (2,1,2,1).")  
       self.failUnlessEqual(dsds[2,1,2,2],0.0,"ds/ds has wrong value at (2,1,2,2).")  
       self.failUnlessEqual(dsds[2,1,2,3],0.0,"ds/ds has wrong value at (2,1,2,3).")  
       self.failUnlessEqual(dsds[2,1,2,4],0.0,"ds/ds has wrong value at (2,1,2,4).")  
       self.failUnlessEqual(dsds[2,1,3,0],0.0,"ds/ds has wrong value at (2,1,3,0).")  
       self.failUnlessEqual(dsds[2,1,3,1],0.0,"ds/ds has wrong value at (2,1,3,1).")  
       self.failUnlessEqual(dsds[2,1,3,2],0.0,"ds/ds has wrong value at (2,1,3,2).")  
       self.failUnlessEqual(dsds[2,1,3,3],0.0,"ds/ds has wrong value at (2,1,3,3).")  
       self.failUnlessEqual(dsds[2,1,3,4],0.0,"ds/ds has wrong value at (2,1,3,4).")  
       self.failUnlessEqual(dsds[2,2,0,0],0.0,"ds/ds has wrong value at (2,2,0,0).")  
       self.failUnlessEqual(dsds[2,2,0,1],0.0,"ds/ds has wrong value at (2,2,0,1).")  
       self.failUnlessEqual(dsds[2,2,0,2],0.0,"ds/ds has wrong value at (2,2,0,2).")  
       self.failUnlessEqual(dsds[2,2,0,3],0.0,"ds/ds has wrong value at (2,2,0,3).")  
       self.failUnlessEqual(dsds[2,2,0,4],0.0,"ds/ds has wrong value at (2,2,0,4).")  
       self.failUnlessEqual(dsds[2,2,1,0],0.0,"ds/ds has wrong value at (2,2,1,0).")  
       self.failUnlessEqual(dsds[2,2,1,1],0.0,"ds/ds has wrong value at (2,2,1,1).")  
       self.failUnlessEqual(dsds[2,2,1,2],0.0,"ds/ds has wrong value at (2,2,1,2).")  
       self.failUnlessEqual(dsds[2,2,1,3],0.0,"ds/ds has wrong value at (2,2,1,3).")  
       self.failUnlessEqual(dsds[2,2,1,4],0.0,"ds/ds has wrong value at (2,2,1,4).")  
       self.failUnlessEqual(dsds[2,2,2,0],0.0,"ds/ds has wrong value at (2,2,2,0).")  
       self.failUnlessEqual(dsds[2,2,2,1],0.0,"ds/ds has wrong value at (2,2,2,1).")  
       self.failUnlessEqual(dsds[2,2,2,2],1.0,"ds/ds has wrong value at (2,2,2,2).")  
       self.failUnlessEqual(dsds[2,2,2,3],0.0,"ds/ds has wrong value at (2,2,2,3).")  
       self.failUnlessEqual(dsds[2,2,2,4],0.0,"ds/ds has wrong value at (2,2,2,4).")  
       self.failUnlessEqual(dsds[2,2,3,0],0.0,"ds/ds has wrong value at (2,2,3,0).")  
       self.failUnlessEqual(dsds[2,2,3,1],0.0,"ds/ds has wrong value at (2,2,3,1).")  
       self.failUnlessEqual(dsds[2,2,3,2],0.0,"ds/ds has wrong value at (2,2,3,2).")  
       self.failUnlessEqual(dsds[2,2,3,3],0.0,"ds/ds has wrong value at (2,2,3,3).")  
       self.failUnlessEqual(dsds[2,2,3,4],0.0,"ds/ds has wrong value at (2,2,3,4).")  
       self.failUnlessEqual(dsds[2,3,0,0],0.0,"ds/ds has wrong value at (2,3,0,0).")  
       self.failUnlessEqual(dsds[2,3,0,1],0.0,"ds/ds has wrong value at (2,3,0,1).")  
       self.failUnlessEqual(dsds[2,3,0,2],0.0,"ds/ds has wrong value at (2,3,0,2).")  
       self.failUnlessEqual(dsds[2,3,0,3],0.0,"ds/ds has wrong value at (2,3,0,3).")  
       self.failUnlessEqual(dsds[2,3,0,4],0.0,"ds/ds has wrong value at (2,3,0,4).")  
       self.failUnlessEqual(dsds[2,3,1,0],0.0,"ds/ds has wrong value at (2,3,1,0).")  
       self.failUnlessEqual(dsds[2,3,1,1],0.0,"ds/ds has wrong value at (2,3,1,1).")  
       self.failUnlessEqual(dsds[2,3,1,2],0.0,"ds/ds has wrong value at (2,3,1,2).")  
       self.failUnlessEqual(dsds[2,3,1,3],0.0,"ds/ds has wrong value at (2,3,1,3).")  
       self.failUnlessEqual(dsds[2,3,1,4],0.0,"ds/ds has wrong value at (2,3,1,4).")  
       self.failUnlessEqual(dsds[2,3,2,0],0.0,"ds/ds has wrong value at (2,3,2,0).")  
       self.failUnlessEqual(dsds[2,3,2,1],0.0,"ds/ds has wrong value at (2,3,2,1).")  
       self.failUnlessEqual(dsds[2,3,2,2],0.0,"ds/ds has wrong value at (2,3,2,2).")  
       self.failUnlessEqual(dsds[2,3,2,3],1.0,"ds/ds has wrong value at (2,3,2,3).")  
       self.failUnlessEqual(dsds[2,3,2,4],0.0,"ds/ds has wrong value at (2,3,2,4).")  
       self.failUnlessEqual(dsds[2,3,3,0],0.0,"ds/ds has wrong value at (2,3,3,0).")  
       self.failUnlessEqual(dsds[2,3,3,1],0.0,"ds/ds has wrong value at (2,3,3,1).")  
       self.failUnlessEqual(dsds[2,3,3,2],0.0,"ds/ds has wrong value at (2,3,3,2).")  
       self.failUnlessEqual(dsds[2,3,3,3],0.0,"ds/ds has wrong value at (2,3,3,3).")  
       self.failUnlessEqual(dsds[2,3,3,4],0.0,"ds/ds has wrong value at (2,3,3,4).")  
       self.failUnlessEqual(dsds[2,4,0,0],0.0,"ds/ds has wrong value at (2,4,0,0).")  
       self.failUnlessEqual(dsds[2,4,0,1],0.0,"ds/ds has wrong value at (2,4,0,1).")  
       self.failUnlessEqual(dsds[2,4,0,2],0.0,"ds/ds has wrong value at (2,4,0,2).")  
       self.failUnlessEqual(dsds[2,4,0,3],0.0,"ds/ds has wrong value at (2,4,0,3).")  
       self.failUnlessEqual(dsds[2,4,0,4],0.0,"ds/ds has wrong value at (2,4,0,4).")  
       self.failUnlessEqual(dsds[2,4,1,0],0.0,"ds/ds has wrong value at (2,4,1,0).")  
       self.failUnlessEqual(dsds[2,4,1,1],0.0,"ds/ds has wrong value at (2,4,1,1).")  
       self.failUnlessEqual(dsds[2,4,1,2],0.0,"ds/ds has wrong value at (2,4,1,2).")  
       self.failUnlessEqual(dsds[2,4,1,3],0.0,"ds/ds has wrong value at (2,4,1,3).")  
       self.failUnlessEqual(dsds[2,4,1,4],0.0,"ds/ds has wrong value at (2,4,1,4).")  
       self.failUnlessEqual(dsds[2,4,2,0],0.0,"ds/ds has wrong value at (2,4,2,0).")  
       self.failUnlessEqual(dsds[2,4,2,1],0.0,"ds/ds has wrong value at (2,4,2,1).")  
       self.failUnlessEqual(dsds[2,4,2,2],0.0,"ds/ds has wrong value at (2,4,2,2).")  
       self.failUnlessEqual(dsds[2,4,2,3],0.0,"ds/ds has wrong value at (2,4,2,3).")  
       self.failUnlessEqual(dsds[2,4,2,4],1.0,"ds/ds has wrong value at (2,4,2,4).")  
       self.failUnlessEqual(dsds[2,4,3,0],0.0,"ds/ds has wrong value at (2,4,3,0).")  
       self.failUnlessEqual(dsds[2,4,3,1],0.0,"ds/ds has wrong value at (2,4,3,1).")  
       self.failUnlessEqual(dsds[2,4,3,2],0.0,"ds/ds has wrong value at (2,4,3,2).")  
       self.failUnlessEqual(dsds[2,4,3,3],0.0,"ds/ds has wrong value at (2,4,3,3).")  
       self.failUnlessEqual(dsds[2,4,3,4],0.0,"ds/ds has wrong value at (2,4,3,4).")  
       self.failUnlessEqual(dsds[3,0,0,0],0.0,"ds/ds has wrong value at (3,0,0,0).")  
       self.failUnlessEqual(dsds[3,0,0,1],0.0,"ds/ds has wrong value at (3,0,0,1).")  
       self.failUnlessEqual(dsds[3,0,0,2],0.0,"ds/ds has wrong value at (3,0,0,2).")  
       self.failUnlessEqual(dsds[3,0,0,3],0.0,"ds/ds has wrong value at (3,0,0,3).")  
       self.failUnlessEqual(dsds[3,0,0,4],0.0,"ds/ds has wrong value at (3,0,0,4).")  
       self.failUnlessEqual(dsds[3,0,1,0],0.0,"ds/ds has wrong value at (3,0,1,0).")  
       self.failUnlessEqual(dsds[3,0,1,1],0.0,"ds/ds has wrong value at (3,0,1,1).")  
       self.failUnlessEqual(dsds[3,0,1,2],0.0,"ds/ds has wrong value at (3,0,1,2).")  
       self.failUnlessEqual(dsds[3,0,1,3],0.0,"ds/ds has wrong value at (3,0,1,3).")  
       self.failUnlessEqual(dsds[3,0,1,4],0.0,"ds/ds has wrong value at (3,0,1,4).")  
       self.failUnlessEqual(dsds[3,0,2,0],0.0,"ds/ds has wrong value at (3,0,2,0).")  
       self.failUnlessEqual(dsds[3,0,2,1],0.0,"ds/ds has wrong value at (3,0,2,1).")  
       self.failUnlessEqual(dsds[3,0,2,2],0.0,"ds/ds has wrong value at (3,0,2,2).")  
       self.failUnlessEqual(dsds[3,0,2,3],0.0,"ds/ds has wrong value at (3,0,2,3).")  
       self.failUnlessEqual(dsds[3,0,2,4],0.0,"ds/ds has wrong value at (3,0,2,4).")  
       self.failUnlessEqual(dsds[3,0,3,0],1.0,"ds/ds has wrong value at (3,0,3,0).")  
       self.failUnlessEqual(dsds[3,0,3,1],0.0,"ds/ds has wrong value at (3,0,3,1).")  
       self.failUnlessEqual(dsds[3,0,3,2],0.0,"ds/ds has wrong value at (3,0,3,2).")  
       self.failUnlessEqual(dsds[3,0,3,3],0.0,"ds/ds has wrong value at (3,0,3,3).")  
       self.failUnlessEqual(dsds[3,0,3,4],0.0,"ds/ds has wrong value at (3,0,3,4).")  
       self.failUnlessEqual(dsds[3,1,0,0],0.0,"ds/ds has wrong value at (3,1,0,0).")  
       self.failUnlessEqual(dsds[3,1,0,1],0.0,"ds/ds has wrong value at (3,1,0,1).")  
       self.failUnlessEqual(dsds[3,1,0,2],0.0,"ds/ds has wrong value at (3,1,0,2).")  
       self.failUnlessEqual(dsds[3,1,0,3],0.0,"ds/ds has wrong value at (3,1,0,3).")  
       self.failUnlessEqual(dsds[3,1,0,4],0.0,"ds/ds has wrong value at (3,1,0,4).")  
       self.failUnlessEqual(dsds[3,1,1,0],0.0,"ds/ds has wrong value at (3,1,1,0).")  
       self.failUnlessEqual(dsds[3,1,1,1],0.0,"ds/ds has wrong value at (3,1,1,1).")  
       self.failUnlessEqual(dsds[3,1,1,2],0.0,"ds/ds has wrong value at (3,1,1,2).")  
       self.failUnlessEqual(dsds[3,1,1,3],0.0,"ds/ds has wrong value at (3,1,1,3).")  
       self.failUnlessEqual(dsds[3,1,1,4],0.0,"ds/ds has wrong value at (3,1,1,4).")  
       self.failUnlessEqual(dsds[3,1,2,0],0.0,"ds/ds has wrong value at (3,1,2,0).")  
       self.failUnlessEqual(dsds[3,1,2,1],0.0,"ds/ds has wrong value at (3,1,2,1).")  
       self.failUnlessEqual(dsds[3,1,2,2],0.0,"ds/ds has wrong value at (3,1,2,2).")  
       self.failUnlessEqual(dsds[3,1,2,3],0.0,"ds/ds has wrong value at (3,1,2,3).")  
       self.failUnlessEqual(dsds[3,1,2,4],0.0,"ds/ds has wrong value at (3,1,2,4).")  
       self.failUnlessEqual(dsds[3,1,3,0],0.0,"ds/ds has wrong value at (3,1,3,0).")  
       self.failUnlessEqual(dsds[3,1,3,1],1.0,"ds/ds has wrong value at (3,1,3,1).")  
       self.failUnlessEqual(dsds[3,1,3,2],0.0,"ds/ds has wrong value at (3,1,3,2).")  
       self.failUnlessEqual(dsds[3,1,3,3],0.0,"ds/ds has wrong value at (3,1,3,3).")  
       self.failUnlessEqual(dsds[3,1,3,4],0.0,"ds/ds has wrong value at (3,1,3,4).")  
       self.failUnlessEqual(dsds[3,2,0,0],0.0,"ds/ds has wrong value at (3,2,0,0).")  
       self.failUnlessEqual(dsds[3,2,0,1],0.0,"ds/ds has wrong value at (3,2,0,1).")  
       self.failUnlessEqual(dsds[3,2,0,2],0.0,"ds/ds has wrong value at (3,2,0,2).")  
       self.failUnlessEqual(dsds[3,2,0,3],0.0,"ds/ds has wrong value at (3,2,0,3).")  
       self.failUnlessEqual(dsds[3,2,0,4],0.0,"ds/ds has wrong value at (3,2,0,4).")  
       self.failUnlessEqual(dsds[3,2,1,0],0.0,"ds/ds has wrong value at (3,2,1,0).")  
       self.failUnlessEqual(dsds[3,2,1,1],0.0,"ds/ds has wrong value at (3,2,1,1).")  
       self.failUnlessEqual(dsds[3,2,1,2],0.0,"ds/ds has wrong value at (3,2,1,2).")  
       self.failUnlessEqual(dsds[3,2,1,3],0.0,"ds/ds has wrong value at (3,2,1,3).")  
       self.failUnlessEqual(dsds[3,2,1,4],0.0,"ds/ds has wrong value at (3,2,1,4).")  
       self.failUnlessEqual(dsds[3,2,2,0],0.0,"ds/ds has wrong value at (3,2,2,0).")  
       self.failUnlessEqual(dsds[3,2,2,1],0.0,"ds/ds has wrong value at (3,2,2,1).")  
       self.failUnlessEqual(dsds[3,2,2,2],0.0,"ds/ds has wrong value at (3,2,2,2).")  
       self.failUnlessEqual(dsds[3,2,2,3],0.0,"ds/ds has wrong value at (3,2,2,3).")  
       self.failUnlessEqual(dsds[3,2,2,4],0.0,"ds/ds has wrong value at (3,2,2,4).")  
       self.failUnlessEqual(dsds[3,2,3,0],0.0,"ds/ds has wrong value at (3,2,3,0).")  
       self.failUnlessEqual(dsds[3,2,3,1],0.0,"ds/ds has wrong value at (3,2,3,1).")  
       self.failUnlessEqual(dsds[3,2,3,2],1.0,"ds/ds has wrong value at (3,2,3,2).")  
       self.failUnlessEqual(dsds[3,2,3,3],0.0,"ds/ds has wrong value at (3,2,3,3).")  
       self.failUnlessEqual(dsds[3,2,3,4],0.0,"ds/ds has wrong value at (3,2,3,4).")  
       self.failUnlessEqual(dsds[3,3,0,0],0.0,"ds/ds has wrong value at (3,3,0,0).")  
       self.failUnlessEqual(dsds[3,3,0,1],0.0,"ds/ds has wrong value at (3,3,0,1).")  
       self.failUnlessEqual(dsds[3,3,0,2],0.0,"ds/ds has wrong value at (3,3,0,2).")  
       self.failUnlessEqual(dsds[3,3,0,3],0.0,"ds/ds has wrong value at (3,3,0,3).")  
       self.failUnlessEqual(dsds[3,3,0,4],0.0,"ds/ds has wrong value at (3,3,0,4).")  
       self.failUnlessEqual(dsds[3,3,1,0],0.0,"ds/ds has wrong value at (3,3,1,0).")  
       self.failUnlessEqual(dsds[3,3,1,1],0.0,"ds/ds has wrong value at (3,3,1,1).")  
       self.failUnlessEqual(dsds[3,3,1,2],0.0,"ds/ds has wrong value at (3,3,1,2).")  
       self.failUnlessEqual(dsds[3,3,1,3],0.0,"ds/ds has wrong value at (3,3,1,3).")  
       self.failUnlessEqual(dsds[3,3,1,4],0.0,"ds/ds has wrong value at (3,3,1,4).")  
       self.failUnlessEqual(dsds[3,3,2,0],0.0,"ds/ds has wrong value at (3,3,2,0).")  
       self.failUnlessEqual(dsds[3,3,2,1],0.0,"ds/ds has wrong value at (3,3,2,1).")  
       self.failUnlessEqual(dsds[3,3,2,2],0.0,"ds/ds has wrong value at (3,3,2,2).")  
       self.failUnlessEqual(dsds[3,3,2,3],0.0,"ds/ds has wrong value at (3,3,2,3).")  
       self.failUnlessEqual(dsds[3,3,2,4],0.0,"ds/ds has wrong value at (3,3,2,4).")  
       self.failUnlessEqual(dsds[3,3,3,0],0.0,"ds/ds has wrong value at (3,3,3,0).")  
       self.failUnlessEqual(dsds[3,3,3,1],0.0,"ds/ds has wrong value at (3,3,3,1).")  
       self.failUnlessEqual(dsds[3,3,3,2],0.0,"ds/ds has wrong value at (3,3,3,2).")  
       self.failUnlessEqual(dsds[3,3,3,3],1.0,"ds/ds has wrong value at (3,3,3,3).")  
       self.failUnlessEqual(dsds[3,3,3,4],0.0,"ds/ds has wrong value at (3,3,3,4).")  
       self.failUnlessEqual(dsds[3,4,0,0],0.0,"ds/ds has wrong value at (3,4,0,0).")  
       self.failUnlessEqual(dsds[3,4,0,1],0.0,"ds/ds has wrong value at (3,4,0,1).")  
       self.failUnlessEqual(dsds[3,4,0,2],0.0,"ds/ds has wrong value at (3,4,0,2).")  
       self.failUnlessEqual(dsds[3,4,0,3],0.0,"ds/ds has wrong value at (3,4,0,3).")  
       self.failUnlessEqual(dsds[3,4,0,4],0.0,"ds/ds has wrong value at (3,4,0,4).")  
       self.failUnlessEqual(dsds[3,4,1,0],0.0,"ds/ds has wrong value at (3,4,1,0).")  
       self.failUnlessEqual(dsds[3,4,1,1],0.0,"ds/ds has wrong value at (3,4,1,1).")  
       self.failUnlessEqual(dsds[3,4,1,2],0.0,"ds/ds has wrong value at (3,4,1,2).")  
       self.failUnlessEqual(dsds[3,4,1,3],0.0,"ds/ds has wrong value at (3,4,1,3).")  
       self.failUnlessEqual(dsds[3,4,1,4],0.0,"ds/ds has wrong value at (3,4,1,4).")  
       self.failUnlessEqual(dsds[3,4,2,0],0.0,"ds/ds has wrong value at (3,4,2,0).")  
       self.failUnlessEqual(dsds[3,4,2,1],0.0,"ds/ds has wrong value at (3,4,2,1).")  
       self.failUnlessEqual(dsds[3,4,2,2],0.0,"ds/ds has wrong value at (3,4,2,2).")  
       self.failUnlessEqual(dsds[3,4,2,3],0.0,"ds/ds has wrong value at (3,4,2,3).")  
       self.failUnlessEqual(dsds[3,4,2,4],0.0,"ds/ds has wrong value at (3,4,2,4).")  
       self.failUnlessEqual(dsds[3,4,3,0],0.0,"ds/ds has wrong value at (3,4,3,0).")  
       self.failUnlessEqual(dsds[3,4,3,1],0.0,"ds/ds has wrong value at (3,4,3,1).")  
       self.failUnlessEqual(dsds[3,4,3,2],0.0,"ds/ds has wrong value at (3,4,3,2).")  
       self.failUnlessEqual(dsds[3,4,3,3],0.0,"ds/ds has wrong value at (3,4,3,3).")  
       self.failUnlessEqual(dsds[3,4,3,4],1.0,"ds/ds has wrong value at (3,4,3,4).")  
   
       self.failUnlessEqual(s.getArgument(0),s2,"wrong argument 0.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),1,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],-10,"wrongly substituted argument 0.")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(4, 5),dim=None)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((4, 5))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank2_dNone_nargs2(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(4, 5),dim=None,args=[1, -1.0])  
       self.failUnlessEqual(s.getRank(),2,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(4, 5),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),None,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[1, -1.0],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((4, 5))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(4, 5),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(4, 5, 4, 5),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0,0,0],1.0,"ds/ds has wrong value at (0,0,0,0).")  
       self.failUnlessEqual(dsds[0,0,0,1],0.0,"ds/ds has wrong value at (0,0,0,1).")  
       self.failUnlessEqual(dsds[0,0,0,2],0.0,"ds/ds has wrong value at (0,0,0,2).")  
       self.failUnlessEqual(dsds[0,0,0,3],0.0,"ds/ds has wrong value at (0,0,0,3).")  
       self.failUnlessEqual(dsds[0,0,0,4],0.0,"ds/ds has wrong value at (0,0,0,4).")  
       self.failUnlessEqual(dsds[0,0,1,0],0.0,"ds/ds has wrong value at (0,0,1,0).")  
       self.failUnlessEqual(dsds[0,0,1,1],0.0,"ds/ds has wrong value at (0,0,1,1).")  
       self.failUnlessEqual(dsds[0,0,1,2],0.0,"ds/ds has wrong value at (0,0,1,2).")  
       self.failUnlessEqual(dsds[0,0,1,3],0.0,"ds/ds has wrong value at (0,0,1,3).")  
       self.failUnlessEqual(dsds[0,0,1,4],0.0,"ds/ds has wrong value at (0,0,1,4).")  
       self.failUnlessEqual(dsds[0,0,2,0],0.0,"ds/ds has wrong value at (0,0,2,0).")  
       self.failUnlessEqual(dsds[0,0,2,1],0.0,"ds/ds has wrong value at (0,0,2,1).")  
       self.failUnlessEqual(dsds[0,0,2,2],0.0,"ds/ds has wrong value at (0,0,2,2).")  
       self.failUnlessEqual(dsds[0,0,2,3],0.0,"ds/ds has wrong value at (0,0,2,3).")  
       self.failUnlessEqual(dsds[0,0,2,4],0.0,"ds/ds has wrong value at (0,0,2,4).")  
       self.failUnlessEqual(dsds[0,0,3,0],0.0,"ds/ds has wrong value at (0,0,3,0).")  
       self.failUnlessEqual(dsds[0,0,3,1],0.0,"ds/ds has wrong value at (0,0,3,1).")  
       self.failUnlessEqual(dsds[0,0,3,2],0.0,"ds/ds has wrong value at (0,0,3,2).")  
       self.failUnlessEqual(dsds[0,0,3,3],0.0,"ds/ds has wrong value at (0,0,3,3).")  
       self.failUnlessEqual(dsds[0,0,3,4],0.0,"ds/ds has wrong value at (0,0,3,4).")  
       self.failUnlessEqual(dsds[0,1,0,0],0.0,"ds/ds has wrong value at (0,1,0,0).")  
       self.failUnlessEqual(dsds[0,1,0,1],1.0,"ds/ds has wrong value at (0,1,0,1).")  
       self.failUnlessEqual(dsds[0,1,0,2],0.0,"ds/ds has wrong value at (0,1,0,2).")  
       self.failUnlessEqual(dsds[0,1,0,3],0.0,"ds/ds has wrong value at (0,1,0,3).")  
       self.failUnlessEqual(dsds[0,1,0,4],0.0,"ds/ds has wrong value at (0,1,0,4).")  
       self.failUnlessEqual(dsds[0,1,1,0],0.0,"ds/ds has wrong value at (0,1,1,0).")  
       self.failUnlessEqual(dsds[0,1,1,1],0.0,"ds/ds has wrong value at (0,1,1,1).")  
       self.failUnlessEqual(dsds[0,1,1,2],0.0,"ds/ds has wrong value at (0,1,1,2).")  
       self.failUnlessEqual(dsds[0,1,1,3],0.0,"ds/ds has wrong value at (0,1,1,3).")  
       self.failUnlessEqual(dsds[0,1,1,4],0.0,"ds/ds has wrong value at (0,1,1,4).")  
       self.failUnlessEqual(dsds[0,1,2,0],0.0,"ds/ds has wrong value at (0,1,2,0).")  
       self.failUnlessEqual(dsds[0,1,2,1],0.0,"ds/ds has wrong value at (0,1,2,1).")  
       self.failUnlessEqual(dsds[0,1,2,2],0.0,"ds/ds has wrong value at (0,1,2,2).")  
       self.failUnlessEqual(dsds[0,1,2,3],0.0,"ds/ds has wrong value at (0,1,2,3).")  
       self.failUnlessEqual(dsds[0,1,2,4],0.0,"ds/ds has wrong value at (0,1,2,4).")  
       self.failUnlessEqual(dsds[0,1,3,0],0.0,"ds/ds has wrong value at (0,1,3,0).")  
       self.failUnlessEqual(dsds[0,1,3,1],0.0,"ds/ds has wrong value at (0,1,3,1).")  
       self.failUnlessEqual(dsds[0,1,3,2],0.0,"ds/ds has wrong value at (0,1,3,2).")  
       self.failUnlessEqual(dsds[0,1,3,3],0.0,"ds/ds has wrong value at (0,1,3,3).")  
       self.failUnlessEqual(dsds[0,1,3,4],0.0,"ds/ds has wrong value at (0,1,3,4).")  
       self.failUnlessEqual(dsds[0,2,0,0],0.0,"ds/ds has wrong value at (0,2,0,0).")  
       self.failUnlessEqual(dsds[0,2,0,1],0.0,"ds/ds has wrong value at (0,2,0,1).")  
       self.failUnlessEqual(dsds[0,2,0,2],1.0,"ds/ds has wrong value at (0,2,0,2).")  
       self.failUnlessEqual(dsds[0,2,0,3],0.0,"ds/ds has wrong value at (0,2,0,3).")  
       self.failUnlessEqual(dsds[0,2,0,4],0.0,"ds/ds has wrong value at (0,2,0,4).")  
       self.failUnlessEqual(dsds[0,2,1,0],0.0,"ds/ds has wrong value at (0,2,1,0).")  
       self.failUnlessEqual(dsds[0,2,1,1],0.0,"ds/ds has wrong value at (0,2,1,1).")  
       self.failUnlessEqual(dsds[0,2,1,2],0.0,"ds/ds has wrong value at (0,2,1,2).")  
       self.failUnlessEqual(dsds[0,2,1,3],0.0,"ds/ds has wrong value at (0,2,1,3).")  
       self.failUnlessEqual(dsds[0,2,1,4],0.0,"ds/ds has wrong value at (0,2,1,4).")  
       self.failUnlessEqual(dsds[0,2,2,0],0.0,"ds/ds has wrong value at (0,2,2,0).")  
       self.failUnlessEqual(dsds[0,2,2,1],0.0,"ds/ds has wrong value at (0,2,2,1).")  
       self.failUnlessEqual(dsds[0,2,2,2],0.0,"ds/ds has wrong value at (0,2,2,2).")  
       self.failUnlessEqual(dsds[0,2,2,3],0.0,"ds/ds has wrong value at (0,2,2,3).")  
       self.failUnlessEqual(dsds[0,2,2,4],0.0,"ds/ds has wrong value at (0,2,2,4).")  
       self.failUnlessEqual(dsds[0,2,3,0],0.0,"ds/ds has wrong value at (0,2,3,0).")  
       self.failUnlessEqual(dsds[0,2,3,1],0.0,"ds/ds has wrong value at (0,2,3,1).")  
       self.failUnlessEqual(dsds[0,2,3,2],0.0,"ds/ds has wrong value at (0,2,3,2).")  
       self.failUnlessEqual(dsds[0,2,3,3],0.0,"ds/ds has wrong value at (0,2,3,3).")  
       self.failUnlessEqual(dsds[0,2,3,4],0.0,"ds/ds has wrong value at (0,2,3,4).")  
       self.failUnlessEqual(dsds[0,3,0,0],0.0,"ds/ds has wrong value at (0,3,0,0).")  
       self.failUnlessEqual(dsds[0,3,0,1],0.0,"ds/ds has wrong value at (0,3,0,1).")  
       self.failUnlessEqual(dsds[0,3,0,2],0.0,"ds/ds has wrong value at (0,3,0,2).")  
       self.failUnlessEqual(dsds[0,3,0,3],1.0,"ds/ds has wrong value at (0,3,0,3).")  
       self.failUnlessEqual(dsds[0,3,0,4],0.0,"ds/ds has wrong value at (0,3,0,4).")  
       self.failUnlessEqual(dsds[0,3,1,0],0.0,"ds/ds has wrong value at (0,3,1,0).")  
       self.failUnlessEqual(dsds[0,3,1,1],0.0,"ds/ds has wrong value at (0,3,1,1).")  
       self.failUnlessEqual(dsds[0,3,1,2],0.0,"ds/ds has wrong value at (0,3,1,2).")  
       self.failUnlessEqual(dsds[0,3,1,3],0.0,"ds/ds has wrong value at (0,3,1,3).")  
       self.failUnlessEqual(dsds[0,3,1,4],0.0,"ds/ds has wrong value at (0,3,1,4).")  
       self.failUnlessEqual(dsds[0,3,2,0],0.0,"ds/ds has wrong value at (0,3,2,0).")  
       self.failUnlessEqual(dsds[0,3,2,1],0.0,"ds/ds has wrong value at (0,3,2,1).")  
       self.failUnlessEqual(dsds[0,3,2,2],0.0,"ds/ds has wrong value at (0,3,2,2).")  
       self.failUnlessEqual(dsds[0,3,2,3],0.0,"ds/ds has wrong value at (0,3,2,3).")  
       self.failUnlessEqual(dsds[0,3,2,4],0.0,"ds/ds has wrong value at (0,3,2,4).")  
       self.failUnlessEqual(dsds[0,3,3,0],0.0,"ds/ds has wrong value at (0,3,3,0).")  
       self.failUnlessEqual(dsds[0,3,3,1],0.0,"ds/ds has wrong value at (0,3,3,1).")  
       self.failUnlessEqual(dsds[0,3,3,2],0.0,"ds/ds has wrong value at (0,3,3,2).")  
       self.failUnlessEqual(dsds[0,3,3,3],0.0,"ds/ds has wrong value at (0,3,3,3).")  
       self.failUnlessEqual(dsds[0,3,3,4],0.0,"ds/ds has wrong value at (0,3,3,4).")  
       self.failUnlessEqual(dsds[0,4,0,0],0.0,"ds/ds has wrong value at (0,4,0,0).")  
       self.failUnlessEqual(dsds[0,4,0,1],0.0,"ds/ds has wrong value at (0,4,0,1).")  
       self.failUnlessEqual(dsds[0,4,0,2],0.0,"ds/ds has wrong value at (0,4,0,2).")  
       self.failUnlessEqual(dsds[0,4,0,3],0.0,"ds/ds has wrong value at (0,4,0,3).")  
       self.failUnlessEqual(dsds[0,4,0,4],1.0,"ds/ds has wrong value at (0,4,0,4).")  
       self.failUnlessEqual(dsds[0,4,1,0],0.0,"ds/ds has wrong value at (0,4,1,0).")  
       self.failUnlessEqual(dsds[0,4,1,1],0.0,"ds/ds has wrong value at (0,4,1,1).")  
       self.failUnlessEqual(dsds[0,4,1,2],0.0,"ds/ds has wrong value at (0,4,1,2).")  
       self.failUnlessEqual(dsds[0,4,1,3],0.0,"ds/ds has wrong value at (0,4,1,3).")  
       self.failUnlessEqual(dsds[0,4,1,4],0.0,"ds/ds has wrong value at (0,4,1,4).")  
       self.failUnlessEqual(dsds[0,4,2,0],0.0,"ds/ds has wrong value at (0,4,2,0).")  
       self.failUnlessEqual(dsds[0,4,2,1],0.0,"ds/ds has wrong value at (0,4,2,1).")  
       self.failUnlessEqual(dsds[0,4,2,2],0.0,"ds/ds has wrong value at (0,4,2,2).")  
       self.failUnlessEqual(dsds[0,4,2,3],0.0,"ds/ds has wrong value at (0,4,2,3).")  
       self.failUnlessEqual(dsds[0,4,2,4],0.0,"ds/ds has wrong value at (0,4,2,4).")  
       self.failUnlessEqual(dsds[0,4,3,0],0.0,"ds/ds has wrong value at (0,4,3,0).")  
       self.failUnlessEqual(dsds[0,4,3,1],0.0,"ds/ds has wrong value at (0,4,3,1).")  
       self.failUnlessEqual(dsds[0,4,3,2],0.0,"ds/ds has wrong value at (0,4,3,2).")  
       self.failUnlessEqual(dsds[0,4,3,3],0.0,"ds/ds has wrong value at (0,4,3,3).")  
       self.failUnlessEqual(dsds[0,4,3,4],0.0,"ds/ds has wrong value at (0,4,3,4).")  
       self.failUnlessEqual(dsds[1,0,0,0],0.0,"ds/ds has wrong value at (1,0,0,0).")  
       self.failUnlessEqual(dsds[1,0,0,1],0.0,"ds/ds has wrong value at (1,0,0,1).")  
       self.failUnlessEqual(dsds[1,0,0,2],0.0,"ds/ds has wrong value at (1,0,0,2).")  
       self.failUnlessEqual(dsds[1,0,0,3],0.0,"ds/ds has wrong value at (1,0,0,3).")  
       self.failUnlessEqual(dsds[1,0,0,4],0.0,"ds/ds has wrong value at (1,0,0,4).")  
       self.failUnlessEqual(dsds[1,0,1,0],1.0,"ds/ds has wrong value at (1,0,1,0).")  
       self.failUnlessEqual(dsds[1,0,1,1],0.0,"ds/ds has wrong value at (1,0,1,1).")  
       self.failUnlessEqual(dsds[1,0,1,2],0.0,"ds/ds has wrong value at (1,0,1,2).")  
       self.failUnlessEqual(dsds[1,0,1,3],0.0,"ds/ds has wrong value at (1,0,1,3).")  
       self.failUnlessEqual(dsds[1,0,1,4],0.0,"ds/ds has wrong value at (1,0,1,4).")  
       self.failUnlessEqual(dsds[1,0,2,0],0.0,"ds/ds has wrong value at (1,0,2,0).")  
       self.failUnlessEqual(dsds[1,0,2,1],0.0,"ds/ds has wrong value at (1,0,2,1).")  
       self.failUnlessEqual(dsds[1,0,2,2],0.0,"ds/ds has wrong value at (1,0,2,2).")  
       self.failUnlessEqual(dsds[1,0,2,3],0.0,"ds/ds has wrong value at (1,0,2,3).")  
       self.failUnlessEqual(dsds[1,0,2,4],0.0,"ds/ds has wrong value at (1,0,2,4).")  
       self.failUnlessEqual(dsds[1,0,3,0],0.0,"ds/ds has wrong value at (1,0,3,0).")  
       self.failUnlessEqual(dsds[1,0,3,1],0.0,"ds/ds has wrong value at (1,0,3,1).")  
       self.failUnlessEqual(dsds[1,0,3,2],0.0,"ds/ds has wrong value at (1,0,3,2).")  
       self.failUnlessEqual(dsds[1,0,3,3],0.0,"ds/ds has wrong value at (1,0,3,3).")  
       self.failUnlessEqual(dsds[1,0,3,4],0.0,"ds/ds has wrong value at (1,0,3,4).")  
       self.failUnlessEqual(dsds[1,1,0,0],0.0,"ds/ds has wrong value at (1,1,0,0).")  
       self.failUnlessEqual(dsds[1,1,0,1],0.0,"ds/ds has wrong value at (1,1,0,1).")  
       self.failUnlessEqual(dsds[1,1,0,2],0.0,"ds/ds has wrong value at (1,1,0,2).")  
       self.failUnlessEqual(dsds[1,1,0,3],0.0,"ds/ds has wrong value at (1,1,0,3).")  
       self.failUnlessEqual(dsds[1,1,0,4],0.0,"ds/ds has wrong value at (1,1,0,4).")  
       self.failUnlessEqual(dsds[1,1,1,0],0.0,"ds/ds has wrong value at (1,1,1,0).")  
       self.failUnlessEqual(dsds[1,1,1,1],1.0,"ds/ds has wrong value at (1,1,1,1).")  
       self.failUnlessEqual(dsds[1,1,1,2],0.0,"ds/ds has wrong value at (1,1,1,2).")  
       self.failUnlessEqual(dsds[1,1,1,3],0.0,"ds/ds has wrong value at (1,1,1,3).")  
       self.failUnlessEqual(dsds[1,1,1,4],0.0,"ds/ds has wrong value at (1,1,1,4).")  
       self.failUnlessEqual(dsds[1,1,2,0],0.0,"ds/ds has wrong value at (1,1,2,0).")  
       self.failUnlessEqual(dsds[1,1,2,1],0.0,"ds/ds has wrong value at (1,1,2,1).")  
       self.failUnlessEqual(dsds[1,1,2,2],0.0,"ds/ds has wrong value at (1,1,2,2).")  
       self.failUnlessEqual(dsds[1,1,2,3],0.0,"ds/ds has wrong value at (1,1,2,3).")  
       self.failUnlessEqual(dsds[1,1,2,4],0.0,"ds/ds has wrong value at (1,1,2,4).")  
       self.failUnlessEqual(dsds[1,1,3,0],0.0,"ds/ds has wrong value at (1,1,3,0).")  
       self.failUnlessEqual(dsds[1,1,3,1],0.0,"ds/ds has wrong value at (1,1,3,1).")  
       self.failUnlessEqual(dsds[1,1,3,2],0.0,"ds/ds has wrong value at (1,1,3,2).")  
       self.failUnlessEqual(dsds[1,1,3,3],0.0,"ds/ds has wrong value at (1,1,3,3).")  
       self.failUnlessEqual(dsds[1,1,3,4],0.0,"ds/ds has wrong value at (1,1,3,4).")  
       self.failUnlessEqual(dsds[1,2,0,0],0.0,"ds/ds has wrong value at (1,2,0,0).")  
       self.failUnlessEqual(dsds[1,2,0,1],0.0,"ds/ds has wrong value at (1,2,0,1).")  
       self.failUnlessEqual(dsds[1,2,0,2],0.0,"ds/ds has wrong value at (1,2,0,2).")  
       self.failUnlessEqual(dsds[1,2,0,3],0.0,"ds/ds has wrong value at (1,2,0,3).")  
       self.failUnlessEqual(dsds[1,2,0,4],0.0,"ds/ds has wrong value at (1,2,0,4).")  
       self.failUnlessEqual(dsds[1,2,1,0],0.0,"ds/ds has wrong value at (1,2,1,0).")  
       self.failUnlessEqual(dsds[1,2,1,1],0.0,"ds/ds has wrong value at (1,2,1,1).")  
       self.failUnlessEqual(dsds[1,2,1,2],1.0,"ds/ds has wrong value at (1,2,1,2).")  
       self.failUnlessEqual(dsds[1,2,1,3],0.0,"ds/ds has wrong value at (1,2,1,3).")  
       self.failUnlessEqual(dsds[1,2,1,4],0.0,"ds/ds has wrong value at (1,2,1,4).")  
       self.failUnlessEqual(dsds[1,2,2,0],0.0,"ds/ds has wrong value at (1,2,2,0).")  
       self.failUnlessEqual(dsds[1,2,2,1],0.0,"ds/ds has wrong value at (1,2,2,1).")  
       self.failUnlessEqual(dsds[1,2,2,2],0.0,"ds/ds has wrong value at (1,2,2,2).")  
       self.failUnlessEqual(dsds[1,2,2,3],0.0,"ds/ds has wrong value at (1,2,2,3).")  
       self.failUnlessEqual(dsds[1,2,2,4],0.0,"ds/ds has wrong value at (1,2,2,4).")  
       self.failUnlessEqual(dsds[1,2,3,0],0.0,"ds/ds has wrong value at (1,2,3,0).")  
       self.failUnlessEqual(dsds[1,2,3,1],0.0,"ds/ds has wrong value at (1,2,3,1).")  
       self.failUnlessEqual(dsds[1,2,3,2],0.0,"ds/ds has wrong value at (1,2,3,2).")  
       self.failUnlessEqual(dsds[1,2,3,3],0.0,"ds/ds has wrong value at (1,2,3,3).")  
       self.failUnlessEqual(dsds[1,2,3,4],0.0,"ds/ds has wrong value at (1,2,3,4).")  
       self.failUnlessEqual(dsds[1,3,0,0],0.0,"ds/ds has wrong value at (1,3,0,0).")  
       self.failUnlessEqual(dsds[1,3,0,1],0.0,"ds/ds has wrong value at (1,3,0,1).")  
       self.failUnlessEqual(dsds[1,3,0,2],0.0,"ds/ds has wrong value at (1,3,0,2).")  
       self.failUnlessEqual(dsds[1,3,0,3],0.0,"ds/ds has wrong value at (1,3,0,3).")  
       self.failUnlessEqual(dsds[1,3,0,4],0.0,"ds/ds has wrong value at (1,3,0,4).")  
       self.failUnlessEqual(dsds[1,3,1,0],0.0,"ds/ds has wrong value at (1,3,1,0).")  
       self.failUnlessEqual(dsds[1,3,1,1],0.0,"ds/ds has wrong value at (1,3,1,1).")  
       self.failUnlessEqual(dsds[1,3,1,2],0.0,"ds/ds has wrong value at (1,3,1,2).")  
       self.failUnlessEqual(dsds[1,3,1,3],1.0,"ds/ds has wrong value at (1,3,1,3).")  
       self.failUnlessEqual(dsds[1,3,1,4],0.0,"ds/ds has wrong value at (1,3,1,4).")  
       self.failUnlessEqual(dsds[1,3,2,0],0.0,"ds/ds has wrong value at (1,3,2,0).")  
       self.failUnlessEqual(dsds[1,3,2,1],0.0,"ds/ds has wrong value at (1,3,2,1).")  
       self.failUnlessEqual(dsds[1,3,2,2],0.0,"ds/ds has wrong value at (1,3,2,2).")  
       self.failUnlessEqual(dsds[1,3,2,3],0.0,"ds/ds has wrong value at (1,3,2,3).")  
       self.failUnlessEqual(dsds[1,3,2,4],0.0,"ds/ds has wrong value at (1,3,2,4).")  
       self.failUnlessEqual(dsds[1,3,3,0],0.0,"ds/ds has wrong value at (1,3,3,0).")  
       self.failUnlessEqual(dsds[1,3,3,1],0.0,"ds/ds has wrong value at (1,3,3,1).")  
       self.failUnlessEqual(dsds[1,3,3,2],0.0,"ds/ds has wrong value at (1,3,3,2).")  
       self.failUnlessEqual(dsds[1,3,3,3],0.0,"ds/ds has wrong value at (1,3,3,3).")  
       self.failUnlessEqual(dsds[1,3,3,4],0.0,"ds/ds has wrong value at (1,3,3,4).")  
       self.failUnlessEqual(dsds[1,4,0,0],0.0,"ds/ds has wrong value at (1,4,0,0).")  
       self.failUnlessEqual(dsds[1,4,0,1],0.0,"ds/ds has wrong value at (1,4,0,1).")  
       self.failUnlessEqual(dsds[1,4,0,2],0.0,"ds/ds has wrong value at (1,4,0,2).")  
       self.failUnlessEqual(dsds[1,4,0,3],0.0,"ds/ds has wrong value at (1,4,0,3).")  
       self.failUnlessEqual(dsds[1,4,0,4],0.0,"ds/ds has wrong value at (1,4,0,4).")  
       self.failUnlessEqual(dsds[1,4,1,0],0.0,"ds/ds has wrong value at (1,4,1,0).")  
       self.failUnlessEqual(dsds[1,4,1,1],0.0,"ds/ds has wrong value at (1,4,1,1).")  
       self.failUnlessEqual(dsds[1,4,1,2],0.0,"ds/ds has wrong value at (1,4,1,2).")  
       self.failUnlessEqual(dsds[1,4,1,3],0.0,"ds/ds has wrong value at (1,4,1,3).")  
       self.failUnlessEqual(dsds[1,4,1,4],1.0,"ds/ds has wrong value at (1,4,1,4).")  
       self.failUnlessEqual(dsds[1,4,2,0],0.0,"ds/ds has wrong value at (1,4,2,0).")  
       self.failUnlessEqual(dsds[1,4,2,1],0.0,"ds/ds has wrong value at (1,4,2,1).")  
       self.failUnlessEqual(dsds[1,4,2,2],0.0,"ds/ds has wrong value at (1,4,2,2).")  
       self.failUnlessEqual(dsds[1,4,2,3],0.0,"ds/ds has wrong value at (1,4,2,3).")  
       self.failUnlessEqual(dsds[1,4,2,4],0.0,"ds/ds has wrong value at (1,4,2,4).")  
       self.failUnlessEqual(dsds[1,4,3,0],0.0,"ds/ds has wrong value at (1,4,3,0).")  
       self.failUnlessEqual(dsds[1,4,3,1],0.0,"ds/ds has wrong value at (1,4,3,1).")  
       self.failUnlessEqual(dsds[1,4,3,2],0.0,"ds/ds has wrong value at (1,4,3,2).")  
       self.failUnlessEqual(dsds[1,4,3,3],0.0,"ds/ds has wrong value at (1,4,3,3).")  
       self.failUnlessEqual(dsds[1,4,3,4],0.0,"ds/ds has wrong value at (1,4,3,4).")  
       self.failUnlessEqual(dsds[2,0,0,0],0.0,"ds/ds has wrong value at (2,0,0,0).")  
       self.failUnlessEqual(dsds[2,0,0,1],0.0,"ds/ds has wrong value at (2,0,0,1).")  
       self.failUnlessEqual(dsds[2,0,0,2],0.0,"ds/ds has wrong value at (2,0,0,2).")  
       self.failUnlessEqual(dsds[2,0,0,3],0.0,"ds/ds has wrong value at (2,0,0,3).")  
       self.failUnlessEqual(dsds[2,0,0,4],0.0,"ds/ds has wrong value at (2,0,0,4).")  
       self.failUnlessEqual(dsds[2,0,1,0],0.0,"ds/ds has wrong value at (2,0,1,0).")  
       self.failUnlessEqual(dsds[2,0,1,1],0.0,"ds/ds has wrong value at (2,0,1,1).")  
       self.failUnlessEqual(dsds[2,0,1,2],0.0,"ds/ds has wrong value at (2,0,1,2).")  
       self.failUnlessEqual(dsds[2,0,1,3],0.0,"ds/ds has wrong value at (2,0,1,3).")  
       self.failUnlessEqual(dsds[2,0,1,4],0.0,"ds/ds has wrong value at (2,0,1,4).")  
       self.failUnlessEqual(dsds[2,0,2,0],1.0,"ds/ds has wrong value at (2,0,2,0).")  
       self.failUnlessEqual(dsds[2,0,2,1],0.0,"ds/ds has wrong value at (2,0,2,1).")  
       self.failUnlessEqual(dsds[2,0,2,2],0.0,"ds/ds has wrong value at (2,0,2,2).")  
       self.failUnlessEqual(dsds[2,0,2,3],0.0,"ds/ds has wrong value at (2,0,2,3).")  
       self.failUnlessEqual(dsds[2,0,2,4],0.0,"ds/ds has wrong value at (2,0,2,4).")  
       self.failUnlessEqual(dsds[2,0,3,0],0.0,"ds/ds has wrong value at (2,0,3,0).")  
       self.failUnlessEqual(dsds[2,0,3,1],0.0,"ds/ds has wrong value at (2,0,3,1).")  
       self.failUnlessEqual(dsds[2,0,3,2],0.0,"ds/ds has wrong value at (2,0,3,2).")  
       self.failUnlessEqual(dsds[2,0,3,3],0.0,"ds/ds has wrong value at (2,0,3,3).")  
       self.failUnlessEqual(dsds[2,0,3,4],0.0,"ds/ds has wrong value at (2,0,3,4).")  
       self.failUnlessEqual(dsds[2,1,0,0],0.0,"ds/ds has wrong value at (2,1,0,0).")  
       self.failUnlessEqual(dsds[2,1,0,1],0.0,"ds/ds has wrong value at (2,1,0,1).")  
       self.failUnlessEqual(dsds[2,1,0,2],0.0,"ds/ds has wrong value at (2,1,0,2).")  
       self.failUnlessEqual(dsds[2,1,0,3],0.0,"ds/ds has wrong value at (2,1,0,3).")  
       self.failUnlessEqual(dsds[2,1,0,4],0.0,"ds/ds has wrong value at (2,1,0,4).")  
       self.failUnlessEqual(dsds[2,1,1,0],0.0,"ds/ds has wrong value at (2,1,1,0).")  
       self.failUnlessEqual(dsds[2,1,1,1],0.0,"ds/ds has wrong value at (2,1,1,1).")  
       self.failUnlessEqual(dsds[2,1,1,2],0.0,"ds/ds has wrong value at (2,1,1,2).")  
       self.failUnlessEqual(dsds[2,1,1,3],0.0,"ds/ds has wrong value at (2,1,1,3).")  
       self.failUnlessEqual(dsds[2,1,1,4],0.0,"ds/ds has wrong value at (2,1,1,4).")  
       self.failUnlessEqual(dsds[2,1,2,0],0.0,"ds/ds has wrong value at (2,1,2,0).")  
       self.failUnlessEqual(dsds[2,1,2,1],1.0,"ds/ds has wrong value at (2,1,2,1).")  
       self.failUnlessEqual(dsds[2,1,2,2],0.0,"ds/ds has wrong value at (2,1,2,2).")  
       self.failUnlessEqual(dsds[2,1,2,3],0.0,"ds/ds has wrong value at (2,1,2,3).")  
       self.failUnlessEqual(dsds[2,1,2,4],0.0,"ds/ds has wrong value at (2,1,2,4).")  
       self.failUnlessEqual(dsds[2,1,3,0],0.0,"ds/ds has wrong value at (2,1,3,0).")  
       self.failUnlessEqual(dsds[2,1,3,1],0.0,"ds/ds has wrong value at (2,1,3,1).")  
       self.failUnlessEqual(dsds[2,1,3,2],0.0,"ds/ds has wrong value at (2,1,3,2).")  
       self.failUnlessEqual(dsds[2,1,3,3],0.0,"ds/ds has wrong value at (2,1,3,3).")  
       self.failUnlessEqual(dsds[2,1,3,4],0.0,"ds/ds has wrong value at (2,1,3,4).")  
       self.failUnlessEqual(dsds[2,2,0,0],0.0,"ds/ds has wrong value at (2,2,0,0).")  
       self.failUnlessEqual(dsds[2,2,0,1],0.0,"ds/ds has wrong value at (2,2,0,1).")  
       self.failUnlessEqual(dsds[2,2,0,2],0.0,"ds/ds has wrong value at (2,2,0,2).")  
       self.failUnlessEqual(dsds[2,2,0,3],0.0,"ds/ds has wrong value at (2,2,0,3).")  
       self.failUnlessEqual(dsds[2,2,0,4],0.0,"ds/ds has wrong value at (2,2,0,4).")  
       self.failUnlessEqual(dsds[2,2,1,0],0.0,"ds/ds has wrong value at (2,2,1,0).")  
       self.failUnlessEqual(dsds[2,2,1,1],0.0,"ds/ds has wrong value at (2,2,1,1).")  
       self.failUnlessEqual(dsds[2,2,1,2],0.0,"ds/ds has wrong value at (2,2,1,2).")  
       self.failUnlessEqual(dsds[2,2,1,3],0.0,"ds/ds has wrong value at (2,2,1,3).")  
       self.failUnlessEqual(dsds[2,2,1,4],0.0,"ds/ds has wrong value at (2,2,1,4).")  
       self.failUnlessEqual(dsds[2,2,2,0],0.0,"ds/ds has wrong value at (2,2,2,0).")  
       self.failUnlessEqual(dsds[2,2,2,1],0.0,"ds/ds has wrong value at (2,2,2,1).")  
       self.failUnlessEqual(dsds[2,2,2,2],1.0,"ds/ds has wrong value at (2,2,2,2).")  
       self.failUnlessEqual(dsds[2,2,2,3],0.0,"ds/ds has wrong value at (2,2,2,3).")  
       self.failUnlessEqual(dsds[2,2,2,4],0.0,"ds/ds has wrong value at (2,2,2,4).")  
       self.failUnlessEqual(dsds[2,2,3,0],0.0,"ds/ds has wrong value at (2,2,3,0).")  
       self.failUnlessEqual(dsds[2,2,3,1],0.0,"ds/ds has wrong value at (2,2,3,1).")  
       self.failUnlessEqual(dsds[2,2,3,2],0.0,"ds/ds has wrong value at (2,2,3,2).")  
       self.failUnlessEqual(dsds[2,2,3,3],0.0,"ds/ds has wrong value at (2,2,3,3).")  
       self.failUnlessEqual(dsds[2,2,3,4],0.0,"ds/ds has wrong value at (2,2,3,4).")  
       self.failUnlessEqual(dsds[2,3,0,0],0.0,"ds/ds has wrong value at (2,3,0,0).")  
       self.failUnlessEqual(dsds[2,3,0,1],0.0,"ds/ds has wrong value at (2,3,0,1).")  
       self.failUnlessEqual(dsds[2,3,0,2],0.0,"ds/ds has wrong value at (2,3,0,2).")  
       self.failUnlessEqual(dsds[2,3,0,3],0.0,"ds/ds has wrong value at (2,3,0,3).")  
       self.failUnlessEqual(dsds[2,3,0,4],0.0,"ds/ds has wrong value at (2,3,0,4).")  
       self.failUnlessEqual(dsds[2,3,1,0],0.0,"ds/ds has wrong value at (2,3,1,0).")  
       self.failUnlessEqual(dsds[2,3,1,1],0.0,"ds/ds has wrong value at (2,3,1,1).")  
       self.failUnlessEqual(dsds[2,3,1,2],0.0,"ds/ds has wrong value at (2,3,1,2).")  
       self.failUnlessEqual(dsds[2,3,1,3],0.0,"ds/ds has wrong value at (2,3,1,3).")  
       self.failUnlessEqual(dsds[2,3,1,4],0.0,"ds/ds has wrong value at (2,3,1,4).")  
       self.failUnlessEqual(dsds[2,3,2,0],0.0,"ds/ds has wrong value at (2,3,2,0).")  
       self.failUnlessEqual(dsds[2,3,2,1],0.0,"ds/ds has wrong value at (2,3,2,1).")  
       self.failUnlessEqual(dsds[2,3,2,2],0.0,"ds/ds has wrong value at (2,3,2,2).")  
       self.failUnlessEqual(dsds[2,3,2,3],1.0,"ds/ds has wrong value at (2,3,2,3).")  
       self.failUnlessEqual(dsds[2,3,2,4],0.0,"ds/ds has wrong value at (2,3,2,4).")  
       self.failUnlessEqual(dsds[2,3,3,0],0.0,"ds/ds has wrong value at (2,3,3,0).")  
       self.failUnlessEqual(dsds[2,3,3,1],0.0,"ds/ds has wrong value at (2,3,3,1).")  
       self.failUnlessEqual(dsds[2,3,3,2],0.0,"ds/ds has wrong value at (2,3,3,2).")  
       self.failUnlessEqual(dsds[2,3,3,3],0.0,"ds/ds has wrong value at (2,3,3,3).")  
       self.failUnlessEqual(dsds[2,3,3,4],0.0,"ds/ds has wrong value at (2,3,3,4).")  
       self.failUnlessEqual(dsds[2,4,0,0],0.0,"ds/ds has wrong value at (2,4,0,0).")  
       self.failUnlessEqual(dsds[2,4,0,1],0.0,"ds/ds has wrong value at (2,4,0,1).")  
       self.failUnlessEqual(dsds[2,4,0,2],0.0,"ds/ds has wrong value at (2,4,0,2).")  
       self.failUnlessEqual(dsds[2,4,0,3],0.0,"ds/ds has wrong value at (2,4,0,3).")  
       self.failUnlessEqual(dsds[2,4,0,4],0.0,"ds/ds has wrong value at (2,4,0,4).")  
       self.failUnlessEqual(dsds[2,4,1,0],0.0,"ds/ds has wrong value at (2,4,1,0).")  
       self.failUnlessEqual(dsds[2,4,1,1],0.0,"ds/ds has wrong value at (2,4,1,1).")  
       self.failUnlessEqual(dsds[2,4,1,2],0.0,"ds/ds has wrong value at (2,4,1,2).")  
       self.failUnlessEqual(dsds[2,4,1,3],0.0,"ds/ds has wrong value at (2,4,1,3).")  
       self.failUnlessEqual(dsds[2,4,1,4],0.0,"ds/ds has wrong value at (2,4,1,4).")  
       self.failUnlessEqual(dsds[2,4,2,0],0.0,"ds/ds has wrong value at (2,4,2,0).")  
       self.failUnlessEqual(dsds[2,4,2,1],0.0,"ds/ds has wrong value at (2,4,2,1).")  
       self.failUnlessEqual(dsds[2,4,2,2],0.0,"ds/ds has wrong value at (2,4,2,2).")  
       self.failUnlessEqual(dsds[2,4,2,3],0.0,"ds/ds has wrong value at (2,4,2,3).")  
       self.failUnlessEqual(dsds[2,4,2,4],1.0,"ds/ds has wrong value at (2,4,2,4).")  
       self.failUnlessEqual(dsds[2,4,3,0],0.0,"ds/ds has wrong value at (2,4,3,0).")  
       self.failUnlessEqual(dsds[2,4,3,1],0.0,"ds/ds has wrong value at (2,4,3,1).")  
       self.failUnlessEqual(dsds[2,4,3,2],0.0,"ds/ds has wrong value at (2,4,3,2).")  
       self.failUnlessEqual(dsds[2,4,3,3],0.0,"ds/ds has wrong value at (2,4,3,3).")  
       self.failUnlessEqual(dsds[2,4,3,4],0.0,"ds/ds has wrong value at (2,4,3,4).")  
       self.failUnlessEqual(dsds[3,0,0,0],0.0,"ds/ds has wrong value at (3,0,0,0).")  
       self.failUnlessEqual(dsds[3,0,0,1],0.0,"ds/ds has wrong value at (3,0,0,1).")  
       self.failUnlessEqual(dsds[3,0,0,2],0.0,"ds/ds has wrong value at (3,0,0,2).")  
       self.failUnlessEqual(dsds[3,0,0,3],0.0,"ds/ds has wrong value at (3,0,0,3).")  
       self.failUnlessEqual(dsds[3,0,0,4],0.0,"ds/ds has wrong value at (3,0,0,4).")  
       self.failUnlessEqual(dsds[3,0,1,0],0.0,"ds/ds has wrong value at (3,0,1,0).")  
       self.failUnlessEqual(dsds[3,0,1,1],0.0,"ds/ds has wrong value at (3,0,1,1).")  
       self.failUnlessEqual(dsds[3,0,1,2],0.0,"ds/ds has wrong value at (3,0,1,2).")  
       self.failUnlessEqual(dsds[3,0,1,3],0.0,"ds/ds has wrong value at (3,0,1,3).")  
       self.failUnlessEqual(dsds[3,0,1,4],0.0,"ds/ds has wrong value at (3,0,1,4).")  
       self.failUnlessEqual(dsds[3,0,2,0],0.0,"ds/ds has wrong value at (3,0,2,0).")  
       self.failUnlessEqual(dsds[3,0,2,1],0.0,"ds/ds has wrong value at (3,0,2,1).")  
       self.failUnlessEqual(dsds[3,0,2,2],0.0,"ds/ds has wrong value at (3,0,2,2).")  
       self.failUnlessEqual(dsds[3,0,2,3],0.0,"ds/ds has wrong value at (3,0,2,3).")  
       self.failUnlessEqual(dsds[3,0,2,4],0.0,"ds/ds has wrong value at (3,0,2,4).")  
       self.failUnlessEqual(dsds[3,0,3,0],1.0,"ds/ds has wrong value at (3,0,3,0).")  
       self.failUnlessEqual(dsds[3,0,3,1],0.0,"ds/ds has wrong value at (3,0,3,1).")  
       self.failUnlessEqual(dsds[3,0,3,2],0.0,"ds/ds has wrong value at (3,0,3,2).")  
       self.failUnlessEqual(dsds[3,0,3,3],0.0,"ds/ds has wrong value at (3,0,3,3).")  
       self.failUnlessEqual(dsds[3,0,3,4],0.0,"ds/ds has wrong value at (3,0,3,4).")  
       self.failUnlessEqual(dsds[3,1,0,0],0.0,"ds/ds has wrong value at (3,1,0,0).")  
       self.failUnlessEqual(dsds[3,1,0,1],0.0,"ds/ds has wrong value at (3,1,0,1).")  
       self.failUnlessEqual(dsds[3,1,0,2],0.0,"ds/ds has wrong value at (3,1,0,2).")  
       self.failUnlessEqual(dsds[3,1,0,3],0.0,"ds/ds has wrong value at (3,1,0,3).")  
       self.failUnlessEqual(dsds[3,1,0,4],0.0,"ds/ds has wrong value at (3,1,0,4).")  
       self.failUnlessEqual(dsds[3,1,1,0],0.0,"ds/ds has wrong value at (3,1,1,0).")  
       self.failUnlessEqual(dsds[3,1,1,1],0.0,"ds/ds has wrong value at (3,1,1,1).")  
       self.failUnlessEqual(dsds[3,1,1,2],0.0,"ds/ds has wrong value at (3,1,1,2).")  
       self.failUnlessEqual(dsds[3,1,1,3],0.0,"ds/ds has wrong value at (3,1,1,3).")  
       self.failUnlessEqual(dsds[3,1,1,4],0.0,"ds/ds has wrong value at (3,1,1,4).")  
       self.failUnlessEqual(dsds[3,1,2,0],0.0,"ds/ds has wrong value at (3,1,2,0).")  
       self.failUnlessEqual(dsds[3,1,2,1],0.0,"ds/ds has wrong value at (3,1,2,1).")  
       self.failUnlessEqual(dsds[3,1,2,2],0.0,"ds/ds has wrong value at (3,1,2,2).")  
       self.failUnlessEqual(dsds[3,1,2,3],0.0,"ds/ds has wrong value at (3,1,2,3).")  
       self.failUnlessEqual(dsds[3,1,2,4],0.0,"ds/ds has wrong value at (3,1,2,4).")  
       self.failUnlessEqual(dsds[3,1,3,0],0.0,"ds/ds has wrong value at (3,1,3,0).")  
       self.failUnlessEqual(dsds[3,1,3,1],1.0,"ds/ds has wrong value at (3,1,3,1).")  
       self.failUnlessEqual(dsds[3,1,3,2],0.0,"ds/ds has wrong value at (3,1,3,2).")  
       self.failUnlessEqual(dsds[3,1,3,3],0.0,"ds/ds has wrong value at (3,1,3,3).")  
       self.failUnlessEqual(dsds[3,1,3,4],0.0,"ds/ds has wrong value at (3,1,3,4).")  
       self.failUnlessEqual(dsds[3,2,0,0],0.0,"ds/ds has wrong value at (3,2,0,0).")  
       self.failUnlessEqual(dsds[3,2,0,1],0.0,"ds/ds has wrong value at (3,2,0,1).")  
       self.failUnlessEqual(dsds[3,2,0,2],0.0,"ds/ds has wrong value at (3,2,0,2).")  
       self.failUnlessEqual(dsds[3,2,0,3],0.0,"ds/ds has wrong value at (3,2,0,3).")  
       self.failUnlessEqual(dsds[3,2,0,4],0.0,"ds/ds has wrong value at (3,2,0,4).")  
       self.failUnlessEqual(dsds[3,2,1,0],0.0,"ds/ds has wrong value at (3,2,1,0).")  
       self.failUnlessEqual(dsds[3,2,1,1],0.0,"ds/ds has wrong value at (3,2,1,1).")  
       self.failUnlessEqual(dsds[3,2,1,2],0.0,"ds/ds has wrong value at (3,2,1,2).")  
       self.failUnlessEqual(dsds[3,2,1,3],0.0,"ds/ds has wrong value at (3,2,1,3).")  
       self.failUnlessEqual(dsds[3,2,1,4],0.0,"ds/ds has wrong value at (3,2,1,4).")  
       self.failUnlessEqual(dsds[3,2,2,0],0.0,"ds/ds has wrong value at (3,2,2,0).")  
       self.failUnlessEqual(dsds[3,2,2,1],0.0,"ds/ds has wrong value at (3,2,2,1).")  
       self.failUnlessEqual(dsds[3,2,2,2],0.0,"ds/ds has wrong value at (3,2,2,2).")  
       self.failUnlessEqual(dsds[3,2,2,3],0.0,"ds/ds has wrong value at (3,2,2,3).")  
       self.failUnlessEqual(dsds[3,2,2,4],0.0,"ds/ds has wrong value at (3,2,2,4).")  
       self.failUnlessEqual(dsds[3,2,3,0],0.0,"ds/ds has wrong value at (3,2,3,0).")  
       self.failUnlessEqual(dsds[3,2,3,1],0.0,"ds/ds has wrong value at (3,2,3,1).")  
       self.failUnlessEqual(dsds[3,2,3,2],1.0,"ds/ds has wrong value at (3,2,3,2).")  
       self.failUnlessEqual(dsds[3,2,3,3],0.0,"ds/ds has wrong value at (3,2,3,3).")  
       self.failUnlessEqual(dsds[3,2,3,4],0.0,"ds/ds has wrong value at (3,2,3,4).")  
       self.failUnlessEqual(dsds[3,3,0,0],0.0,"ds/ds has wrong value at (3,3,0,0).")  
       self.failUnlessEqual(dsds[3,3,0,1],0.0,"ds/ds has wrong value at (3,3,0,1).")  
       self.failUnlessEqual(dsds[3,3,0,2],0.0,"ds/ds has wrong value at (3,3,0,2).")  
       self.failUnlessEqual(dsds[3,3,0,3],0.0,"ds/ds has wrong value at (3,3,0,3).")  
       self.failUnlessEqual(dsds[3,3,0,4],0.0,"ds/ds has wrong value at (3,3,0,4).")  
       self.failUnlessEqual(dsds[3,3,1,0],0.0,"ds/ds has wrong value at (3,3,1,0).")  
       self.failUnlessEqual(dsds[3,3,1,1],0.0,"ds/ds has wrong value at (3,3,1,1).")  
       self.failUnlessEqual(dsds[3,3,1,2],0.0,"ds/ds has wrong value at (3,3,1,2).")  
       self.failUnlessEqual(dsds[3,3,1,3],0.0,"ds/ds has wrong value at (3,3,1,3).")  
       self.failUnlessEqual(dsds[3,3,1,4],0.0,"ds/ds has wrong value at (3,3,1,4).")  
       self.failUnlessEqual(dsds[3,3,2,0],0.0,"ds/ds has wrong value at (3,3,2,0).")  
       self.failUnlessEqual(dsds[3,3,2,1],0.0,"ds/ds has wrong value at (3,3,2,1).")  
       self.failUnlessEqual(dsds[3,3,2,2],0.0,"ds/ds has wrong value at (3,3,2,2).")  
       self.failUnlessEqual(dsds[3,3,2,3],0.0,"ds/ds has wrong value at (3,3,2,3).")  
       self.failUnlessEqual(dsds[3,3,2,4],0.0,"ds/ds has wrong value at (3,3,2,4).")  
       self.failUnlessEqual(dsds[3,3,3,0],0.0,"ds/ds has wrong value at (3,3,3,0).")  
       self.failUnlessEqual(dsds[3,3,3,1],0.0,"ds/ds has wrong value at (3,3,3,1).")  
       self.failUnlessEqual(dsds[3,3,3,2],0.0,"ds/ds has wrong value at (3,3,3,2).")  
       self.failUnlessEqual(dsds[3,3,3,3],1.0,"ds/ds has wrong value at (3,3,3,3).")  
       self.failUnlessEqual(dsds[3,3,3,4],0.0,"ds/ds has wrong value at (3,3,3,4).")  
       self.failUnlessEqual(dsds[3,4,0,0],0.0,"ds/ds has wrong value at (3,4,0,0).")  
       self.failUnlessEqual(dsds[3,4,0,1],0.0,"ds/ds has wrong value at (3,4,0,1).")  
       self.failUnlessEqual(dsds[3,4,0,2],0.0,"ds/ds has wrong value at (3,4,0,2).")  
       self.failUnlessEqual(dsds[3,4,0,3],0.0,"ds/ds has wrong value at (3,4,0,3).")  
       self.failUnlessEqual(dsds[3,4,0,4],0.0,"ds/ds has wrong value at (3,4,0,4).")  
       self.failUnlessEqual(dsds[3,4,1,0],0.0,"ds/ds has wrong value at (3,4,1,0).")  
       self.failUnlessEqual(dsds[3,4,1,1],0.0,"ds/ds has wrong value at (3,4,1,1).")  
       self.failUnlessEqual(dsds[3,4,1,2],0.0,"ds/ds has wrong value at (3,4,1,2).")  
       self.failUnlessEqual(dsds[3,4,1,3],0.0,"ds/ds has wrong value at (3,4,1,3).")  
       self.failUnlessEqual(dsds[3,4,1,4],0.0,"ds/ds has wrong value at (3,4,1,4).")  
       self.failUnlessEqual(dsds[3,4,2,0],0.0,"ds/ds has wrong value at (3,4,2,0).")  
       self.failUnlessEqual(dsds[3,4,2,1],0.0,"ds/ds has wrong value at (3,4,2,1).")  
       self.failUnlessEqual(dsds[3,4,2,2],0.0,"ds/ds has wrong value at (3,4,2,2).")  
       self.failUnlessEqual(dsds[3,4,2,3],0.0,"ds/ds has wrong value at (3,4,2,3).")  
       self.failUnlessEqual(dsds[3,4,2,4],0.0,"ds/ds has wrong value at (3,4,2,4).")  
       self.failUnlessEqual(dsds[3,4,3,0],0.0,"ds/ds has wrong value at (3,4,3,0).")  
       self.failUnlessEqual(dsds[3,4,3,1],0.0,"ds/ds has wrong value at (3,4,3,1).")  
       self.failUnlessEqual(dsds[3,4,3,2],0.0,"ds/ds has wrong value at (3,4,3,2).")  
       self.failUnlessEqual(dsds[3,4,3,3],0.0,"ds/ds has wrong value at (3,4,3,3).")  
       self.failUnlessEqual(dsds[3,4,3,4],1.0,"ds/ds has wrong value at (3,4,3,4).")  
   
       self.failUnlessEqual(s.getArgument(0),1,"wrong argument 0.")  
       self.failUnlessEqual(s.getArgument(1),-1.0,"wrong argument 1.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),2,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],1,"wrongly substituted argument 0.")  
       self.failUnlessEqual(sa[1],-1.0,"wrongly substituted argument 1.")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(4, 5),dim=None)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((4, 5))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank2_dd_nargs0(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(4, 5),dim=self.functionspace.getDim(),args=[])  
       self.failUnlessEqual(s.getRank(),2,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(4, 5),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),self.functionspace.getDim(),"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((4, 5))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(4, 5),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(4, 5, 4, 5),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0,0,0],1.0,"ds/ds has wrong value at (0,0,0,0).")  
       self.failUnlessEqual(dsds[0,0,0,1],0.0,"ds/ds has wrong value at (0,0,0,1).")  
       self.failUnlessEqual(dsds[0,0,0,2],0.0,"ds/ds has wrong value at (0,0,0,2).")  
       self.failUnlessEqual(dsds[0,0,0,3],0.0,"ds/ds has wrong value at (0,0,0,3).")  
       self.failUnlessEqual(dsds[0,0,0,4],0.0,"ds/ds has wrong value at (0,0,0,4).")  
       self.failUnlessEqual(dsds[0,0,1,0],0.0,"ds/ds has wrong value at (0,0,1,0).")  
       self.failUnlessEqual(dsds[0,0,1,1],0.0,"ds/ds has wrong value at (0,0,1,1).")  
       self.failUnlessEqual(dsds[0,0,1,2],0.0,"ds/ds has wrong value at (0,0,1,2).")  
       self.failUnlessEqual(dsds[0,0,1,3],0.0,"ds/ds has wrong value at (0,0,1,3).")  
       self.failUnlessEqual(dsds[0,0,1,4],0.0,"ds/ds has wrong value at (0,0,1,4).")  
       self.failUnlessEqual(dsds[0,0,2,0],0.0,"ds/ds has wrong value at (0,0,2,0).")  
       self.failUnlessEqual(dsds[0,0,2,1],0.0,"ds/ds has wrong value at (0,0,2,1).")  
       self.failUnlessEqual(dsds[0,0,2,2],0.0,"ds/ds has wrong value at (0,0,2,2).")  
       self.failUnlessEqual(dsds[0,0,2,3],0.0,"ds/ds has wrong value at (0,0,2,3).")  
       self.failUnlessEqual(dsds[0,0,2,4],0.0,"ds/ds has wrong value at (0,0,2,4).")  
       self.failUnlessEqual(dsds[0,0,3,0],0.0,"ds/ds has wrong value at (0,0,3,0).")  
       self.failUnlessEqual(dsds[0,0,3,1],0.0,"ds/ds has wrong value at (0,0,3,1).")  
       self.failUnlessEqual(dsds[0,0,3,2],0.0,"ds/ds has wrong value at (0,0,3,2).")  
       self.failUnlessEqual(dsds[0,0,3,3],0.0,"ds/ds has wrong value at (0,0,3,3).")  
       self.failUnlessEqual(dsds[0,0,3,4],0.0,"ds/ds has wrong value at (0,0,3,4).")  
       self.failUnlessEqual(dsds[0,1,0,0],0.0,"ds/ds has wrong value at (0,1,0,0).")  
       self.failUnlessEqual(dsds[0,1,0,1],1.0,"ds/ds has wrong value at (0,1,0,1).")  
       self.failUnlessEqual(dsds[0,1,0,2],0.0,"ds/ds has wrong value at (0,1,0,2).")  
       self.failUnlessEqual(dsds[0,1,0,3],0.0,"ds/ds has wrong value at (0,1,0,3).")  
       self.failUnlessEqual(dsds[0,1,0,4],0.0,"ds/ds has wrong value at (0,1,0,4).")  
       self.failUnlessEqual(dsds[0,1,1,0],0.0,"ds/ds has wrong value at (0,1,1,0).")  
       self.failUnlessEqual(dsds[0,1,1,1],0.0,"ds/ds has wrong value at (0,1,1,1).")  
       self.failUnlessEqual(dsds[0,1,1,2],0.0,"ds/ds has wrong value at (0,1,1,2).")  
       self.failUnlessEqual(dsds[0,1,1,3],0.0,"ds/ds has wrong value at (0,1,1,3).")  
       self.failUnlessEqual(dsds[0,1,1,4],0.0,"ds/ds has wrong value at (0,1,1,4).")  
       self.failUnlessEqual(dsds[0,1,2,0],0.0,"ds/ds has wrong value at (0,1,2,0).")  
       self.failUnlessEqual(dsds[0,1,2,1],0.0,"ds/ds has wrong value at (0,1,2,1).")  
       self.failUnlessEqual(dsds[0,1,2,2],0.0,"ds/ds has wrong value at (0,1,2,2).")  
       self.failUnlessEqual(dsds[0,1,2,3],0.0,"ds/ds has wrong value at (0,1,2,3).")  
       self.failUnlessEqual(dsds[0,1,2,4],0.0,"ds/ds has wrong value at (0,1,2,4).")  
       self.failUnlessEqual(dsds[0,1,3,0],0.0,"ds/ds has wrong value at (0,1,3,0).")  
       self.failUnlessEqual(dsds[0,1,3,1],0.0,"ds/ds has wrong value at (0,1,3,1).")  
       self.failUnlessEqual(dsds[0,1,3,2],0.0,"ds/ds has wrong value at (0,1,3,2).")  
       self.failUnlessEqual(dsds[0,1,3,3],0.0,"ds/ds has wrong value at (0,1,3,3).")  
       self.failUnlessEqual(dsds[0,1,3,4],0.0,"ds/ds has wrong value at (0,1,3,4).")  
       self.failUnlessEqual(dsds[0,2,0,0],0.0,"ds/ds has wrong value at (0,2,0,0).")  
       self.failUnlessEqual(dsds[0,2,0,1],0.0,"ds/ds has wrong value at (0,2,0,1).")  
       self.failUnlessEqual(dsds[0,2,0,2],1.0,"ds/ds has wrong value at (0,2,0,2).")  
       self.failUnlessEqual(dsds[0,2,0,3],0.0,"ds/ds has wrong value at (0,2,0,3).")  
       self.failUnlessEqual(dsds[0,2,0,4],0.0,"ds/ds has wrong value at (0,2,0,4).")  
       self.failUnlessEqual(dsds[0,2,1,0],0.0,"ds/ds has wrong value at (0,2,1,0).")  
       self.failUnlessEqual(dsds[0,2,1,1],0.0,"ds/ds has wrong value at (0,2,1,1).")  
       self.failUnlessEqual(dsds[0,2,1,2],0.0,"ds/ds has wrong value at (0,2,1,2).")  
       self.failUnlessEqual(dsds[0,2,1,3],0.0,"ds/ds has wrong value at (0,2,1,3).")  
       self.failUnlessEqual(dsds[0,2,1,4],0.0,"ds/ds has wrong value at (0,2,1,4).")  
       self.failUnlessEqual(dsds[0,2,2,0],0.0,"ds/ds has wrong value at (0,2,2,0).")  
       self.failUnlessEqual(dsds[0,2,2,1],0.0,"ds/ds has wrong value at (0,2,2,1).")  
       self.failUnlessEqual(dsds[0,2,2,2],0.0,"ds/ds has wrong value at (0,2,2,2).")  
       self.failUnlessEqual(dsds[0,2,2,3],0.0,"ds/ds has wrong value at (0,2,2,3).")  
       self.failUnlessEqual(dsds[0,2,2,4],0.0,"ds/ds has wrong value at (0,2,2,4).")  
       self.failUnlessEqual(dsds[0,2,3,0],0.0,"ds/ds has wrong value at (0,2,3,0).")  
       self.failUnlessEqual(dsds[0,2,3,1],0.0,"ds/ds has wrong value at (0,2,3,1).")  
       self.failUnlessEqual(dsds[0,2,3,2],0.0,"ds/ds has wrong value at (0,2,3,2).")  
       self.failUnlessEqual(dsds[0,2,3,3],0.0,"ds/ds has wrong value at (0,2,3,3).")  
       self.failUnlessEqual(dsds[0,2,3,4],0.0,"ds/ds has wrong value at (0,2,3,4).")  
       self.failUnlessEqual(dsds[0,3,0,0],0.0,"ds/ds has wrong value at (0,3,0,0).")  
       self.failUnlessEqual(dsds[0,3,0,1],0.0,"ds/ds has wrong value at (0,3,0,1).")  
       self.failUnlessEqual(dsds[0,3,0,2],0.0,"ds/ds has wrong value at (0,3,0,2).")  
       self.failUnlessEqual(dsds[0,3,0,3],1.0,"ds/ds has wrong value at (0,3,0,3).")  
       self.failUnlessEqual(dsds[0,3,0,4],0.0,"ds/ds has wrong value at (0,3,0,4).")  
       self.failUnlessEqual(dsds[0,3,1,0],0.0,"ds/ds has wrong value at (0,3,1,0).")  
       self.failUnlessEqual(dsds[0,3,1,1],0.0,"ds/ds has wrong value at (0,3,1,1).")  
       self.failUnlessEqual(dsds[0,3,1,2],0.0,"ds/ds has wrong value at (0,3,1,2).")  
       self.failUnlessEqual(dsds[0,3,1,3],0.0,"ds/ds has wrong value at (0,3,1,3).")  
       self.failUnlessEqual(dsds[0,3,1,4],0.0,"ds/ds has wrong value at (0,3,1,4).")  
       self.failUnlessEqual(dsds[0,3,2,0],0.0,"ds/ds has wrong value at (0,3,2,0).")  
       self.failUnlessEqual(dsds[0,3,2,1],0.0,"ds/ds has wrong value at (0,3,2,1).")  
       self.failUnlessEqual(dsds[0,3,2,2],0.0,"ds/ds has wrong value at (0,3,2,2).")  
       self.failUnlessEqual(dsds[0,3,2,3],0.0,"ds/ds has wrong value at (0,3,2,3).")  
       self.failUnlessEqual(dsds[0,3,2,4],0.0,"ds/ds has wrong value at (0,3,2,4).")  
       self.failUnlessEqual(dsds[0,3,3,0],0.0,"ds/ds has wrong value at (0,3,3,0).")  
       self.failUnlessEqual(dsds[0,3,3,1],0.0,"ds/ds has wrong value at (0,3,3,1).")  
       self.failUnlessEqual(dsds[0,3,3,2],0.0,"ds/ds has wrong value at (0,3,3,2).")  
       self.failUnlessEqual(dsds[0,3,3,3],0.0,"ds/ds has wrong value at (0,3,3,3).")  
       self.failUnlessEqual(dsds[0,3,3,4],0.0,"ds/ds has wrong value at (0,3,3,4).")  
       self.failUnlessEqual(dsds[0,4,0,0],0.0,"ds/ds has wrong value at (0,4,0,0).")  
       self.failUnlessEqual(dsds[0,4,0,1],0.0,"ds/ds has wrong value at (0,4,0,1).")  
       self.failUnlessEqual(dsds[0,4,0,2],0.0,"ds/ds has wrong value at (0,4,0,2).")  
       self.failUnlessEqual(dsds[0,4,0,3],0.0,"ds/ds has wrong value at (0,4,0,3).")  
       self.failUnlessEqual(dsds[0,4,0,4],1.0,"ds/ds has wrong value at (0,4,0,4).")  
       self.failUnlessEqual(dsds[0,4,1,0],0.0,"ds/ds has wrong value at (0,4,1,0).")  
       self.failUnlessEqual(dsds[0,4,1,1],0.0,"ds/ds has wrong value at (0,4,1,1).")  
       self.failUnlessEqual(dsds[0,4,1,2],0.0,"ds/ds has wrong value at (0,4,1,2).")  
       self.failUnlessEqual(dsds[0,4,1,3],0.0,"ds/ds has wrong value at (0,4,1,3).")  
       self.failUnlessEqual(dsds[0,4,1,4],0.0,"ds/ds has wrong value at (0,4,1,4).")  
       self.failUnlessEqual(dsds[0,4,2,0],0.0,"ds/ds has wrong value at (0,4,2,0).")  
       self.failUnlessEqual(dsds[0,4,2,1],0.0,"ds/ds has wrong value at (0,4,2,1).")  
       self.failUnlessEqual(dsds[0,4,2,2],0.0,"ds/ds has wrong value at (0,4,2,2).")  
       self.failUnlessEqual(dsds[0,4,2,3],0.0,"ds/ds has wrong value at (0,4,2,3).")  
       self.failUnlessEqual(dsds[0,4,2,4],0.0,"ds/ds has wrong value at (0,4,2,4).")  
       self.failUnlessEqual(dsds[0,4,3,0],0.0,"ds/ds has wrong value at (0,4,3,0).")  
       self.failUnlessEqual(dsds[0,4,3,1],0.0,"ds/ds has wrong value at (0,4,3,1).")  
       self.failUnlessEqual(dsds[0,4,3,2],0.0,"ds/ds has wrong value at (0,4,3,2).")  
       self.failUnlessEqual(dsds[0,4,3,3],0.0,"ds/ds has wrong value at (0,4,3,3).")  
       self.failUnlessEqual(dsds[0,4,3,4],0.0,"ds/ds has wrong value at (0,4,3,4).")  
       self.failUnlessEqual(dsds[1,0,0,0],0.0,"ds/ds has wrong value at (1,0,0,0).")  
       self.failUnlessEqual(dsds[1,0,0,1],0.0,"ds/ds has wrong value at (1,0,0,1).")  
       self.failUnlessEqual(dsds[1,0,0,2],0.0,"ds/ds has wrong value at (1,0,0,2).")  
       self.failUnlessEqual(dsds[1,0,0,3],0.0,"ds/ds has wrong value at (1,0,0,3).")  
       self.failUnlessEqual(dsds[1,0,0,4],0.0,"ds/ds has wrong value at (1,0,0,4).")  
       self.failUnlessEqual(dsds[1,0,1,0],1.0,"ds/ds has wrong value at (1,0,1,0).")  
       self.failUnlessEqual(dsds[1,0,1,1],0.0,"ds/ds has wrong value at (1,0,1,1).")  
       self.failUnlessEqual(dsds[1,0,1,2],0.0,"ds/ds has wrong value at (1,0,1,2).")  
       self.failUnlessEqual(dsds[1,0,1,3],0.0,"ds/ds has wrong value at (1,0,1,3).")  
       self.failUnlessEqual(dsds[1,0,1,4],0.0,"ds/ds has wrong value at (1,0,1,4).")  
       self.failUnlessEqual(dsds[1,0,2,0],0.0,"ds/ds has wrong value at (1,0,2,0).")  
       self.failUnlessEqual(dsds[1,0,2,1],0.0,"ds/ds has wrong value at (1,0,2,1).")  
       self.failUnlessEqual(dsds[1,0,2,2],0.0,"ds/ds has wrong value at (1,0,2,2).")  
       self.failUnlessEqual(dsds[1,0,2,3],0.0,"ds/ds has wrong value at (1,0,2,3).")  
       self.failUnlessEqual(dsds[1,0,2,4],0.0,"ds/ds has wrong value at (1,0,2,4).")  
       self.failUnlessEqual(dsds[1,0,3,0],0.0,"ds/ds has wrong value at (1,0,3,0).")  
       self.failUnlessEqual(dsds[1,0,3,1],0.0,"ds/ds has wrong value at (1,0,3,1).")  
       self.failUnlessEqual(dsds[1,0,3,2],0.0,"ds/ds has wrong value at (1,0,3,2).")  
       self.failUnlessEqual(dsds[1,0,3,3],0.0,"ds/ds has wrong value at (1,0,3,3).")  
       self.failUnlessEqual(dsds[1,0,3,4],0.0,"ds/ds has wrong value at (1,0,3,4).")  
       self.failUnlessEqual(dsds[1,1,0,0],0.0,"ds/ds has wrong value at (1,1,0,0).")  
       self.failUnlessEqual(dsds[1,1,0,1],0.0,"ds/ds has wrong value at (1,1,0,1).")  
       self.failUnlessEqual(dsds[1,1,0,2],0.0,"ds/ds has wrong value at (1,1,0,2).")  
       self.failUnlessEqual(dsds[1,1,0,3],0.0,"ds/ds has wrong value at (1,1,0,3).")  
       self.failUnlessEqual(dsds[1,1,0,4],0.0,"ds/ds has wrong value at (1,1,0,4).")  
       self.failUnlessEqual(dsds[1,1,1,0],0.0,"ds/ds has wrong value at (1,1,1,0).")  
       self.failUnlessEqual(dsds[1,1,1,1],1.0,"ds/ds has wrong value at (1,1,1,1).")  
       self.failUnlessEqual(dsds[1,1,1,2],0.0,"ds/ds has wrong value at (1,1,1,2).")  
       self.failUnlessEqual(dsds[1,1,1,3],0.0,"ds/ds has wrong value at (1,1,1,3).")  
       self.failUnlessEqual(dsds[1,1,1,4],0.0,"ds/ds has wrong value at (1,1,1,4).")  
       self.failUnlessEqual(dsds[1,1,2,0],0.0,"ds/ds has wrong value at (1,1,2,0).")  
       self.failUnlessEqual(dsds[1,1,2,1],0.0,"ds/ds has wrong value at (1,1,2,1).")  
       self.failUnlessEqual(dsds[1,1,2,2],0.0,"ds/ds has wrong value at (1,1,2,2).")  
       self.failUnlessEqual(dsds[1,1,2,3],0.0,"ds/ds has wrong value at (1,1,2,3).")  
       self.failUnlessEqual(dsds[1,1,2,4],0.0,"ds/ds has wrong value at (1,1,2,4).")  
       self.failUnlessEqual(dsds[1,1,3,0],0.0,"ds/ds has wrong value at (1,1,3,0).")  
       self.failUnlessEqual(dsds[1,1,3,1],0.0,"ds/ds has wrong value at (1,1,3,1).")  
       self.failUnlessEqual(dsds[1,1,3,2],0.0,"ds/ds has wrong value at (1,1,3,2).")  
       self.failUnlessEqual(dsds[1,1,3,3],0.0,"ds/ds has wrong value at (1,1,3,3).")  
       self.failUnlessEqual(dsds[1,1,3,4],0.0,"ds/ds has wrong value at (1,1,3,4).")  
       self.failUnlessEqual(dsds[1,2,0,0],0.0,"ds/ds has wrong value at (1,2,0,0).")  
       self.failUnlessEqual(dsds[1,2,0,1],0.0,"ds/ds has wrong value at (1,2,0,1).")  
       self.failUnlessEqual(dsds[1,2,0,2],0.0,"ds/ds has wrong value at (1,2,0,2).")  
       self.failUnlessEqual(dsds[1,2,0,3],0.0,"ds/ds has wrong value at (1,2,0,3).")  
       self.failUnlessEqual(dsds[1,2,0,4],0.0,"ds/ds has wrong value at (1,2,0,4).")  
       self.failUnlessEqual(dsds[1,2,1,0],0.0,"ds/ds has wrong value at (1,2,1,0).")  
       self.failUnlessEqual(dsds[1,2,1,1],0.0,"ds/ds has wrong value at (1,2,1,1).")  
       self.failUnlessEqual(dsds[1,2,1,2],1.0,"ds/ds has wrong value at (1,2,1,2).")  
       self.failUnlessEqual(dsds[1,2,1,3],0.0,"ds/ds has wrong value at (1,2,1,3).")  
       self.failUnlessEqual(dsds[1,2,1,4],0.0,"ds/ds has wrong value at (1,2,1,4).")  
       self.failUnlessEqual(dsds[1,2,2,0],0.0,"ds/ds has wrong value at (1,2,2,0).")  
       self.failUnlessEqual(dsds[1,2,2,1],0.0,"ds/ds has wrong value at (1,2,2,1).")  
       self.failUnlessEqual(dsds[1,2,2,2],0.0,"ds/ds has wrong value at (1,2,2,2).")  
       self.failUnlessEqual(dsds[1,2,2,3],0.0,"ds/ds has wrong value at (1,2,2,3).")  
       self.failUnlessEqual(dsds[1,2,2,4],0.0,"ds/ds has wrong value at (1,2,2,4).")  
       self.failUnlessEqual(dsds[1,2,3,0],0.0,"ds/ds has wrong value at (1,2,3,0).")  
       self.failUnlessEqual(dsds[1,2,3,1],0.0,"ds/ds has wrong value at (1,2,3,1).")  
       self.failUnlessEqual(dsds[1,2,3,2],0.0,"ds/ds has wrong value at (1,2,3,2).")  
       self.failUnlessEqual(dsds[1,2,3,3],0.0,"ds/ds has wrong value at (1,2,3,3).")  
       self.failUnlessEqual(dsds[1,2,3,4],0.0,"ds/ds has wrong value at (1,2,3,4).")  
       self.failUnlessEqual(dsds[1,3,0,0],0.0,"ds/ds has wrong value at (1,3,0,0).")  
       self.failUnlessEqual(dsds[1,3,0,1],0.0,"ds/ds has wrong value at (1,3,0,1).")  
       self.failUnlessEqual(dsds[1,3,0,2],0.0,"ds/ds has wrong value at (1,3,0,2).")  
       self.failUnlessEqual(dsds[1,3,0,3],0.0,"ds/ds has wrong value at (1,3,0,3).")  
       self.failUnlessEqual(dsds[1,3,0,4],0.0,"ds/ds has wrong value at (1,3,0,4).")  
       self.failUnlessEqual(dsds[1,3,1,0],0.0,"ds/ds has wrong value at (1,3,1,0).")  
       self.failUnlessEqual(dsds[1,3,1,1],0.0,"ds/ds has wrong value at (1,3,1,1).")  
       self.failUnlessEqual(dsds[1,3,1,2],0.0,"ds/ds has wrong value at (1,3,1,2).")  
       self.failUnlessEqual(dsds[1,3,1,3],1.0,"ds/ds has wrong value at (1,3,1,3).")  
       self.failUnlessEqual(dsds[1,3,1,4],0.0,"ds/ds has wrong value at (1,3,1,4).")  
       self.failUnlessEqual(dsds[1,3,2,0],0.0,"ds/ds has wrong value at (1,3,2,0).")  
       self.failUnlessEqual(dsds[1,3,2,1],0.0,"ds/ds has wrong value at (1,3,2,1).")  
       self.failUnlessEqual(dsds[1,3,2,2],0.0,"ds/ds has wrong value at (1,3,2,2).")  
       self.failUnlessEqual(dsds[1,3,2,3],0.0,"ds/ds has wrong value at (1,3,2,3).")  
       self.failUnlessEqual(dsds[1,3,2,4],0.0,"ds/ds has wrong value at (1,3,2,4).")  
       self.failUnlessEqual(dsds[1,3,3,0],0.0,"ds/ds has wrong value at (1,3,3,0).")  
       self.failUnlessEqual(dsds[1,3,3,1],0.0,"ds/ds has wrong value at (1,3,3,1).")  
       self.failUnlessEqual(dsds[1,3,3,2],0.0,"ds/ds has wrong value at (1,3,3,2).")  
       self.failUnlessEqual(dsds[1,3,3,3],0.0,"ds/ds has wrong value at (1,3,3,3).")  
       self.failUnlessEqual(dsds[1,3,3,4],0.0,"ds/ds has wrong value at (1,3,3,4).")  
       self.failUnlessEqual(dsds[1,4,0,0],0.0,"ds/ds has wrong value at (1,4,0,0).")  
       self.failUnlessEqual(dsds[1,4,0,1],0.0,"ds/ds has wrong value at (1,4,0,1).")  
       self.failUnlessEqual(dsds[1,4,0,2],0.0,"ds/ds has wrong value at (1,4,0,2).")  
       self.failUnlessEqual(dsds[1,4,0,3],0.0,"ds/ds has wrong value at (1,4,0,3).")  
       self.failUnlessEqual(dsds[1,4,0,4],0.0,"ds/ds has wrong value at (1,4,0,4).")  
       self.failUnlessEqual(dsds[1,4,1,0],0.0,"ds/ds has wrong value at (1,4,1,0).")  
       self.failUnlessEqual(dsds[1,4,1,1],0.0,"ds/ds has wrong value at (1,4,1,1).")  
       self.failUnlessEqual(dsds[1,4,1,2],0.0,"ds/ds has wrong value at (1,4,1,2).")  
       self.failUnlessEqual(dsds[1,4,1,3],0.0,"ds/ds has wrong value at (1,4,1,3).")  
       self.failUnlessEqual(dsds[1,4,1,4],1.0,"ds/ds has wrong value at (1,4,1,4).")  
       self.failUnlessEqual(dsds[1,4,2,0],0.0,"ds/ds has wrong value at (1,4,2,0).")  
       self.failUnlessEqual(dsds[1,4,2,1],0.0,"ds/ds has wrong value at (1,4,2,1).")  
       self.failUnlessEqual(dsds[1,4,2,2],0.0,"ds/ds has wrong value at (1,4,2,2).")  
       self.failUnlessEqual(dsds[1,4,2,3],0.0,"ds/ds has wrong value at (1,4,2,3).")  
       self.failUnlessEqual(dsds[1,4,2,4],0.0,"ds/ds has wrong value at (1,4,2,4).")  
       self.failUnlessEqual(dsds[1,4,3,0],0.0,"ds/ds has wrong value at (1,4,3,0).")  
       self.failUnlessEqual(dsds[1,4,3,1],0.0,"ds/ds has wrong value at (1,4,3,1).")  
       self.failUnlessEqual(dsds[1,4,3,2],0.0,"ds/ds has wrong value at (1,4,3,2).")  
       self.failUnlessEqual(dsds[1,4,3,3],0.0,"ds/ds has wrong value at (1,4,3,3).")  
       self.failUnlessEqual(dsds[1,4,3,4],0.0,"ds/ds has wrong value at (1,4,3,4).")  
       self.failUnlessEqual(dsds[2,0,0,0],0.0,"ds/ds has wrong value at (2,0,0,0).")  
       self.failUnlessEqual(dsds[2,0,0,1],0.0,"ds/ds has wrong value at (2,0,0,1).")  
       self.failUnlessEqual(dsds[2,0,0,2],0.0,"ds/ds has wrong value at (2,0,0,2).")  
       self.failUnlessEqual(dsds[2,0,0,3],0.0,"ds/ds has wrong value at (2,0,0,3).")  
       self.failUnlessEqual(dsds[2,0,0,4],0.0,"ds/ds has wrong value at (2,0,0,4).")  
       self.failUnlessEqual(dsds[2,0,1,0],0.0,"ds/ds has wrong value at (2,0,1,0).")  
       self.failUnlessEqual(dsds[2,0,1,1],0.0,"ds/ds has wrong value at (2,0,1,1).")  
       self.failUnlessEqual(dsds[2,0,1,2],0.0,"ds/ds has wrong value at (2,0,1,2).")  
       self.failUnlessEqual(dsds[2,0,1,3],0.0,"ds/ds has wrong value at (2,0,1,3).")  
       self.failUnlessEqual(dsds[2,0,1,4],0.0,"ds/ds has wrong value at (2,0,1,4).")  
       self.failUnlessEqual(dsds[2,0,2,0],1.0,"ds/ds has wrong value at (2,0,2,0).")  
       self.failUnlessEqual(dsds[2,0,2,1],0.0,"ds/ds has wrong value at (2,0,2,1).")  
       self.failUnlessEqual(dsds[2,0,2,2],0.0,"ds/ds has wrong value at (2,0,2,2).")  
       self.failUnlessEqual(dsds[2,0,2,3],0.0,"ds/ds has wrong value at (2,0,2,3).")  
       self.failUnlessEqual(dsds[2,0,2,4],0.0,"ds/ds has wrong value at (2,0,2,4).")  
       self.failUnlessEqual(dsds[2,0,3,0],0.0,"ds/ds has wrong value at (2,0,3,0).")  
       self.failUnlessEqual(dsds[2,0,3,1],0.0,"ds/ds has wrong value at (2,0,3,1).")  
       self.failUnlessEqual(dsds[2,0,3,2],0.0,"ds/ds has wrong value at (2,0,3,2).")  
       self.failUnlessEqual(dsds[2,0,3,3],0.0,"ds/ds has wrong value at (2,0,3,3).")  
       self.failUnlessEqual(dsds[2,0,3,4],0.0,"ds/ds has wrong value at (2,0,3,4).")  
       self.failUnlessEqual(dsds[2,1,0,0],0.0,"ds/ds has wrong value at (2,1,0,0).")  
       self.failUnlessEqual(dsds[2,1,0,1],0.0,"ds/ds has wrong value at (2,1,0,1).")  
       self.failUnlessEqual(dsds[2,1,0,2],0.0,"ds/ds has wrong value at (2,1,0,2).")  
       self.failUnlessEqual(dsds[2,1,0,3],0.0,"ds/ds has wrong value at (2,1,0,3).")  
       self.failUnlessEqual(dsds[2,1,0,4],0.0,"ds/ds has wrong value at (2,1,0,4).")  
       self.failUnlessEqual(dsds[2,1,1,0],0.0,"ds/ds has wrong value at (2,1,1,0).")  
       self.failUnlessEqual(dsds[2,1,1,1],0.0,"ds/ds has wrong value at (2,1,1,1).")  
       self.failUnlessEqual(dsds[2,1,1,2],0.0,"ds/ds has wrong value at (2,1,1,2).")  
       self.failUnlessEqual(dsds[2,1,1,3],0.0,"ds/ds has wrong value at (2,1,1,3).")  
       self.failUnlessEqual(dsds[2,1,1,4],0.0,"ds/ds has wrong value at (2,1,1,4).")  
       self.failUnlessEqual(dsds[2,1,2,0],0.0,"ds/ds has wrong value at (2,1,2,0).")  
       self.failUnlessEqual(dsds[2,1,2,1],1.0,"ds/ds has wrong value at (2,1,2,1).")  
       self.failUnlessEqual(dsds[2,1,2,2],0.0,"ds/ds has wrong value at (2,1,2,2).")  
       self.failUnlessEqual(dsds[2,1,2,3],0.0,"ds/ds has wrong value at (2,1,2,3).")  
       self.failUnlessEqual(dsds[2,1,2,4],0.0,"ds/ds has wrong value at (2,1,2,4).")  
       self.failUnlessEqual(dsds[2,1,3,0],0.0,"ds/ds has wrong value at (2,1,3,0).")  
       self.failUnlessEqual(dsds[2,1,3,1],0.0,"ds/ds has wrong value at (2,1,3,1).")  
       self.failUnlessEqual(dsds[2,1,3,2],0.0,"ds/ds has wrong value at (2,1,3,2).")  
       self.failUnlessEqual(dsds[2,1,3,3],0.0,"ds/ds has wrong value at (2,1,3,3).")  
       self.failUnlessEqual(dsds[2,1,3,4],0.0,"ds/ds has wrong value at (2,1,3,4).")  
       self.failUnlessEqual(dsds[2,2,0,0],0.0,"ds/ds has wrong value at (2,2,0,0).")  
       self.failUnlessEqual(dsds[2,2,0,1],0.0,"ds/ds has wrong value at (2,2,0,1).")  
       self.failUnlessEqual(dsds[2,2,0,2],0.0,"ds/ds has wrong value at (2,2,0,2).")  
       self.failUnlessEqual(dsds[2,2,0,3],0.0,"ds/ds has wrong value at (2,2,0,3).")  
       self.failUnlessEqual(dsds[2,2,0,4],0.0,"ds/ds has wrong value at (2,2,0,4).")  
       self.failUnlessEqual(dsds[2,2,1,0],0.0,"ds/ds has wrong value at (2,2,1,0).")  
       self.failUnlessEqual(dsds[2,2,1,1],0.0,"ds/ds has wrong value at (2,2,1,1).")  
       self.failUnlessEqual(dsds[2,2,1,2],0.0,"ds/ds has wrong value at (2,2,1,2).")  
       self.failUnlessEqual(dsds[2,2,1,3],0.0,"ds/ds has wrong value at (2,2,1,3).")  
       self.failUnlessEqual(dsds[2,2,1,4],0.0,"ds/ds has wrong value at (2,2,1,4).")  
       self.failUnlessEqual(dsds[2,2,2,0],0.0,"ds/ds has wrong value at (2,2,2,0).")  
       self.failUnlessEqual(dsds[2,2,2,1],0.0,"ds/ds has wrong value at (2,2,2,1).")  
       self.failUnlessEqual(dsds[2,2,2,2],1.0,"ds/ds has wrong value at (2,2,2,2).")  
       self.failUnlessEqual(dsds[2,2,2,3],0.0,"ds/ds has wrong value at (2,2,2,3).")  
       self.failUnlessEqual(dsds[2,2,2,4],0.0,"ds/ds has wrong value at (2,2,2,4).")  
       self.failUnlessEqual(dsds[2,2,3,0],0.0,"ds/ds has wrong value at (2,2,3,0).")  
       self.failUnlessEqual(dsds[2,2,3,1],0.0,"ds/ds has wrong value at (2,2,3,1).")  
       self.failUnlessEqual(dsds[2,2,3,2],0.0,"ds/ds has wrong value at (2,2,3,2).")  
       self.failUnlessEqual(dsds[2,2,3,3],0.0,"ds/ds has wrong value at (2,2,3,3).")  
       self.failUnlessEqual(dsds[2,2,3,4],0.0,"ds/ds has wrong value at (2,2,3,4).")  
       self.failUnlessEqual(dsds[2,3,0,0],0.0,"ds/ds has wrong value at (2,3,0,0).")  
       self.failUnlessEqual(dsds[2,3,0,1],0.0,"ds/ds has wrong value at (2,3,0,1).")  
       self.failUnlessEqual(dsds[2,3,0,2],0.0,"ds/ds has wrong value at (2,3,0,2).")  
       self.failUnlessEqual(dsds[2,3,0,3],0.0,"ds/ds has wrong value at (2,3,0,3).")  
       self.failUnlessEqual(dsds[2,3,0,4],0.0,"ds/ds has wrong value at (2,3,0,4).")  
       self.failUnlessEqual(dsds[2,3,1,0],0.0,"ds/ds has wrong value at (2,3,1,0).")  
       self.failUnlessEqual(dsds[2,3,1,1],0.0,"ds/ds has wrong value at (2,3,1,1).")  
       self.failUnlessEqual(dsds[2,3,1,2],0.0,"ds/ds has wrong value at (2,3,1,2).")  
       self.failUnlessEqual(dsds[2,3,1,3],0.0,"ds/ds has wrong value at (2,3,1,3).")  
       self.failUnlessEqual(dsds[2,3,1,4],0.0,"ds/ds has wrong value at (2,3,1,4).")  
       self.failUnlessEqual(dsds[2,3,2,0],0.0,"ds/ds has wrong value at (2,3,2,0).")  
       self.failUnlessEqual(dsds[2,3,2,1],0.0,"ds/ds has wrong value at (2,3,2,1).")  
       self.failUnlessEqual(dsds[2,3,2,2],0.0,"ds/ds has wrong value at (2,3,2,2).")  
       self.failUnlessEqual(dsds[2,3,2,3],1.0,"ds/ds has wrong value at (2,3,2,3).")  
       self.failUnlessEqual(dsds[2,3,2,4],0.0,"ds/ds has wrong value at (2,3,2,4).")  
       self.failUnlessEqual(dsds[2,3,3,0],0.0,"ds/ds has wrong value at (2,3,3,0).")  
       self.failUnlessEqual(dsds[2,3,3,1],0.0,"ds/ds has wrong value at (2,3,3,1).")  
       self.failUnlessEqual(dsds[2,3,3,2],0.0,"ds/ds has wrong value at (2,3,3,2).")  
       self.failUnlessEqual(dsds[2,3,3,3],0.0,"ds/ds has wrong value at (2,3,3,3).")  
       self.failUnlessEqual(dsds[2,3,3,4],0.0,"ds/ds has wrong value at (2,3,3,4).")  
       self.failUnlessEqual(dsds[2,4,0,0],0.0,"ds/ds has wrong value at (2,4,0,0).")  
       self.failUnlessEqual(dsds[2,4,0,1],0.0,"ds/ds has wrong value at (2,4,0,1).")  
       self.failUnlessEqual(dsds[2,4,0,2],0.0,"ds/ds has wrong value at (2,4,0,2).")  
       self.failUnlessEqual(dsds[2,4,0,3],0.0,"ds/ds has wrong value at (2,4,0,3).")  
       self.failUnlessEqual(dsds[2,4,0,4],0.0,"ds/ds has wrong value at (2,4,0,4).")  
       self.failUnlessEqual(dsds[2,4,1,0],0.0,"ds/ds has wrong value at (2,4,1,0).")  
       self.failUnlessEqual(dsds[2,4,1,1],0.0,"ds/ds has wrong value at (2,4,1,1).")  
       self.failUnlessEqual(dsds[2,4,1,2],0.0,"ds/ds has wrong value at (2,4,1,2).")  
       self.failUnlessEqual(dsds[2,4,1,3],0.0,"ds/ds has wrong value at (2,4,1,3).")  
       self.failUnlessEqual(dsds[2,4,1,4],0.0,"ds/ds has wrong value at (2,4,1,4).")  
       self.failUnlessEqual(dsds[2,4,2,0],0.0,"ds/ds has wrong value at (2,4,2,0).")  
       self.failUnlessEqual(dsds[2,4,2,1],0.0,"ds/ds has wrong value at (2,4,2,1).")  
       self.failUnlessEqual(dsds[2,4,2,2],0.0,"ds/ds has wrong value at (2,4,2,2).")  
       self.failUnlessEqual(dsds[2,4,2,3],0.0,"ds/ds has wrong value at (2,4,2,3).")  
       self.failUnlessEqual(dsds[2,4,2,4],1.0,"ds/ds has wrong value at (2,4,2,4).")  
       self.failUnlessEqual(dsds[2,4,3,0],0.0,"ds/ds has wrong value at (2,4,3,0).")  
       self.failUnlessEqual(dsds[2,4,3,1],0.0,"ds/ds has wrong value at (2,4,3,1).")  
       self.failUnlessEqual(dsds[2,4,3,2],0.0,"ds/ds has wrong value at (2,4,3,2).")  
       self.failUnlessEqual(dsds[2,4,3,3],0.0,"ds/ds has wrong value at (2,4,3,3).")  
       self.failUnlessEqual(dsds[2,4,3,4],0.0,"ds/ds has wrong value at (2,4,3,4).")  
       self.failUnlessEqual(dsds[3,0,0,0],0.0,"ds/ds has wrong value at (3,0,0,0).")  
       self.failUnlessEqual(dsds[3,0,0,1],0.0,"ds/ds has wrong value at (3,0,0,1).")  
       self.failUnlessEqual(dsds[3,0,0,2],0.0,"ds/ds has wrong value at (3,0,0,2).")  
       self.failUnlessEqual(dsds[3,0,0,3],0.0,"ds/ds has wrong value at (3,0,0,3).")  
       self.failUnlessEqual(dsds[3,0,0,4],0.0,"ds/ds has wrong value at (3,0,0,4).")  
       self.failUnlessEqual(dsds[3,0,1,0],0.0,"ds/ds has wrong value at (3,0,1,0).")  
       self.failUnlessEqual(dsds[3,0,1,1],0.0,"ds/ds has wrong value at (3,0,1,1).")  
       self.failUnlessEqual(dsds[3,0,1,2],0.0,"ds/ds has wrong value at (3,0,1,2).")  
       self.failUnlessEqual(dsds[3,0,1,3],0.0,"ds/ds has wrong value at (3,0,1,3).")  
       self.failUnlessEqual(dsds[3,0,1,4],0.0,"ds/ds has wrong value at (3,0,1,4).")  
       self.failUnlessEqual(dsds[3,0,2,0],0.0,"ds/ds has wrong value at (3,0,2,0).")  
       self.failUnlessEqual(dsds[3,0,2,1],0.0,"ds/ds has wrong value at (3,0,2,1).")  
       self.failUnlessEqual(dsds[3,0,2,2],0.0,"ds/ds has wrong value at (3,0,2,2).")  
       self.failUnlessEqual(dsds[3,0,2,3],0.0,"ds/ds has wrong value at (3,0,2,3).")  
       self.failUnlessEqual(dsds[3,0,2,4],0.0,"ds/ds has wrong value at (3,0,2,4).")  
       self.failUnlessEqual(dsds[3,0,3,0],1.0,"ds/ds has wrong value at (3,0,3,0).")  
       self.failUnlessEqual(dsds[3,0,3,1],0.0,"ds/ds has wrong value at (3,0,3,1).")  
       self.failUnlessEqual(dsds[3,0,3,2],0.0,"ds/ds has wrong value at (3,0,3,2).")  
       self.failUnlessEqual(dsds[3,0,3,3],0.0,"ds/ds has wrong value at (3,0,3,3).")  
       self.failUnlessEqual(dsds[3,0,3,4],0.0,"ds/ds has wrong value at (3,0,3,4).")  
       self.failUnlessEqual(dsds[3,1,0,0],0.0,"ds/ds has wrong value at (3,1,0,0).")  
       self.failUnlessEqual(dsds[3,1,0,1],0.0,"ds/ds has wrong value at (3,1,0,1).")  
       self.failUnlessEqual(dsds[3,1,0,2],0.0,"ds/ds has wrong value at (3,1,0,2).")  
       self.failUnlessEqual(dsds[3,1,0,3],0.0,"ds/ds has wrong value at (3,1,0,3).")  
       self.failUnlessEqual(dsds[3,1,0,4],0.0,"ds/ds has wrong value at (3,1,0,4).")  
       self.failUnlessEqual(dsds[3,1,1,0],0.0,"ds/ds has wrong value at (3,1,1,0).")  
       self.failUnlessEqual(dsds[3,1,1,1],0.0,"ds/ds has wrong value at (3,1,1,1).")  
       self.failUnlessEqual(dsds[3,1,1,2],0.0,"ds/ds has wrong value at (3,1,1,2).")  
       self.failUnlessEqual(dsds[3,1,1,3],0.0,"ds/ds has wrong value at (3,1,1,3).")  
       self.failUnlessEqual(dsds[3,1,1,4],0.0,"ds/ds has wrong value at (3,1,1,4).")  
       self.failUnlessEqual(dsds[3,1,2,0],0.0,"ds/ds has wrong value at (3,1,2,0).")  
       self.failUnlessEqual(dsds[3,1,2,1],0.0,"ds/ds has wrong value at (3,1,2,1).")  
       self.failUnlessEqual(dsds[3,1,2,2],0.0,"ds/ds has wrong value at (3,1,2,2).")  
       self.failUnlessEqual(dsds[3,1,2,3],0.0,"ds/ds has wrong value at (3,1,2,3).")  
       self.failUnlessEqual(dsds[3,1,2,4],0.0,"ds/ds has wrong value at (3,1,2,4).")  
       self.failUnlessEqual(dsds[3,1,3,0],0.0,"ds/ds has wrong value at (3,1,3,0).")  
       self.failUnlessEqual(dsds[3,1,3,1],1.0,"ds/ds has wrong value at (3,1,3,1).")  
       self.failUnlessEqual(dsds[3,1,3,2],0.0,"ds/ds has wrong value at (3,1,3,2).")  
       self.failUnlessEqual(dsds[3,1,3,3],0.0,"ds/ds has wrong value at (3,1,3,3).")  
       self.failUnlessEqual(dsds[3,1,3,4],0.0,"ds/ds has wrong value at (3,1,3,4).")  
       self.failUnlessEqual(dsds[3,2,0,0],0.0,"ds/ds has wrong value at (3,2,0,0).")  
       self.failUnlessEqual(dsds[3,2,0,1],0.0,"ds/ds has wrong value at (3,2,0,1).")  
       self.failUnlessEqual(dsds[3,2,0,2],0.0,"ds/ds has wrong value at (3,2,0,2).")  
       self.failUnlessEqual(dsds[3,2,0,3],0.0,"ds/ds has wrong value at (3,2,0,3).")  
       self.failUnlessEqual(dsds[3,2,0,4],0.0,"ds/ds has wrong value at (3,2,0,4).")  
       self.failUnlessEqual(dsds[3,2,1,0],0.0,"ds/ds has wrong value at (3,2,1,0).")  
       self.failUnlessEqual(dsds[3,2,1,1],0.0,"ds/ds has wrong value at (3,2,1,1).")  
       self.failUnlessEqual(dsds[3,2,1,2],0.0,"ds/ds has wrong value at (3,2,1,2).")  
       self.failUnlessEqual(dsds[3,2,1,3],0.0,"ds/ds has wrong value at (3,2,1,3).")  
       self.failUnlessEqual(dsds[3,2,1,4],0.0,"ds/ds has wrong value at (3,2,1,4).")  
       self.failUnlessEqual(dsds[3,2,2,0],0.0,"ds/ds has wrong value at (3,2,2,0).")  
       self.failUnlessEqual(dsds[3,2,2,1],0.0,"ds/ds has wrong value at (3,2,2,1).")  
       self.failUnlessEqual(dsds[3,2,2,2],0.0,"ds/ds has wrong value at (3,2,2,2).")  
       self.failUnlessEqual(dsds[3,2,2,3],0.0,"ds/ds has wrong value at (3,2,2,3).")  
       self.failUnlessEqual(dsds[3,2,2,4],0.0,"ds/ds has wrong value at (3,2,2,4).")  
       self.failUnlessEqual(dsds[3,2,3,0],0.0,"ds/ds has wrong value at (3,2,3,0).")  
       self.failUnlessEqual(dsds[3,2,3,1],0.0,"ds/ds has wrong value at (3,2,3,1).")  
       self.failUnlessEqual(dsds[3,2,3,2],1.0,"ds/ds has wrong value at (3,2,3,2).")  
       self.failUnlessEqual(dsds[3,2,3,3],0.0,"ds/ds has wrong value at (3,2,3,3).")  
       self.failUnlessEqual(dsds[3,2,3,4],0.0,"ds/ds has wrong value at (3,2,3,4).")  
       self.failUnlessEqual(dsds[3,3,0,0],0.0,"ds/ds has wrong value at (3,3,0,0).")  
       self.failUnlessEqual(dsds[3,3,0,1],0.0,"ds/ds has wrong value at (3,3,0,1).")  
       self.failUnlessEqual(dsds[3,3,0,2],0.0,"ds/ds has wrong value at (3,3,0,2).")  
       self.failUnlessEqual(dsds[3,3,0,3],0.0,"ds/ds has wrong value at (3,3,0,3).")  
       self.failUnlessEqual(dsds[3,3,0,4],0.0,"ds/ds has wrong value at (3,3,0,4).")  
       self.failUnlessEqual(dsds[3,3,1,0],0.0,"ds/ds has wrong value at (3,3,1,0).")  
       self.failUnlessEqual(dsds[3,3,1,1],0.0,"ds/ds has wrong value at (3,3,1,1).")  
       self.failUnlessEqual(dsds[3,3,1,2],0.0,"ds/ds has wrong value at (3,3,1,2).")  
       self.failUnlessEqual(dsds[3,3,1,3],0.0,"ds/ds has wrong value at (3,3,1,3).")  
       self.failUnlessEqual(dsds[3,3,1,4],0.0,"ds/ds has wrong value at (3,3,1,4).")  
       self.failUnlessEqual(dsds[3,3,2,0],0.0,"ds/ds has wrong value at (3,3,2,0).")  
       self.failUnlessEqual(dsds[3,3,2,1],0.0,"ds/ds has wrong value at (3,3,2,1).")  
       self.failUnlessEqual(dsds[3,3,2,2],0.0,"ds/ds has wrong value at (3,3,2,2).")  
       self.failUnlessEqual(dsds[3,3,2,3],0.0,"ds/ds has wrong value at (3,3,2,3).")  
       self.failUnlessEqual(dsds[3,3,2,4],0.0,"ds/ds has wrong value at (3,3,2,4).")  
       self.failUnlessEqual(dsds[3,3,3,0],0.0,"ds/ds has wrong value at (3,3,3,0).")  
       self.failUnlessEqual(dsds[3,3,3,1],0.0,"ds/ds has wrong value at (3,3,3,1).")  
       self.failUnlessEqual(dsds[3,3,3,2],0.0,"ds/ds has wrong value at (3,3,3,2).")  
       self.failUnlessEqual(dsds[3,3,3,3],1.0,"ds/ds has wrong value at (3,3,3,3).")  
       self.failUnlessEqual(dsds[3,3,3,4],0.0,"ds/ds has wrong value at (3,3,3,4).")  
       self.failUnlessEqual(dsds[3,4,0,0],0.0,"ds/ds has wrong value at (3,4,0,0).")  
       self.failUnlessEqual(dsds[3,4,0,1],0.0,"ds/ds has wrong value at (3,4,0,1).")  
       self.failUnlessEqual(dsds[3,4,0,2],0.0,"ds/ds has wrong value at (3,4,0,2).")  
       self.failUnlessEqual(dsds[3,4,0,3],0.0,"ds/ds has wrong value at (3,4,0,3).")  
       self.failUnlessEqual(dsds[3,4,0,4],0.0,"ds/ds has wrong value at (3,4,0,4).")  
       self.failUnlessEqual(dsds[3,4,1,0],0.0,"ds/ds has wrong value at (3,4,1,0).")  
       self.failUnlessEqual(dsds[3,4,1,1],0.0,"ds/ds has wrong value at (3,4,1,1).")  
       self.failUnlessEqual(dsds[3,4,1,2],0.0,"ds/ds has wrong value at (3,4,1,2).")  
       self.failUnlessEqual(dsds[3,4,1,3],0.0,"ds/ds has wrong value at (3,4,1,3).")  
       self.failUnlessEqual(dsds[3,4,1,4],0.0,"ds/ds has wrong value at (3,4,1,4).")  
       self.failUnlessEqual(dsds[3,4,2,0],0.0,"ds/ds has wrong value at (3,4,2,0).")  
       self.failUnlessEqual(dsds[3,4,2,1],0.0,"ds/ds has wrong value at (3,4,2,1).")  
       self.failUnlessEqual(dsds[3,4,2,2],0.0,"ds/ds has wrong value at (3,4,2,2).")  
       self.failUnlessEqual(dsds[3,4,2,3],0.0,"ds/ds has wrong value at (3,4,2,3).")  
       self.failUnlessEqual(dsds[3,4,2,4],0.0,"ds/ds has wrong value at (3,4,2,4).")  
       self.failUnlessEqual(dsds[3,4,3,0],0.0,"ds/ds has wrong value at (3,4,3,0).")  
       self.failUnlessEqual(dsds[3,4,3,1],0.0,"ds/ds has wrong value at (3,4,3,1).")  
       self.failUnlessEqual(dsds[3,4,3,2],0.0,"ds/ds has wrong value at (3,4,3,2).")  
       self.failUnlessEqual(dsds[3,4,3,3],0.0,"ds/ds has wrong value at (3,4,3,3).")  
       self.failUnlessEqual(dsds[3,4,3,4],1.0,"ds/ds has wrong value at (3,4,3,4).")  
   
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),0,"wrong number of substituted arguments")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(4, 5),dim=self.functionspace.getDim())),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(escript.Data(0.,(4, 5),self.functionspace)),"Data is appropriate substitute")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((4, 5))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank2_dd_nargs1(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(4, 5),dim=self.functionspace.getDim(),args=[s2])  
       self.failUnlessEqual(s.getRank(),2,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(4, 5),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),self.functionspace.getDim(),"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[s2],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((4, 5))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(4, 5),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(4, 5, 4, 5),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0,0,0],1.0,"ds/ds has wrong value at (0,0,0,0).")  
       self.failUnlessEqual(dsds[0,0,0,1],0.0,"ds/ds has wrong value at (0,0,0,1).")  
       self.failUnlessEqual(dsds[0,0,0,2],0.0,"ds/ds has wrong value at (0,0,0,2).")  
       self.failUnlessEqual(dsds[0,0,0,3],0.0,"ds/ds has wrong value at (0,0,0,3).")  
       self.failUnlessEqual(dsds[0,0,0,4],0.0,"ds/ds has wrong value at (0,0,0,4).")  
       self.failUnlessEqual(dsds[0,0,1,0],0.0,"ds/ds has wrong value at (0,0,1,0).")  
       self.failUnlessEqual(dsds[0,0,1,1],0.0,"ds/ds has wrong value at (0,0,1,1).")  
       self.failUnlessEqual(dsds[0,0,1,2],0.0,"ds/ds has wrong value at (0,0,1,2).")  
       self.failUnlessEqual(dsds[0,0,1,3],0.0,"ds/ds has wrong value at (0,0,1,3).")  
       self.failUnlessEqual(dsds[0,0,1,4],0.0,"ds/ds has wrong value at (0,0,1,4).")  
       self.failUnlessEqual(dsds[0,0,2,0],0.0,"ds/ds has wrong value at (0,0,2,0).")  
       self.failUnlessEqual(dsds[0,0,2,1],0.0,"ds/ds has wrong value at (0,0,2,1).")  
       self.failUnlessEqual(dsds[0,0,2,2],0.0,"ds/ds has wrong value at (0,0,2,2).")  
       self.failUnlessEqual(dsds[0,0,2,3],0.0,"ds/ds has wrong value at (0,0,2,3).")  
       self.failUnlessEqual(dsds[0,0,2,4],0.0,"ds/ds has wrong value at (0,0,2,4).")  
       self.failUnlessEqual(dsds[0,0,3,0],0.0,"ds/ds has wrong value at (0,0,3,0).")  
       self.failUnlessEqual(dsds[0,0,3,1],0.0,"ds/ds has wrong value at (0,0,3,1).")  
       self.failUnlessEqual(dsds[0,0,3,2],0.0,"ds/ds has wrong value at (0,0,3,2).")  
       self.failUnlessEqual(dsds[0,0,3,3],0.0,"ds/ds has wrong value at (0,0,3,3).")  
       self.failUnlessEqual(dsds[0,0,3,4],0.0,"ds/ds has wrong value at (0,0,3,4).")  
       self.failUnlessEqual(dsds[0,1,0,0],0.0,"ds/ds has wrong value at (0,1,0,0).")  
       self.failUnlessEqual(dsds[0,1,0,1],1.0,"ds/ds has wrong value at (0,1,0,1).")  
       self.failUnlessEqual(dsds[0,1,0,2],0.0,"ds/ds has wrong value at (0,1,0,2).")  
       self.failUnlessEqual(dsds[0,1,0,3],0.0,"ds/ds has wrong value at (0,1,0,3).")  
       self.failUnlessEqual(dsds[0,1,0,4],0.0,"ds/ds has wrong value at (0,1,0,4).")  
       self.failUnlessEqual(dsds[0,1,1,0],0.0,"ds/ds has wrong value at (0,1,1,0).")  
       self.failUnlessEqual(dsds[0,1,1,1],0.0,"ds/ds has wrong value at (0,1,1,1).")  
       self.failUnlessEqual(dsds[0,1,1,2],0.0,"ds/ds has wrong value at (0,1,1,2).")  
       self.failUnlessEqual(dsds[0,1,1,3],0.0,"ds/ds has wrong value at (0,1,1,3).")  
       self.failUnlessEqual(dsds[0,1,1,4],0.0,"ds/ds has wrong value at (0,1,1,4).")  
       self.failUnlessEqual(dsds[0,1,2,0],0.0,"ds/ds has wrong value at (0,1,2,0).")  
       self.failUnlessEqual(dsds[0,1,2,1],0.0,"ds/ds has wrong value at (0,1,2,1).")  
       self.failUnlessEqual(dsds[0,1,2,2],0.0,"ds/ds has wrong value at (0,1,2,2).")  
       self.failUnlessEqual(dsds[0,1,2,3],0.0,"ds/ds has wrong value at (0,1,2,3).")  
       self.failUnlessEqual(dsds[0,1,2,4],0.0,"ds/ds has wrong value at (0,1,2,4).")  
       self.failUnlessEqual(dsds[0,1,3,0],0.0,"ds/ds has wrong value at (0,1,3,0).")  
       self.failUnlessEqual(dsds[0,1,3,1],0.0,"ds/ds has wrong value at (0,1,3,1).")  
       self.failUnlessEqual(dsds[0,1,3,2],0.0,"ds/ds has wrong value at (0,1,3,2).")  
       self.failUnlessEqual(dsds[0,1,3,3],0.0,"ds/ds has wrong value at (0,1,3,3).")  
       self.failUnlessEqual(dsds[0,1,3,4],0.0,"ds/ds has wrong value at (0,1,3,4).")  
       self.failUnlessEqual(dsds[0,2,0,0],0.0,"ds/ds has wrong value at (0,2,0,0).")  
       self.failUnlessEqual(dsds[0,2,0,1],0.0,"ds/ds has wrong value at (0,2,0,1).")  
       self.failUnlessEqual(dsds[0,2,0,2],1.0,"ds/ds has wrong value at (0,2,0,2).")  
       self.failUnlessEqual(dsds[0,2,0,3],0.0,"ds/ds has wrong value at (0,2,0,3).")  
       self.failUnlessEqual(dsds[0,2,0,4],0.0,"ds/ds has wrong value at (0,2,0,4).")  
       self.failUnlessEqual(dsds[0,2,1,0],0.0,"ds/ds has wrong value at (0,2,1,0).")  
       self.failUnlessEqual(dsds[0,2,1,1],0.0,"ds/ds has wrong value at (0,2,1,1).")  
       self.failUnlessEqual(dsds[0,2,1,2],0.0,"ds/ds has wrong value at (0,2,1,2).")  
       self.failUnlessEqual(dsds[0,2,1,3],0.0,"ds/ds has wrong value at (0,2,1,3).")  
       self.failUnlessEqual(dsds[0,2,1,4],0.0,"ds/ds has wrong value at (0,2,1,4).")  
       self.failUnlessEqual(dsds[0,2,2,0],0.0,"ds/ds has wrong value at (0,2,2,0).")  
       self.failUnlessEqual(dsds[0,2,2,1],0.0,"ds/ds has wrong value at (0,2,2,1).")  
       self.failUnlessEqual(dsds[0,2,2,2],0.0,"ds/ds has wrong value at (0,2,2,2).")  
       self.failUnlessEqual(dsds[0,2,2,3],0.0,"ds/ds has wrong value at (0,2,2,3).")  
       self.failUnlessEqual(dsds[0,2,2,4],0.0,"ds/ds has wrong value at (0,2,2,4).")  
       self.failUnlessEqual(dsds[0,2,3,0],0.0,"ds/ds has wrong value at (0,2,3,0).")  
       self.failUnlessEqual(dsds[0,2,3,1],0.0,"ds/ds has wrong value at (0,2,3,1).")  
       self.failUnlessEqual(dsds[0,2,3,2],0.0,"ds/ds has wrong value at (0,2,3,2).")  
       self.failUnlessEqual(dsds[0,2,3,3],0.0,"ds/ds has wrong value at (0,2,3,3).")  
       self.failUnlessEqual(dsds[0,2,3,4],0.0,"ds/ds has wrong value at (0,2,3,4).")  
       self.failUnlessEqual(dsds[0,3,0,0],0.0,"ds/ds has wrong value at (0,3,0,0).")  
       self.failUnlessEqual(dsds[0,3,0,1],0.0,"ds/ds has wrong value at (0,3,0,1).")  
       self.failUnlessEqual(dsds[0,3,0,2],0.0,"ds/ds has wrong value at (0,3,0,2).")  
       self.failUnlessEqual(dsds[0,3,0,3],1.0,"ds/ds has wrong value at (0,3,0,3).")  
       self.failUnlessEqual(dsds[0,3,0,4],0.0,"ds/ds has wrong value at (0,3,0,4).")  
       self.failUnlessEqual(dsds[0,3,1,0],0.0,"ds/ds has wrong value at (0,3,1,0).")  
       self.failUnlessEqual(dsds[0,3,1,1],0.0,"ds/ds has wrong value at (0,3,1,1).")  
       self.failUnlessEqual(dsds[0,3,1,2],0.0,"ds/ds has wrong value at (0,3,1,2).")  
       self.failUnlessEqual(dsds[0,3,1,3],0.0,"ds/ds has wrong value at (0,3,1,3).")  
       self.failUnlessEqual(dsds[0,3,1,4],0.0,"ds/ds has wrong value at (0,3,1,4).")  
       self.failUnlessEqual(dsds[0,3,2,0],0.0,"ds/ds has wrong value at (0,3,2,0).")  
       self.failUnlessEqual(dsds[0,3,2,1],0.0,"ds/ds has wrong value at (0,3,2,1).")  
       self.failUnlessEqual(dsds[0,3,2,2],0.0,"ds/ds has wrong value at (0,3,2,2).")  
       self.failUnlessEqual(dsds[0,3,2,3],0.0,"ds/ds has wrong value at (0,3,2,3).")  
       self.failUnlessEqual(dsds[0,3,2,4],0.0,"ds/ds has wrong value at (0,3,2,4).")  
       self.failUnlessEqual(dsds[0,3,3,0],0.0,"ds/ds has wrong value at (0,3,3,0).")  
       self.failUnlessEqual(dsds[0,3,3,1],0.0,"ds/ds has wrong value at (0,3,3,1).")  
       self.failUnlessEqual(dsds[0,3,3,2],0.0,"ds/ds has wrong value at (0,3,3,2).")  
       self.failUnlessEqual(dsds[0,3,3,3],0.0,"ds/ds has wrong value at (0,3,3,3).")  
       self.failUnlessEqual(dsds[0,3,3,4],0.0,"ds/ds has wrong value at (0,3,3,4).")  
       self.failUnlessEqual(dsds[0,4,0,0],0.0,"ds/ds has wrong value at (0,4,0,0).")  
       self.failUnlessEqual(dsds[0,4,0,1],0.0,"ds/ds has wrong value at (0,4,0,1).")  
       self.failUnlessEqual(dsds[0,4,0,2],0.0,"ds/ds has wrong value at (0,4,0,2).")  
       self.failUnlessEqual(dsds[0,4,0,3],0.0,"ds/ds has wrong value at (0,4,0,3).")  
       self.failUnlessEqual(dsds[0,4,0,4],1.0,"ds/ds has wrong value at (0,4,0,4).")  
       self.failUnlessEqual(dsds[0,4,1,0],0.0,"ds/ds has wrong value at (0,4,1,0).")  
       self.failUnlessEqual(dsds[0,4,1,1],0.0,"ds/ds has wrong value at (0,4,1,1).")  
       self.failUnlessEqual(dsds[0,4,1,2],0.0,"ds/ds has wrong value at (0,4,1,2).")  
       self.failUnlessEqual(dsds[0,4,1,3],0.0,"ds/ds has wrong value at (0,4,1,3).")  
       self.failUnlessEqual(dsds[0,4,1,4],0.0,"ds/ds has wrong value at (0,4,1,4).")  
       self.failUnlessEqual(dsds[0,4,2,0],0.0,"ds/ds has wrong value at (0,4,2,0).")  
       self.failUnlessEqual(dsds[0,4,2,1],0.0,"ds/ds has wrong value at (0,4,2,1).")  
       self.failUnlessEqual(dsds[0,4,2,2],0.0,"ds/ds has wrong value at (0,4,2,2).")  
       self.failUnlessEqual(dsds[0,4,2,3],0.0,"ds/ds has wrong value at (0,4,2,3).")  
       self.failUnlessEqual(dsds[0,4,2,4],0.0,"ds/ds has wrong value at (0,4,2,4).")  
       self.failUnlessEqual(dsds[0,4,3,0],0.0,"ds/ds has wrong value at (0,4,3,0).")  
       self.failUnlessEqual(dsds[0,4,3,1],0.0,"ds/ds has wrong value at (0,4,3,1).")  
       self.failUnlessEqual(dsds[0,4,3,2],0.0,"ds/ds has wrong value at (0,4,3,2).")  
       self.failUnlessEqual(dsds[0,4,3,3],0.0,"ds/ds has wrong value at (0,4,3,3).")  
       self.failUnlessEqual(dsds[0,4,3,4],0.0,"ds/ds has wrong value at (0,4,3,4).")  
       self.failUnlessEqual(dsds[1,0,0,0],0.0,"ds/ds has wrong value at (1,0,0,0).")  
       self.failUnlessEqual(dsds[1,0,0,1],0.0,"ds/ds has wrong value at (1,0,0,1).")  
       self.failUnlessEqual(dsds[1,0,0,2],0.0,"ds/ds has wrong value at (1,0,0,2).")  
       self.failUnlessEqual(dsds[1,0,0,3],0.0,"ds/ds has wrong value at (1,0,0,3).")  
       self.failUnlessEqual(dsds[1,0,0,4],0.0,"ds/ds has wrong value at (1,0,0,4).")  
       self.failUnlessEqual(dsds[1,0,1,0],1.0,"ds/ds has wrong value at (1,0,1,0).")  
       self.failUnlessEqual(dsds[1,0,1,1],0.0,"ds/ds has wrong value at (1,0,1,1).")  
       self.failUnlessEqual(dsds[1,0,1,2],0.0,"ds/ds has wrong value at (1,0,1,2).")  
       self.failUnlessEqual(dsds[1,0,1,3],0.0,"ds/ds has wrong value at (1,0,1,3).")  
       self.failUnlessEqual(dsds[1,0,1,4],0.0,"ds/ds has wrong value at (1,0,1,4).")  
       self.failUnlessEqual(dsds[1,0,2,0],0.0,"ds/ds has wrong value at (1,0,2,0).")  
       self.failUnlessEqual(dsds[1,0,2,1],0.0,"ds/ds has wrong value at (1,0,2,1).")  
       self.failUnlessEqual(dsds[1,0,2,2],0.0,"ds/ds has wrong value at (1,0,2,2).")  
       self.failUnlessEqual(dsds[1,0,2,3],0.0,"ds/ds has wrong value at (1,0,2,3).")  
       self.failUnlessEqual(dsds[1,0,2,4],0.0,"ds/ds has wrong value at (1,0,2,4).")  
       self.failUnlessEqual(dsds[1,0,3,0],0.0,"ds/ds has wrong value at (1,0,3,0).")  
       self.failUnlessEqual(dsds[1,0,3,1],0.0,"ds/ds has wrong value at (1,0,3,1).")  
       self.failUnlessEqual(dsds[1,0,3,2],0.0,"ds/ds has wrong value at (1,0,3,2).")  
       self.failUnlessEqual(dsds[1,0,3,3],0.0,"ds/ds has wrong value at (1,0,3,3).")  
       self.failUnlessEqual(dsds[1,0,3,4],0.0,"ds/ds has wrong value at (1,0,3,4).")  
       self.failUnlessEqual(dsds[1,1,0,0],0.0,"ds/ds has wrong value at (1,1,0,0).")  
       self.failUnlessEqual(dsds[1,1,0,1],0.0,"ds/ds has wrong value at (1,1,0,1).")  
       self.failUnlessEqual(dsds[1,1,0,2],0.0,"ds/ds has wrong value at (1,1,0,2).")  
       self.failUnlessEqual(dsds[1,1,0,3],0.0,"ds/ds has wrong value at (1,1,0,3).")  
       self.failUnlessEqual(dsds[1,1,0,4],0.0,"ds/ds has wrong value at (1,1,0,4).")  
       self.failUnlessEqual(dsds[1,1,1,0],0.0,"ds/ds has wrong value at (1,1,1,0).")  
       self.failUnlessEqual(dsds[1,1,1,1],1.0,"ds/ds has wrong value at (1,1,1,1).")  
       self.failUnlessEqual(dsds[1,1,1,2],0.0,"ds/ds has wrong value at (1,1,1,2).")  
       self.failUnlessEqual(dsds[1,1,1,3],0.0,"ds/ds has wrong value at (1,1,1,3).")  
       self.failUnlessEqual(dsds[1,1,1,4],0.0,"ds/ds has wrong value at (1,1,1,4).")  
       self.failUnlessEqual(dsds[1,1,2,0],0.0,"ds/ds has wrong value at (1,1,2,0).")  
       self.failUnlessEqual(dsds[1,1,2,1],0.0,"ds/ds has wrong value at (1,1,2,1).")  
       self.failUnlessEqual(dsds[1,1,2,2],0.0,"ds/ds has wrong value at (1,1,2,2).")  
       self.failUnlessEqual(dsds[1,1,2,3],0.0,"ds/ds has wrong value at (1,1,2,3).")  
       self.failUnlessEqual(dsds[1,1,2,4],0.0,"ds/ds has wrong value at (1,1,2,4).")  
       self.failUnlessEqual(dsds[1,1,3,0],0.0,"ds/ds has wrong value at (1,1,3,0).")  
       self.failUnlessEqual(dsds[1,1,3,1],0.0,"ds/ds has wrong value at (1,1,3,1).")  
       self.failUnlessEqual(dsds[1,1,3,2],0.0,"ds/ds has wrong value at (1,1,3,2).")  
       self.failUnlessEqual(dsds[1,1,3,3],0.0,"ds/ds has wrong value at (1,1,3,3).")  
       self.failUnlessEqual(dsds[1,1,3,4],0.0,"ds/ds has wrong value at (1,1,3,4).")  
       self.failUnlessEqual(dsds[1,2,0,0],0.0,"ds/ds has wrong value at (1,2,0,0).")  
       self.failUnlessEqual(dsds[1,2,0,1],0.0,"ds/ds has wrong value at (1,2,0,1).")  
       self.failUnlessEqual(dsds[1,2,0,2],0.0,"ds/ds has wrong value at (1,2,0,2).")  
       self.failUnlessEqual(dsds[1,2,0,3],0.0,"ds/ds has wrong value at (1,2,0,3).")  
       self.failUnlessEqual(dsds[1,2,0,4],0.0,"ds/ds has wrong value at (1,2,0,4).")  
       self.failUnlessEqual(dsds[1,2,1,0],0.0,"ds/ds has wrong value at (1,2,1,0).")  
       self.failUnlessEqual(dsds[1,2,1,1],0.0,"ds/ds has wrong value at (1,2,1,1).")  
       self.failUnlessEqual(dsds[1,2,1,2],1.0,"ds/ds has wrong value at (1,2,1,2).")  
       self.failUnlessEqual(dsds[1,2,1,3],0.0,"ds/ds has wrong value at (1,2,1,3).")  
       self.failUnlessEqual(dsds[1,2,1,4],0.0,"ds/ds has wrong value at (1,2,1,4).")  
       self.failUnlessEqual(dsds[1,2,2,0],0.0,"ds/ds has wrong value at (1,2,2,0).")  
       self.failUnlessEqual(dsds[1,2,2,1],0.0,"ds/ds has wrong value at (1,2,2,1).")  
       self.failUnlessEqual(dsds[1,2,2,2],0.0,"ds/ds has wrong value at (1,2,2,2).")  
       self.failUnlessEqual(dsds[1,2,2,3],0.0,"ds/ds has wrong value at (1,2,2,3).")  
       self.failUnlessEqual(dsds[1,2,2,4],0.0,"ds/ds has wrong value at (1,2,2,4).")  
       self.failUnlessEqual(dsds[1,2,3,0],0.0,"ds/ds has wrong value at (1,2,3,0).")  
       self.failUnlessEqual(dsds[1,2,3,1],0.0,"ds/ds has wrong value at (1,2,3,1).")  
       self.failUnlessEqual(dsds[1,2,3,2],0.0,"ds/ds has wrong value at (1,2,3,2).")  
       self.failUnlessEqual(dsds[1,2,3,3],0.0,"ds/ds has wrong value at (1,2,3,3).")  
       self.failUnlessEqual(dsds[1,2,3,4],0.0,"ds/ds has wrong value at (1,2,3,4).")  
       self.failUnlessEqual(dsds[1,3,0,0],0.0,"ds/ds has wrong value at (1,3,0,0).")  
       self.failUnlessEqual(dsds[1,3,0,1],0.0,"ds/ds has wrong value at (1,3,0,1).")  
       self.failUnlessEqual(dsds[1,3,0,2],0.0,"ds/ds has wrong value at (1,3,0,2).")  
       self.failUnlessEqual(dsds[1,3,0,3],0.0,"ds/ds has wrong value at (1,3,0,3).")  
       self.failUnlessEqual(dsds[1,3,0,4],0.0,"ds/ds has wrong value at (1,3,0,4).")  
       self.failUnlessEqual(dsds[1,3,1,0],0.0,"ds/ds has wrong value at (1,3,1,0).")  
       self.failUnlessEqual(dsds[1,3,1,1],0.0,"ds/ds has wrong value at (1,3,1,1).")  
       self.failUnlessEqual(dsds[1,3,1,2],0.0,"ds/ds has wrong value at (1,3,1,2).")  
       self.failUnlessEqual(dsds[1,3,1,3],1.0,"ds/ds has wrong value at (1,3,1,3).")  
       self.failUnlessEqual(dsds[1,3,1,4],0.0,"ds/ds has wrong value at (1,3,1,4).")  
       self.failUnlessEqual(dsds[1,3,2,0],0.0,"ds/ds has wrong value at (1,3,2,0).")  
       self.failUnlessEqual(dsds[1,3,2,1],0.0,"ds/ds has wrong value at (1,3,2,1).")  
       self.failUnlessEqual(dsds[1,3,2,2],0.0,"ds/ds has wrong value at (1,3,2,2).")  
       self.failUnlessEqual(dsds[1,3,2,3],0.0,"ds/ds has wrong value at (1,3,2,3).")  
       self.failUnlessEqual(dsds[1,3,2,4],0.0,"ds/ds has wrong value at (1,3,2,4).")  
       self.failUnlessEqual(dsds[1,3,3,0],0.0,"ds/ds has wrong value at (1,3,3,0).")  
       self.failUnlessEqual(dsds[1,3,3,1],0.0,"ds/ds has wrong value at (1,3,3,1).")  
       self.failUnlessEqual(dsds[1,3,3,2],0.0,"ds/ds has wrong value at (1,3,3,2).")  
       self.failUnlessEqual(dsds[1,3,3,3],0.0,"ds/ds has wrong value at (1,3,3,3).")  
       self.failUnlessEqual(dsds[1,3,3,4],0.0,"ds/ds has wrong value at (1,3,3,4).")  
       self.failUnlessEqual(dsds[1,4,0,0],0.0,"ds/ds has wrong value at (1,4,0,0).")  
       self.failUnlessEqual(dsds[1,4,0,1],0.0,"ds/ds has wrong value at (1,4,0,1).")  
       self.failUnlessEqual(dsds[1,4,0,2],0.0,"ds/ds has wrong value at (1,4,0,2).")  
       self.failUnlessEqual(dsds[1,4,0,3],0.0,"ds/ds has wrong value at (1,4,0,3).")  
       self.failUnlessEqual(dsds[1,4,0,4],0.0,"ds/ds has wrong value at (1,4,0,4).")  
       self.failUnlessEqual(dsds[1,4,1,0],0.0,"ds/ds has wrong value at (1,4,1,0).")  
       self.failUnlessEqual(dsds[1,4,1,1],0.0,"ds/ds has wrong value at (1,4,1,1).")  
       self.failUnlessEqual(dsds[1,4,1,2],0.0,"ds/ds has wrong value at (1,4,1,2).")  
       self.failUnlessEqual(dsds[1,4,1,3],0.0,"ds/ds has wrong value at (1,4,1,3).")  
       self.failUnlessEqual(dsds[1,4,1,4],1.0,"ds/ds has wrong value at (1,4,1,4).")  
       self.failUnlessEqual(dsds[1,4,2,0],0.0,"ds/ds has wrong value at (1,4,2,0).")  
       self.failUnlessEqual(dsds[1,4,2,1],0.0,"ds/ds has wrong value at (1,4,2,1).")  
       self.failUnlessEqual(dsds[1,4,2,2],0.0,"ds/ds has wrong value at (1,4,2,2).")  
       self.failUnlessEqual(dsds[1,4,2,3],0.0,"ds/ds has wrong value at (1,4,2,3).")  
       self.failUnlessEqual(dsds[1,4,2,4],0.0,"ds/ds has wrong value at (1,4,2,4).")  
       self.failUnlessEqual(dsds[1,4,3,0],0.0,"ds/ds has wrong value at (1,4,3,0).")  
       self.failUnlessEqual(dsds[1,4,3,1],0.0,"ds/ds has wrong value at (1,4,3,1).")  
       self.failUnlessEqual(dsds[1,4,3,2],0.0,"ds/ds has wrong value at (1,4,3,2).")  
       self.failUnlessEqual(dsds[1,4,3,3],0.0,"ds/ds has wrong value at (1,4,3,3).")  
       self.failUnlessEqual(dsds[1,4,3,4],0.0,"ds/ds has wrong value at (1,4,3,4).")  
       self.failUnlessEqual(dsds[2,0,0,0],0.0,"ds/ds has wrong value at (2,0,0,0).")  
       self.failUnlessEqual(dsds[2,0,0,1],0.0,"ds/ds has wrong value at (2,0,0,1).")  
       self.failUnlessEqual(dsds[2,0,0,2],0.0,"ds/ds has wrong value at (2,0,0,2).")  
       self.failUnlessEqual(dsds[2,0,0,3],0.0,"ds/ds has wrong value at (2,0,0,3).")  
       self.failUnlessEqual(dsds[2,0,0,4],0.0,"ds/ds has wrong value at (2,0,0,4).")  
       self.failUnlessEqual(dsds[2,0,1,0],0.0,"ds/ds has wrong value at (2,0,1,0).")  
       self.failUnlessEqual(dsds[2,0,1,1],0.0,"ds/ds has wrong value at (2,0,1,1).")  
       self.failUnlessEqual(dsds[2,0,1,2],0.0,"ds/ds has wrong value at (2,0,1,2).")  
       self.failUnlessEqual(dsds[2,0,1,3],0.0,"ds/ds has wrong value at (2,0,1,3).")  
       self.failUnlessEqual(dsds[2,0,1,4],0.0,"ds/ds has wrong value at (2,0,1,4).")  
       self.failUnlessEqual(dsds[2,0,2,0],1.0,"ds/ds has wrong value at (2,0,2,0).")  
       self.failUnlessEqual(dsds[2,0,2,1],0.0,"ds/ds has wrong value at (2,0,2,1).")  
       self.failUnlessEqual(dsds[2,0,2,2],0.0,"ds/ds has wrong value at (2,0,2,2).")  
       self.failUnlessEqual(dsds[2,0,2,3],0.0,"ds/ds has wrong value at (2,0,2,3).")  
       self.failUnlessEqual(dsds[2,0,2,4],0.0,"ds/ds has wrong value at (2,0,2,4).")  
       self.failUnlessEqual(dsds[2,0,3,0],0.0,"ds/ds has wrong value at (2,0,3,0).")  
       self.failUnlessEqual(dsds[2,0,3,1],0.0,"ds/ds has wrong value at (2,0,3,1).")  
       self.failUnlessEqual(dsds[2,0,3,2],0.0,"ds/ds has wrong value at (2,0,3,2).")  
       self.failUnlessEqual(dsds[2,0,3,3],0.0,"ds/ds has wrong value at (2,0,3,3).")  
       self.failUnlessEqual(dsds[2,0,3,4],0.0,"ds/ds has wrong value at (2,0,3,4).")  
       self.failUnlessEqual(dsds[2,1,0,0],0.0,"ds/ds has wrong value at (2,1,0,0).")  
       self.failUnlessEqual(dsds[2,1,0,1],0.0,"ds/ds has wrong value at (2,1,0,1).")  
       self.failUnlessEqual(dsds[2,1,0,2],0.0,"ds/ds has wrong value at (2,1,0,2).")  
       self.failUnlessEqual(dsds[2,1,0,3],0.0,"ds/ds has wrong value at (2,1,0,3).")  
       self.failUnlessEqual(dsds[2,1,0,4],0.0,"ds/ds has wrong value at (2,1,0,4).")  
       self.failUnlessEqual(dsds[2,1,1,0],0.0,"ds/ds has wrong value at (2,1,1,0).")  
       self.failUnlessEqual(dsds[2,1,1,1],0.0,"ds/ds has wrong value at (2,1,1,1).")  
       self.failUnlessEqual(dsds[2,1,1,2],0.0,"ds/ds has wrong value at (2,1,1,2).")  
       self.failUnlessEqual(dsds[2,1,1,3],0.0,"ds/ds has wrong value at (2,1,1,3).")  
       self.failUnlessEqual(dsds[2,1,1,4],0.0,"ds/ds has wrong value at (2,1,1,4).")  
       self.failUnlessEqual(dsds[2,1,2,0],0.0,"ds/ds has wrong value at (2,1,2,0).")  
       self.failUnlessEqual(dsds[2,1,2,1],1.0,"ds/ds has wrong value at (2,1,2,1).")  
       self.failUnlessEqual(dsds[2,1,2,2],0.0,"ds/ds has wrong value at (2,1,2,2).")  
       self.failUnlessEqual(dsds[2,1,2,3],0.0,"ds/ds has wrong value at (2,1,2,3).")  
       self.failUnlessEqual(dsds[2,1,2,4],0.0,"ds/ds has wrong value at (2,1,2,4).")  
       self.failUnlessEqual(dsds[2,1,3,0],0.0,"ds/ds has wrong value at (2,1,3,0).")  
       self.failUnlessEqual(dsds[2,1,3,1],0.0,"ds/ds has wrong value at (2,1,3,1).")  
       self.failUnlessEqual(dsds[2,1,3,2],0.0,"ds/ds has wrong value at (2,1,3,2).")  
       self.failUnlessEqual(dsds[2,1,3,3],0.0,"ds/ds has wrong value at (2,1,3,3).")  
       self.failUnlessEqual(dsds[2,1,3,4],0.0,"ds/ds has wrong value at (2,1,3,4).")  
       self.failUnlessEqual(dsds[2,2,0,0],0.0,"ds/ds has wrong value at (2,2,0,0).")  
       self.failUnlessEqual(dsds[2,2,0,1],0.0,"ds/ds has wrong value at (2,2,0,1).")  
       self.failUnlessEqual(dsds[2,2,0,2],0.0,"ds/ds has wrong value at (2,2,0,2).")  
       self.failUnlessEqual(dsds[2,2,0,3],0.0,"ds/ds has wrong value at (2,2,0,3).")  
       self.failUnlessEqual(dsds[2,2,0,4],0.0,"ds/ds has wrong value at (2,2,0,4).")  
       self.failUnlessEqual(dsds[2,2,1,0],0.0,"ds/ds has wrong value at (2,2,1,0).")  
       self.failUnlessEqual(dsds[2,2,1,1],0.0,"ds/ds has wrong value at (2,2,1,1).")  
       self.failUnlessEqual(dsds[2,2,1,2],0.0,"ds/ds has wrong value at (2,2,1,2).")  
       self.failUnlessEqual(dsds[2,2,1,3],0.0,"ds/ds has wrong value at (2,2,1,3).")  
       self.failUnlessEqual(dsds[2,2,1,4],0.0,"ds/ds has wrong value at (2,2,1,4).")  
       self.failUnlessEqual(dsds[2,2,2,0],0.0,"ds/ds has wrong value at (2,2,2,0).")  
       self.failUnlessEqual(dsds[2,2,2,1],0.0,"ds/ds has wrong value at (2,2,2,1).")  
       self.failUnlessEqual(dsds[2,2,2,2],1.0,"ds/ds has wrong value at (2,2,2,2).")  
       self.failUnlessEqual(dsds[2,2,2,3],0.0,"ds/ds has wrong value at (2,2,2,3).")  
       self.failUnlessEqual(dsds[2,2,2,4],0.0,"ds/ds has wrong value at (2,2,2,4).")  
       self.failUnlessEqual(dsds[2,2,3,0],0.0,"ds/ds has wrong value at (2,2,3,0).")  
       self.failUnlessEqual(dsds[2,2,3,1],0.0,"ds/ds has wrong value at (2,2,3,1).")  
       self.failUnlessEqual(dsds[2,2,3,2],0.0,"ds/ds has wrong value at (2,2,3,2).")  
       self.failUnlessEqual(dsds[2,2,3,3],0.0,"ds/ds has wrong value at (2,2,3,3).")  
       self.failUnlessEqual(dsds[2,2,3,4],0.0,"ds/ds has wrong value at (2,2,3,4).")  
       self.failUnlessEqual(dsds[2,3,0,0],0.0,"ds/ds has wrong value at (2,3,0,0).")  
       self.failUnlessEqual(dsds[2,3,0,1],0.0,"ds/ds has wrong value at (2,3,0,1).")  
       self.failUnlessEqual(dsds[2,3,0,2],0.0,"ds/ds has wrong value at (2,3,0,2).")  
       self.failUnlessEqual(dsds[2,3,0,3],0.0,"ds/ds has wrong value at (2,3,0,3).")  
       self.failUnlessEqual(dsds[2,3,0,4],0.0,"ds/ds has wrong value at (2,3,0,4).")  
       self.failUnlessEqual(dsds[2,3,1,0],0.0,"ds/ds has wrong value at (2,3,1,0).")  
       self.failUnlessEqual(dsds[2,3,1,1],0.0,"ds/ds has wrong value at (2,3,1,1).")  
       self.failUnlessEqual(dsds[2,3,1,2],0.0,"ds/ds has wrong value at (2,3,1,2).")  
       self.failUnlessEqual(dsds[2,3,1,3],0.0,"ds/ds has wrong value at (2,3,1,3).")  
       self.failUnlessEqual(dsds[2,3,1,4],0.0,"ds/ds has wrong value at (2,3,1,4).")  
       self.failUnlessEqual(dsds[2,3,2,0],0.0,"ds/ds has wrong value at (2,3,2,0).")  
       self.failUnlessEqual(dsds[2,3,2,1],0.0,"ds/ds has wrong value at (2,3,2,1).")  
       self.failUnlessEqual(dsds[2,3,2,2],0.0,"ds/ds has wrong value at (2,3,2,2).")  
       self.failUnlessEqual(dsds[2,3,2,3],1.0,"ds/ds has wrong value at (2,3,2,3).")  
       self.failUnlessEqual(dsds[2,3,2,4],0.0,"ds/ds has wrong value at (2,3,2,4).")  
       self.failUnlessEqual(dsds[2,3,3,0],0.0,"ds/ds has wrong value at (2,3,3,0).")  
       self.failUnlessEqual(dsds[2,3,3,1],0.0,"ds/ds has wrong value at (2,3,3,1).")  
       self.failUnlessEqual(dsds[2,3,3,2],0.0,"ds/ds has wrong value at (2,3,3,2).")  
       self.failUnlessEqual(dsds[2,3,3,3],0.0,"ds/ds has wrong value at (2,3,3,3).")  
       self.failUnlessEqual(dsds[2,3,3,4],0.0,"ds/ds has wrong value at (2,3,3,4).")  
       self.failUnlessEqual(dsds[2,4,0,0],0.0,"ds/ds has wrong value at (2,4,0,0).")  
       self.failUnlessEqual(dsds[2,4,0,1],0.0,"ds/ds has wrong value at (2,4,0,1).")  
       self.failUnlessEqual(dsds[2,4,0,2],0.0,"ds/ds has wrong value at (2,4,0,2).")  
       self.failUnlessEqual(dsds[2,4,0,3],0.0,"ds/ds has wrong value at (2,4,0,3).")  
       self.failUnlessEqual(dsds[2,4,0,4],0.0,"ds/ds has wrong value at (2,4,0,4).")  
       self.failUnlessEqual(dsds[2,4,1,0],0.0,"ds/ds has wrong value at (2,4,1,0).")  
       self.failUnlessEqual(dsds[2,4,1,1],0.0,"ds/ds has wrong value at (2,4,1,1).")  
       self.failUnlessEqual(dsds[2,4,1,2],0.0,"ds/ds has wrong value at (2,4,1,2).")  
       self.failUnlessEqual(dsds[2,4,1,3],0.0,"ds/ds has wrong value at (2,4,1,3).")  
       self.failUnlessEqual(dsds[2,4,1,4],0.0,"ds/ds has wrong value at (2,4,1,4).")  
       self.failUnlessEqual(dsds[2,4,2,0],0.0,"ds/ds has wrong value at (2,4,2,0).")  
       self.failUnlessEqual(dsds[2,4,2,1],0.0,"ds/ds has wrong value at (2,4,2,1).")  
       self.failUnlessEqual(dsds[2,4,2,2],0.0,"ds/ds has wrong value at (2,4,2,2).")  
       self.failUnlessEqual(dsds[2,4,2,3],0.0,"ds/ds has wrong value at (2,4,2,3).")  
       self.failUnlessEqual(dsds[2,4,2,4],1.0,"ds/ds has wrong value at (2,4,2,4).")  
       self.failUnlessEqual(dsds[2,4,3,0],0.0,"ds/ds has wrong value at (2,4,3,0).")  
       self.failUnlessEqual(dsds[2,4,3,1],0.0,"ds/ds has wrong value at (2,4,3,1).")  
       self.failUnlessEqual(dsds[2,4,3,2],0.0,"ds/ds has wrong value at (2,4,3,2).")  
       self.failUnlessEqual(dsds[2,4,3,3],0.0,"ds/ds has wrong value at (2,4,3,3).")  
       self.failUnlessEqual(dsds[2,4,3,4],0.0,"ds/ds has wrong value at (2,4,3,4).")  
       self.failUnlessEqual(dsds[3,0,0,0],0.0,"ds/ds has wrong value at (3,0,0,0).")  
       self.failUnlessEqual(dsds[3,0,0,1],0.0,"ds/ds has wrong value at (3,0,0,1).")  
       self.failUnlessEqual(dsds[3,0,0,2],0.0,"ds/ds has wrong value at (3,0,0,2).")  
       self.failUnlessEqual(dsds[3,0,0,3],0.0,"ds/ds has wrong value at (3,0,0,3).")  
       self.failUnlessEqual(dsds[3,0,0,4],0.0,"ds/ds has wrong value at (3,0,0,4).")  
       self.failUnlessEqual(dsds[3,0,1,0],0.0,"ds/ds has wrong value at (3,0,1,0).")  
       self.failUnlessEqual(dsds[3,0,1,1],0.0,"ds/ds has wrong value at (3,0,1,1).")  
       self.failUnlessEqual(dsds[3,0,1,2],0.0,"ds/ds has wrong value at (3,0,1,2).")  
       self.failUnlessEqual(dsds[3,0,1,3],0.0,"ds/ds has wrong value at (3,0,1,3).")  
       self.failUnlessEqual(dsds[3,0,1,4],0.0,"ds/ds has wrong value at (3,0,1,4).")  
       self.failUnlessEqual(dsds[3,0,2,0],0.0,"ds/ds has wrong value at (3,0,2,0).")  
       self.failUnlessEqual(dsds[3,0,2,1],0.0,"ds/ds has wrong value at (3,0,2,1).")  
       self.failUnlessEqual(dsds[3,0,2,2],0.0,"ds/ds has wrong value at (3,0,2,2).")  
       self.failUnlessEqual(dsds[3,0,2,3],0.0,"ds/ds has wrong value at (3,0,2,3).")  
       self.failUnlessEqual(dsds[3,0,2,4],0.0,"ds/ds has wrong value at (3,0,2,4).")  
       self.failUnlessEqual(dsds[3,0,3,0],1.0,"ds/ds has wrong value at (3,0,3,0).")  
       self.failUnlessEqual(dsds[3,0,3,1],0.0,"ds/ds has wrong value at (3,0,3,1).")  
       self.failUnlessEqual(dsds[3,0,3,2],0.0,"ds/ds has wrong value at (3,0,3,2).")  
       self.failUnlessEqual(dsds[3,0,3,3],0.0,"ds/ds has wrong value at (3,0,3,3).")  
       self.failUnlessEqual(dsds[3,0,3,4],0.0,"ds/ds has wrong value at (3,0,3,4).")  
       self.failUnlessEqual(dsds[3,1,0,0],0.0,"ds/ds has wrong value at (3,1,0,0).")  
       self.failUnlessEqual(dsds[3,1,0,1],0.0,"ds/ds has wrong value at (3,1,0,1).")  
       self.failUnlessEqual(dsds[3,1,0,2],0.0,"ds/ds has wrong value at (3,1,0,2).")  
       self.failUnlessEqual(dsds[3,1,0,3],0.0,"ds/ds has wrong value at (3,1,0,3).")  
       self.failUnlessEqual(dsds[3,1,0,4],0.0,"ds/ds has wrong value at (3,1,0,4).")  
       self.failUnlessEqual(dsds[3,1,1,0],0.0,"ds/ds has wrong value at (3,1,1,0).")  
       self.failUnlessEqual(dsds[3,1,1,1],0.0,"ds/ds has wrong value at (3,1,1,1).")  
       self.failUnlessEqual(dsds[3,1,1,2],0.0,"ds/ds has wrong value at (3,1,1,2).")  
       self.failUnlessEqual(dsds[3,1,1,3],0.0,"ds/ds has wrong value at (3,1,1,3).")  
       self.failUnlessEqual(dsds[3,1,1,4],0.0,"ds/ds has wrong value at (3,1,1,4).")  
       self.failUnlessEqual(dsds[3,1,2,0],0.0,"ds/ds has wrong value at (3,1,2,0).")  
       self.failUnlessEqual(dsds[3,1,2,1],0.0,"ds/ds has wrong value at (3,1,2,1).")  
       self.failUnlessEqual(dsds[3,1,2,2],0.0,"ds/ds has wrong value at (3,1,2,2).")  
       self.failUnlessEqual(dsds[3,1,2,3],0.0,"ds/ds has wrong value at (3,1,2,3).")  
       self.failUnlessEqual(dsds[3,1,2,4],0.0,"ds/ds has wrong value at (3,1,2,4).")  
       self.failUnlessEqual(dsds[3,1,3,0],0.0,"ds/ds has wrong value at (3,1,3,0).")  
       self.failUnlessEqual(dsds[3,1,3,1],1.0,"ds/ds has wrong value at (3,1,3,1).")  
       self.failUnlessEqual(dsds[3,1,3,2],0.0,"ds/ds has wrong value at (3,1,3,2).")  
       self.failUnlessEqual(dsds[3,1,3,3],0.0,"ds/ds has wrong value at (3,1,3,3).")  
       self.failUnlessEqual(dsds[3,1,3,4],0.0,"ds/ds has wrong value at (3,1,3,4).")  
       self.failUnlessEqual(dsds[3,2,0,0],0.0,"ds/ds has wrong value at (3,2,0,0).")  
       self.failUnlessEqual(dsds[3,2,0,1],0.0,"ds/ds has wrong value at (3,2,0,1).")  
       self.failUnlessEqual(dsds[3,2,0,2],0.0,"ds/ds has wrong value at (3,2,0,2).")  
       self.failUnlessEqual(dsds[3,2,0,3],0.0,"ds/ds has wrong value at (3,2,0,3).")  
       self.failUnlessEqual(dsds[3,2,0,4],0.0,"ds/ds has wrong value at (3,2,0,4).")  
       self.failUnlessEqual(dsds[3,2,1,0],0.0,"ds/ds has wrong value at (3,2,1,0).")  
       self.failUnlessEqual(dsds[3,2,1,1],0.0,"ds/ds has wrong value at (3,2,1,1).")  
       self.failUnlessEqual(dsds[3,2,1,2],0.0,"ds/ds has wrong value at (3,2,1,2).")  
       self.failUnlessEqual(dsds[3,2,1,3],0.0,"ds/ds has wrong value at (3,2,1,3).")  
       self.failUnlessEqual(dsds[3,2,1,4],0.0,"ds/ds has wrong value at (3,2,1,4).")  
       self.failUnlessEqual(dsds[3,2,2,0],0.0,"ds/ds has wrong value at (3,2,2,0).")  
       self.failUnlessEqual(dsds[3,2,2,1],0.0,"ds/ds has wrong value at (3,2,2,1).")  
       self.failUnlessEqual(dsds[3,2,2,2],0.0,"ds/ds has wrong value at (3,2,2,2).")  
       self.failUnlessEqual(dsds[3,2,2,3],0.0,"ds/ds has wrong value at (3,2,2,3).")  
       self.failUnlessEqual(dsds[3,2,2,4],0.0,"ds/ds has wrong value at (3,2,2,4).")  
       self.failUnlessEqual(dsds[3,2,3,0],0.0,"ds/ds has wrong value at (3,2,3,0).")  
       self.failUnlessEqual(dsds[3,2,3,1],0.0,"ds/ds has wrong value at (3,2,3,1).")  
       self.failUnlessEqual(dsds[3,2,3,2],1.0,"ds/ds has wrong value at (3,2,3,2).")  
       self.failUnlessEqual(dsds[3,2,3,3],0.0,"ds/ds has wrong value at (3,2,3,3).")  
       self.failUnlessEqual(dsds[3,2,3,4],0.0,"ds/ds has wrong value at (3,2,3,4).")  
       self.failUnlessEqual(dsds[3,3,0,0],0.0,"ds/ds has wrong value at (3,3,0,0).")  
       self.failUnlessEqual(dsds[3,3,0,1],0.0,"ds/ds has wrong value at (3,3,0,1).")  
       self.failUnlessEqual(dsds[3,3,0,2],0.0,"ds/ds has wrong value at (3,3,0,2).")  
       self.failUnlessEqual(dsds[3,3,0,3],0.0,"ds/ds has wrong value at (3,3,0,3).")  
       self.failUnlessEqual(dsds[3,3,0,4],0.0,"ds/ds has wrong value at (3,3,0,4).")  
       self.failUnlessEqual(dsds[3,3,1,0],0.0,"ds/ds has wrong value at (3,3,1,0).")  
       self.failUnlessEqual(dsds[3,3,1,1],0.0,"ds/ds has wrong value at (3,3,1,1).")  
       self.failUnlessEqual(dsds[3,3,1,2],0.0,"ds/ds has wrong value at (3,3,1,2).")  
       self.failUnlessEqual(dsds[3,3,1,3],0.0,"ds/ds has wrong value at (3,3,1,3).")  
       self.failUnlessEqual(dsds[3,3,1,4],0.0,"ds/ds has wrong value at (3,3,1,4).")  
       self.failUnlessEqual(dsds[3,3,2,0],0.0,"ds/ds has wrong value at (3,3,2,0).")  
       self.failUnlessEqual(dsds[3,3,2,1],0.0,"ds/ds has wrong value at (3,3,2,1).")  
       self.failUnlessEqual(dsds[3,3,2,2],0.0,"ds/ds has wrong value at (3,3,2,2).")  
       self.failUnlessEqual(dsds[3,3,2,3],0.0,"ds/ds has wrong value at (3,3,2,3).")  
       self.failUnlessEqual(dsds[3,3,2,4],0.0,"ds/ds has wrong value at (3,3,2,4).")  
       self.failUnlessEqual(dsds[3,3,3,0],0.0,"ds/ds has wrong value at (3,3,3,0).")  
       self.failUnlessEqual(dsds[3,3,3,1],0.0,"ds/ds has wrong value at (3,3,3,1).")  
       self.failUnlessEqual(dsds[3,3,3,2],0.0,"ds/ds has wrong value at (3,3,3,2).")  
       self.failUnlessEqual(dsds[3,3,3,3],1.0,"ds/ds has wrong value at (3,3,3,3).")  
       self.failUnlessEqual(dsds[3,3,3,4],0.0,"ds/ds has wrong value at (3,3,3,4).")  
       self.failUnlessEqual(dsds[3,4,0,0],0.0,"ds/ds has wrong value at (3,4,0,0).")  
       self.failUnlessEqual(dsds[3,4,0,1],0.0,"ds/ds has wrong value at (3,4,0,1).")  
       self.failUnlessEqual(dsds[3,4,0,2],0.0,"ds/ds has wrong value at (3,4,0,2).")  
       self.failUnlessEqual(dsds[3,4,0,3],0.0,"ds/ds has wrong value at (3,4,0,3).")  
       self.failUnlessEqual(dsds[3,4,0,4],0.0,"ds/ds has wrong value at (3,4,0,4).")  
       self.failUnlessEqual(dsds[3,4,1,0],0.0,"ds/ds has wrong value at (3,4,1,0).")  
       self.failUnlessEqual(dsds[3,4,1,1],0.0,"ds/ds has wrong value at (3,4,1,1).")  
       self.failUnlessEqual(dsds[3,4,1,2],0.0,"ds/ds has wrong value at (3,4,1,2).")  
       self.failUnlessEqual(dsds[3,4,1,3],0.0,"ds/ds has wrong value at (3,4,1,3).")  
       self.failUnlessEqual(dsds[3,4,1,4],0.0,"ds/ds has wrong value at (3,4,1,4).")  
       self.failUnlessEqual(dsds[3,4,2,0],0.0,"ds/ds has wrong value at (3,4,2,0).")  
       self.failUnlessEqual(dsds[3,4,2,1],0.0,"ds/ds has wrong value at (3,4,2,1).")  
       self.failUnlessEqual(dsds[3,4,2,2],0.0,"ds/ds has wrong value at (3,4,2,2).")  
       self.failUnlessEqual(dsds[3,4,2,3],0.0,"ds/ds has wrong value at (3,4,2,3).")  
       self.failUnlessEqual(dsds[3,4,2,4],0.0,"ds/ds has wrong value at (3,4,2,4).")  
       self.failUnlessEqual(dsds[3,4,3,0],0.0,"ds/ds has wrong value at (3,4,3,0).")  
       self.failUnlessEqual(dsds[3,4,3,1],0.0,"ds/ds has wrong value at (3,4,3,1).")  
       self.failUnlessEqual(dsds[3,4,3,2],0.0,"ds/ds has wrong value at (3,4,3,2).")  
       self.failUnlessEqual(dsds[3,4,3,3],0.0,"ds/ds has wrong value at (3,4,3,3).")  
       self.failUnlessEqual(dsds[3,4,3,4],1.0,"ds/ds has wrong value at (3,4,3,4).")  
   
       self.failUnlessEqual(s.getArgument(0),s2,"wrong argument 0.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),1,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],-10,"wrongly substituted argument 0.")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(4, 5),dim=self.functionspace.getDim())),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(escript.Data(0.,(4, 5),self.functionspace)),"Data is appropriate substitute")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((4, 5))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank2_dd_nargs2(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(4, 5),dim=self.functionspace.getDim(),args=[1, -1.0])  
       self.failUnlessEqual(s.getRank(),2,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(4, 5),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),self.functionspace.getDim(),"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[1, -1.0],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((4, 5))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(4, 5),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(4, 5, 4, 5),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0,0,0],1.0,"ds/ds has wrong value at (0,0,0,0).")  
       self.failUnlessEqual(dsds[0,0,0,1],0.0,"ds/ds has wrong value at (0,0,0,1).")  
       self.failUnlessEqual(dsds[0,0,0,2],0.0,"ds/ds has wrong value at (0,0,0,2).")  
       self.failUnlessEqual(dsds[0,0,0,3],0.0,"ds/ds has wrong value at (0,0,0,3).")  
       self.failUnlessEqual(dsds[0,0,0,4],0.0,"ds/ds has wrong value at (0,0,0,4).")  
       self.failUnlessEqual(dsds[0,0,1,0],0.0,"ds/ds has wrong value at (0,0,1,0).")  
       self.failUnlessEqual(dsds[0,0,1,1],0.0,"ds/ds has wrong value at (0,0,1,1).")  
       self.failUnlessEqual(dsds[0,0,1,2],0.0,"ds/ds has wrong value at (0,0,1,2).")  
       self.failUnlessEqual(dsds[0,0,1,3],0.0,"ds/ds has wrong value at (0,0,1,3).")  
       self.failUnlessEqual(dsds[0,0,1,4],0.0,"ds/ds has wrong value at (0,0,1,4).")  
       self.failUnlessEqual(dsds[0,0,2,0],0.0,"ds/ds has wrong value at (0,0,2,0).")  
       self.failUnlessEqual(dsds[0,0,2,1],0.0,"ds/ds has wrong value at (0,0,2,1).")  
       self.failUnlessEqual(dsds[0,0,2,2],0.0,"ds/ds has wrong value at (0,0,2,2).")  
       self.failUnlessEqual(dsds[0,0,2,3],0.0,"ds/ds has wrong value at (0,0,2,3).")  
       self.failUnlessEqual(dsds[0,0,2,4],0.0,"ds/ds has wrong value at (0,0,2,4).")  
       self.failUnlessEqual(dsds[0,0,3,0],0.0,"ds/ds has wrong value at (0,0,3,0).")  
       self.failUnlessEqual(dsds[0,0,3,1],0.0,"ds/ds has wrong value at (0,0,3,1).")  
       self.failUnlessEqual(dsds[0,0,3,2],0.0,"ds/ds has wrong value at (0,0,3,2).")  
       self.failUnlessEqual(dsds[0,0,3,3],0.0,"ds/ds has wrong value at (0,0,3,3).")  
       self.failUnlessEqual(dsds[0,0,3,4],0.0,"ds/ds has wrong value at (0,0,3,4).")  
       self.failUnlessEqual(dsds[0,1,0,0],0.0,"ds/ds has wrong value at (0,1,0,0).")  
       self.failUnlessEqual(dsds[0,1,0,1],1.0,"ds/ds has wrong value at (0,1,0,1).")  
       self.failUnlessEqual(dsds[0,1,0,2],0.0,"ds/ds has wrong value at (0,1,0,2).")  
       self.failUnlessEqual(dsds[0,1,0,3],0.0,"ds/ds has wrong value at (0,1,0,3).")  
       self.failUnlessEqual(dsds[0,1,0,4],0.0,"ds/ds has wrong value at (0,1,0,4).")  
       self.failUnlessEqual(dsds[0,1,1,0],0.0,"ds/ds has wrong value at (0,1,1,0).")  
       self.failUnlessEqual(dsds[0,1,1,1],0.0,"ds/ds has wrong value at (0,1,1,1).")  
       self.failUnlessEqual(dsds[0,1,1,2],0.0,"ds/ds has wrong value at (0,1,1,2).")  
       self.failUnlessEqual(dsds[0,1,1,3],0.0,"ds/ds has wrong value at (0,1,1,3).")  
       self.failUnlessEqual(dsds[0,1,1,4],0.0,"ds/ds has wrong value at (0,1,1,4).")  
       self.failUnlessEqual(dsds[0,1,2,0],0.0,"ds/ds has wrong value at (0,1,2,0).")  
       self.failUnlessEqual(dsds[0,1,2,1],0.0,"ds/ds has wrong value at (0,1,2,1).")  
       self.failUnlessEqual(dsds[0,1,2,2],0.0,"ds/ds has wrong value at (0,1,2,2).")  
       self.failUnlessEqual(dsds[0,1,2,3],0.0,"ds/ds has wrong value at (0,1,2,3).")  
       self.failUnlessEqual(dsds[0,1,2,4],0.0,"ds/ds has wrong value at (0,1,2,4).")  
       self.failUnlessEqual(dsds[0,1,3,0],0.0,"ds/ds has wrong value at (0,1,3,0).")  
       self.failUnlessEqual(dsds[0,1,3,1],0.0,"ds/ds has wrong value at (0,1,3,1).")  
       self.failUnlessEqual(dsds[0,1,3,2],0.0,"ds/ds has wrong value at (0,1,3,2).")  
       self.failUnlessEqual(dsds[0,1,3,3],0.0,"ds/ds has wrong value at (0,1,3,3).")  
       self.failUnlessEqual(dsds[0,1,3,4],0.0,"ds/ds has wrong value at (0,1,3,4).")  
       self.failUnlessEqual(dsds[0,2,0,0],0.0,"ds/ds has wrong value at (0,2,0,0).")  
       self.failUnlessEqual(dsds[0,2,0,1],0.0,"ds/ds has wrong value at (0,2,0,1).")  
       self.failUnlessEqual(dsds[0,2,0,2],1.0,"ds/ds has wrong value at (0,2,0,2).")  
       self.failUnlessEqual(dsds[0,2,0,3],0.0,"ds/ds has wrong value at (0,2,0,3).")  
       self.failUnlessEqual(dsds[0,2,0,4],0.0,"ds/ds has wrong value at (0,2,0,4).")  
       self.failUnlessEqual(dsds[0,2,1,0],0.0,"ds/ds has wrong value at (0,2,1,0).")  
       self.failUnlessEqual(dsds[0,2,1,1],0.0,"ds/ds has wrong value at (0,2,1,1).")  
       self.failUnlessEqual(dsds[0,2,1,2],0.0,"ds/ds has wrong value at (0,2,1,2).")  
       self.failUnlessEqual(dsds[0,2,1,3],0.0,"ds/ds has wrong value at (0,2,1,3).")  
       self.failUnlessEqual(dsds[0,2,1,4],0.0,"ds/ds has wrong value at (0,2,1,4).")  
       self.failUnlessEqual(dsds[0,2,2,0],0.0,"ds/ds has wrong value at (0,2,2,0).")  
       self.failUnlessEqual(dsds[0,2,2,1],0.0,"ds/ds has wrong value at (0,2,2,1).")  
       self.failUnlessEqual(dsds[0,2,2,2],0.0,"ds/ds has wrong value at (0,2,2,2).")  
       self.failUnlessEqual(dsds[0,2,2,3],0.0,"ds/ds has wrong value at (0,2,2,3).")  
       self.failUnlessEqual(dsds[0,2,2,4],0.0,"ds/ds has wrong value at (0,2,2,4).")  
       self.failUnlessEqual(dsds[0,2,3,0],0.0,"ds/ds has wrong value at (0,2,3,0).")  
       self.failUnlessEqual(dsds[0,2,3,1],0.0,"ds/ds has wrong value at (0,2,3,1).")  
       self.failUnlessEqual(dsds[0,2,3,2],0.0,"ds/ds has wrong value at (0,2,3,2).")  
       self.failUnlessEqual(dsds[0,2,3,3],0.0,"ds/ds has wrong value at (0,2,3,3).")  
       self.failUnlessEqual(dsds[0,2,3,4],0.0,"ds/ds has wrong value at (0,2,3,4).")  
       self.failUnlessEqual(dsds[0,3,0,0],0.0,"ds/ds has wrong value at (0,3,0,0).")  
       self.failUnlessEqual(dsds[0,3,0,1],0.0,"ds/ds has wrong value at (0,3,0,1).")  
       self.failUnlessEqual(dsds[0,3,0,2],0.0,"ds/ds has wrong value at (0,3,0,2).")  
       self.failUnlessEqual(dsds[0,3,0,3],1.0,"ds/ds has wrong value at (0,3,0,3).")  
       self.failUnlessEqual(dsds[0,3,0,4],0.0,"ds/ds has wrong value at (0,3,0,4).")  
       self.failUnlessEqual(dsds[0,3,1,0],0.0,"ds/ds has wrong value at (0,3,1,0).")  
       self.failUnlessEqual(dsds[0,3,1,1],0.0,"ds/ds has wrong value at (0,3,1,1).")  
       self.failUnlessEqual(dsds[0,3,1,2],0.0,"ds/ds has wrong value at (0,3,1,2).")  
       self.failUnlessEqual(dsds[0,3,1,3],0.0,"ds/ds has wrong value at (0,3,1,3).")  
       self.failUnlessEqual(dsds[0,3,1,4],0.0,"ds/ds has wrong value at (0,3,1,4).")  
       self.failUnlessEqual(dsds[0,3,2,0],0.0,"ds/ds has wrong value at (0,3,2,0).")  
       self.failUnlessEqual(dsds[0,3,2,1],0.0,"ds/ds has wrong value at (0,3,2,1).")  
       self.failUnlessEqual(dsds[0,3,2,2],0.0,"ds/ds has wrong value at (0,3,2,2).")  
       self.failUnlessEqual(dsds[0,3,2,3],0.0,"ds/ds has wrong value at (0,3,2,3).")  
       self.failUnlessEqual(dsds[0,3,2,4],0.0,"ds/ds has wrong value at (0,3,2,4).")  
       self.failUnlessEqual(dsds[0,3,3,0],0.0,"ds/ds has wrong value at (0,3,3,0).")  
       self.failUnlessEqual(dsds[0,3,3,1],0.0,"ds/ds has wrong value at (0,3,3,1).")  
       self.failUnlessEqual(dsds[0,3,3,2],0.0,"ds/ds has wrong value at (0,3,3,2).")  
       self.failUnlessEqual(dsds[0,3,3,3],0.0,"ds/ds has wrong value at (0,3,3,3).")  
       self.failUnlessEqual(dsds[0,3,3,4],0.0,"ds/ds has wrong value at (0,3,3,4).")  
       self.failUnlessEqual(dsds[0,4,0,0],0.0,"ds/ds has wrong value at (0,4,0,0).")  
       self.failUnlessEqual(dsds[0,4,0,1],0.0,"ds/ds has wrong value at (0,4,0,1).")  
       self.failUnlessEqual(dsds[0,4,0,2],0.0,"ds/ds has wrong value at (0,4,0,2).")  
       self.failUnlessEqual(dsds[0,4,0,3],0.0,"ds/ds has wrong value at (0,4,0,3).")  
       self.failUnlessEqual(dsds[0,4,0,4],1.0,"ds/ds has wrong value at (0,4,0,4).")  
       self.failUnlessEqual(dsds[0,4,1,0],0.0,"ds/ds has wrong value at (0,4,1,0).")  
       self.failUnlessEqual(dsds[0,4,1,1],0.0,"ds/ds has wrong value at (0,4,1,1).")  
       self.failUnlessEqual(dsds[0,4,1,2],0.0,"ds/ds has wrong value at (0,4,1,2).")  
       self.failUnlessEqual(dsds[0,4,1,3],0.0,"ds/ds has wrong value at (0,4,1,3).")  
       self.failUnlessEqual(dsds[0,4,1,4],0.0,"ds/ds has wrong value at (0,4,1,4).")  
       self.failUnlessEqual(dsds[0,4,2,0],0.0,"ds/ds has wrong value at (0,4,2,0).")  
       self.failUnlessEqual(dsds[0,4,2,1],0.0,"ds/ds has wrong value at (0,4,2,1).")  
       self.failUnlessEqual(dsds[0,4,2,2],0.0,"ds/ds has wrong value at (0,4,2,2).")  
       self.failUnlessEqual(dsds[0,4,2,3],0.0,"ds/ds has wrong value at (0,4,2,3).")  
       self.failUnlessEqual(dsds[0,4,2,4],0.0,"ds/ds has wrong value at (0,4,2,4).")  
       self.failUnlessEqual(dsds[0,4,3,0],0.0,"ds/ds has wrong value at (0,4,3,0).")  
       self.failUnlessEqual(dsds[0,4,3,1],0.0,"ds/ds has wrong value at (0,4,3,1).")  
       self.failUnlessEqual(dsds[0,4,3,2],0.0,"ds/ds has wrong value at (0,4,3,2).")  
       self.failUnlessEqual(dsds[0,4,3,3],0.0,"ds/ds has wrong value at (0,4,3,3).")  
       self.failUnlessEqual(dsds[0,4,3,4],0.0,"ds/ds has wrong value at (0,4,3,4).")  
       self.failUnlessEqual(dsds[1,0,0,0],0.0,"ds/ds has wrong value at (1,0,0,0).")  
       self.failUnlessEqual(dsds[1,0,0,1],0.0,"ds/ds has wrong value at (1,0,0,1).")  
       self.failUnlessEqual(dsds[1,0,0,2],0.0,"ds/ds has wrong value at (1,0,0,2).")  
       self.failUnlessEqual(dsds[1,0,0,3],0.0,"ds/ds has wrong value at (1,0,0,3).")  
       self.failUnlessEqual(dsds[1,0,0,4],0.0,"ds/ds has wrong value at (1,0,0,4).")  
       self.failUnlessEqual(dsds[1,0,1,0],1.0,"ds/ds has wrong value at (1,0,1,0).")  
       self.failUnlessEqual(dsds[1,0,1,1],0.0,"ds/ds has wrong value at (1,0,1,1).")  
       self.failUnlessEqual(dsds[1,0,1,2],0.0,"ds/ds has wrong value at (1,0,1,2).")  
       self.failUnlessEqual(dsds[1,0,1,3],0.0,"ds/ds has wrong value at (1,0,1,3).")  
       self.failUnlessEqual(dsds[1,0,1,4],0.0,"ds/ds has wrong value at (1,0,1,4).")  
       self.failUnlessEqual(dsds[1,0,2,0],0.0,"ds/ds has wrong value at (1,0,2,0).")  
       self.failUnlessEqual(dsds[1,0,2,1],0.0,"ds/ds has wrong value at (1,0,2,1).")  
       self.failUnlessEqual(dsds[1,0,2,2],0.0,"ds/ds has wrong value at (1,0,2,2).")  
       self.failUnlessEqual(dsds[1,0,2,3],0.0,"ds/ds has wrong value at (1,0,2,3).")  
       self.failUnlessEqual(dsds[1,0,2,4],0.0,"ds/ds has wrong value at (1,0,2,4).")  
       self.failUnlessEqual(dsds[1,0,3,0],0.0,"ds/ds has wrong value at (1,0,3,0).")  
       self.failUnlessEqual(dsds[1,0,3,1],0.0,"ds/ds has wrong value at (1,0,3,1).")  
       self.failUnlessEqual(dsds[1,0,3,2],0.0,"ds/ds has wrong value at (1,0,3,2).")  
       self.failUnlessEqual(dsds[1,0,3,3],0.0,"ds/ds has wrong value at (1,0,3,3).")  
       self.failUnlessEqual(dsds[1,0,3,4],0.0,"ds/ds has wrong value at (1,0,3,4).")  
       self.failUnlessEqual(dsds[1,1,0,0],0.0,"ds/ds has wrong value at (1,1,0,0).")  
       self.failUnlessEqual(dsds[1,1,0,1],0.0,"ds/ds has wrong value at (1,1,0,1).")  
       self.failUnlessEqual(dsds[1,1,0,2],0.0,"ds/ds has wrong value at (1,1,0,2).")  
       self.failUnlessEqual(dsds[1,1,0,3],0.0,"ds/ds has wrong value at (1,1,0,3).")  
       self.failUnlessEqual(dsds[1,1,0,4],0.0,"ds/ds has wrong value at (1,1,0,4).")  
       self.failUnlessEqual(dsds[1,1,1,0],0.0,"ds/ds has wrong value at (1,1,1,0).")  
       self.failUnlessEqual(dsds[1,1,1,1],1.0,"ds/ds has wrong value at (1,1,1,1).")  
       self.failUnlessEqual(dsds[1,1,1,2],0.0,"ds/ds has wrong value at (1,1,1,2).")  
       self.failUnlessEqual(dsds[1,1,1,3],0.0,"ds/ds has wrong value at (1,1,1,3).")  
       self.failUnlessEqual(dsds[1,1,1,4],0.0,"ds/ds has wrong value at (1,1,1,4).")  
       self.failUnlessEqual(dsds[1,1,2,0],0.0,"ds/ds has wrong value at (1,1,2,0).")  
       self.failUnlessEqual(dsds[1,1,2,1],0.0,"ds/ds has wrong value at (1,1,2,1).")  
       self.failUnlessEqual(dsds[1,1,2,2],0.0,"ds/ds has wrong value at (1,1,2,2).")  
       self.failUnlessEqual(dsds[1,1,2,3],0.0,"ds/ds has wrong value at (1,1,2,3).")  
       self.failUnlessEqual(dsds[1,1,2,4],0.0,"ds/ds has wrong value at (1,1,2,4).")  
       self.failUnlessEqual(dsds[1,1,3,0],0.0,"ds/ds has wrong value at (1,1,3,0).")  
       self.failUnlessEqual(dsds[1,1,3,1],0.0,"ds/ds has wrong value at (1,1,3,1).")  
       self.failUnlessEqual(dsds[1,1,3,2],0.0,"ds/ds has wrong value at (1,1,3,2).")  
       self.failUnlessEqual(dsds[1,1,3,3],0.0,"ds/ds has wrong value at (1,1,3,3).")  
       self.failUnlessEqual(dsds[1,1,3,4],0.0,"ds/ds has wrong value at (1,1,3,4).")  
       self.failUnlessEqual(dsds[1,2,0,0],0.0,"ds/ds has wrong value at (1,2,0,0).")  
       self.failUnlessEqual(dsds[1,2,0,1],0.0,"ds/ds has wrong value at (1,2,0,1).")  
       self.failUnlessEqual(dsds[1,2,0,2],0.0,"ds/ds has wrong value at (1,2,0,2).")  
       self.failUnlessEqual(dsds[1,2,0,3],0.0,"ds/ds has wrong value at (1,2,0,3).")  
       self.failUnlessEqual(dsds[1,2,0,4],0.0,"ds/ds has wrong value at (1,2,0,4).")  
       self.failUnlessEqual(dsds[1,2,1,0],0.0,"ds/ds has wrong value at (1,2,1,0).")  
       self.failUnlessEqual(dsds[1,2,1,1],0.0,"ds/ds has wrong value at (1,2,1,1).")  
       self.failUnlessEqual(dsds[1,2,1,2],1.0,"ds/ds has wrong value at (1,2,1,2).")  
       self.failUnlessEqual(dsds[1,2,1,3],0.0,"ds/ds has wrong value at (1,2,1,3).")  
       self.failUnlessEqual(dsds[1,2,1,4],0.0,"ds/ds has wrong value at (1,2,1,4).")  
       self.failUnlessEqual(dsds[1,2,2,0],0.0,"ds/ds has wrong value at (1,2,2,0).")  
       self.failUnlessEqual(dsds[1,2,2,1],0.0,"ds/ds has wrong value at (1,2,2,1).")  
       self.failUnlessEqual(dsds[1,2,2,2],0.0,"ds/ds has wrong value at (1,2,2,2).")  
       self.failUnlessEqual(dsds[1,2,2,3],0.0,"ds/ds has wrong value at (1,2,2,3).")  
       self.failUnlessEqual(dsds[1,2,2,4],0.0,"ds/ds has wrong value at (1,2,2,4).")  
       self.failUnlessEqual(dsds[1,2,3,0],0.0,"ds/ds has wrong value at (1,2,3,0).")  
       self.failUnlessEqual(dsds[1,2,3,1],0.0,"ds/ds has wrong value at (1,2,3,1).")  
       self.failUnlessEqual(dsds[1,2,3,2],0.0,"ds/ds has wrong value at (1,2,3,2).")  
       self.failUnlessEqual(dsds[1,2,3,3],0.0,"ds/ds has wrong value at (1,2,3,3).")  
       self.failUnlessEqual(dsds[1,2,3,4],0.0,"ds/ds has wrong value at (1,2,3,4).")  
       self.failUnlessEqual(dsds[1,3,0,0],0.0,"ds/ds has wrong value at (1,3,0,0).")  
       self.failUnlessEqual(dsds[1,3,0,1],0.0,"ds/ds has wrong value at (1,3,0,1).")  
       self.failUnlessEqual(dsds[1,3,0,2],0.0,"ds/ds has wrong value at (1,3,0,2).")  
       self.failUnlessEqual(dsds[1,3,0,3],0.0,"ds/ds has wrong value at (1,3,0,3).")  
       self.failUnlessEqual(dsds[1,3,0,4],0.0,"ds/ds has wrong value at (1,3,0,4).")  
       self.failUnlessEqual(dsds[1,3,1,0],0.0,"ds/ds has wrong value at (1,3,1,0).")  
       self.failUnlessEqual(dsds[1,3,1,1],0.0,"ds/ds has wrong value at (1,3,1,1).")  
       self.failUnlessEqual(dsds[1,3,1,2],0.0,"ds/ds has wrong value at (1,3,1,2).")  
       self.failUnlessEqual(dsds[1,3,1,3],1.0,"ds/ds has wrong value at (1,3,1,3).")  
       self.failUnlessEqual(dsds[1,3,1,4],0.0,"ds/ds has wrong value at (1,3,1,4).")  
       self.failUnlessEqual(dsds[1,3,2,0],0.0,"ds/ds has wrong value at (1,3,2,0).")  
       self.failUnlessEqual(dsds[1,3,2,1],0.0,"ds/ds has wrong value at (1,3,2,1).")  
       self.failUnlessEqual(dsds[1,3,2,2],0.0,"ds/ds has wrong value at (1,3,2,2).")  
       self.failUnlessEqual(dsds[1,3,2,3],0.0,"ds/ds has wrong value at (1,3,2,3).")  
       self.failUnlessEqual(dsds[1,3,2,4],0.0,"ds/ds has wrong value at (1,3,2,4).")  
       self.failUnlessEqual(dsds[1,3,3,0],0.0,"ds/ds has wrong value at (1,3,3,0).")  
       self.failUnlessEqual(dsds[1,3,3,1],0.0,"ds/ds has wrong value at (1,3,3,1).")  
       self.failUnlessEqual(dsds[1,3,3,2],0.0,"ds/ds has wrong value at (1,3,3,2).")  
       self.failUnlessEqual(dsds[1,3,3,3],0.0,"ds/ds has wrong value at (1,3,3,3).")  
       self.failUnlessEqual(dsds[1,3,3,4],0.0,"ds/ds has wrong value at (1,3,3,4).")  
       self.failUnlessEqual(dsds[1,4,0,0],0.0,"ds/ds has wrong value at (1,4,0,0).")  
       self.failUnlessEqual(dsds[1,4,0,1],0.0,"ds/ds has wrong value at (1,4,0,1).")  
       self.failUnlessEqual(dsds[1,4,0,2],0.0,"ds/ds has wrong value at (1,4,0,2).")  
       self.failUnlessEqual(dsds[1,4,0,3],0.0,"ds/ds has wrong value at (1,4,0,3).")  
       self.failUnlessEqual(dsds[1,4,0,4],0.0,"ds/ds has wrong value at (1,4,0,4).")  
       self.failUnlessEqual(dsds[1,4,1,0],0.0,"ds/ds has wrong value at (1,4,1,0).")  
       self.failUnlessEqual(dsds[1,4,1,1],0.0,"ds/ds has wrong value at (1,4,1,1).")  
       self.failUnlessEqual(dsds[1,4,1,2],0.0,"ds/ds has wrong value at (1,4,1,2).")  
       self.failUnlessEqual(dsds[1,4,1,3],0.0,"ds/ds has wrong value at (1,4,1,3).")  
       self.failUnlessEqual(dsds[1,4,1,4],1.0,"ds/ds has wrong value at (1,4,1,4).")  
       self.failUnlessEqual(dsds[1,4,2,0],0.0,"ds/ds has wrong value at (1,4,2,0).")  
       self.failUnlessEqual(dsds[1,4,2,1],0.0,"ds/ds has wrong value at (1,4,2,1).")  
       self.failUnlessEqual(dsds[1,4,2,2],0.0,"ds/ds has wrong value at (1,4,2,2).")  
       self.failUnlessEqual(dsds[1,4,2,3],0.0,"ds/ds has wrong value at (1,4,2,3).")  
       self.failUnlessEqual(dsds[1,4,2,4],0.0,"ds/ds has wrong value at (1,4,2,4).")  
       self.failUnlessEqual(dsds[1,4,3,0],0.0,"ds/ds has wrong value at (1,4,3,0).")  
       self.failUnlessEqual(dsds[1,4,3,1],0.0,"ds/ds has wrong value at (1,4,3,1).")  
       self.failUnlessEqual(dsds[1,4,3,2],0.0,"ds/ds has wrong value at (1,4,3,2).")  
       self.failUnlessEqual(dsds[1,4,3,3],0.0,"ds/ds has wrong value at (1,4,3,3).")  
       self.failUnlessEqual(dsds[1,4,3,4],0.0,"ds/ds has wrong value at (1,4,3,4).")  
       self.failUnlessEqual(dsds[2,0,0,0],0.0,"ds/ds has wrong value at (2,0,0,0).")  
       self.failUnlessEqual(dsds[2,0,0,1],0.0,"ds/ds has wrong value at (2,0,0,1).")  
       self.failUnlessEqual(dsds[2,0,0,2],0.0,"ds/ds has wrong value at (2,0,0,2).")  
       self.failUnlessEqual(dsds[2,0,0,3],0.0,"ds/ds has wrong value at (2,0,0,3).")  
       self.failUnlessEqual(dsds[2,0,0,4],0.0,"ds/ds has wrong value at (2,0,0,4).")  
       self.failUnlessEqual(dsds[2,0,1,0],0.0,"ds/ds has wrong value at (2,0,1,0).")  
       self.failUnlessEqual(dsds[2,0,1,1],0.0,"ds/ds has wrong value at (2,0,1,1).")  
       self.failUnlessEqual(dsds[2,0,1,2],0.0,"ds/ds has wrong value at (2,0,1,2).")  
       self.failUnlessEqual(dsds[2,0,1,3],0.0,"ds/ds has wrong value at (2,0,1,3).")  
       self.failUnlessEqual(dsds[2,0,1,4],0.0,"ds/ds has wrong value at (2,0,1,4).")  
       self.failUnlessEqual(dsds[2,0,2,0],1.0,"ds/ds has wrong value at (2,0,2,0).")  
       self.failUnlessEqual(dsds[2,0,2,1],0.0,"ds/ds has wrong value at (2,0,2,1).")  
       self.failUnlessEqual(dsds[2,0,2,2],0.0,"ds/ds has wrong value at (2,0,2,2).")  
       self.failUnlessEqual(dsds[2,0,2,3],0.0,"ds/ds has wrong value at (2,0,2,3).")  
       self.failUnlessEqual(dsds[2,0,2,4],0.0,"ds/ds has wrong value at (2,0,2,4).")  
       self.failUnlessEqual(dsds[2,0,3,0],0.0,"ds/ds has wrong value at (2,0,3,0).")  
       self.failUnlessEqual(dsds[2,0,3,1],0.0,"ds/ds has wrong value at (2,0,3,1).")  
       self.failUnlessEqual(dsds[2,0,3,2],0.0,"ds/ds has wrong value at (2,0,3,2).")  
       self.failUnlessEqual(dsds[2,0,3,3],0.0,"ds/ds has wrong value at (2,0,3,3).")  
       self.failUnlessEqual(dsds[2,0,3,4],0.0,"ds/ds has wrong value at (2,0,3,4).")  
       self.failUnlessEqual(dsds[2,1,0,0],0.0,"ds/ds has wrong value at (2,1,0,0).")  
       self.failUnlessEqual(dsds[2,1,0,1],0.0,"ds/ds has wrong value at (2,1,0,1).")  
       self.failUnlessEqual(dsds[2,1,0,2],0.0,"ds/ds has wrong value at (2,1,0,2).")  
       self.failUnlessEqual(dsds[2,1,0,3],0.0,"ds/ds has wrong value at (2,1,0,3).")  
       self.failUnlessEqual(dsds[2,1,0,4],0.0,"ds/ds has wrong value at (2,1,0,4).")  
       self.failUnlessEqual(dsds[2,1,1,0],0.0,"ds/ds has wrong value at (2,1,1,0).")  
       self.failUnlessEqual(dsds[2,1,1,1],0.0,"ds/ds has wrong value at (2,1,1,1).")  
       self.failUnlessEqual(dsds[2,1,1,2],0.0,"ds/ds has wrong value at (2,1,1,2).")  
       self.failUnlessEqual(dsds[2,1,1,3],0.0,"ds/ds has wrong value at (2,1,1,3).")  
       self.failUnlessEqual(dsds[2,1,1,4],0.0,"ds/ds has wrong value at (2,1,1,4).")  
       self.failUnlessEqual(dsds[2,1,2,0],0.0,"ds/ds has wrong value at (2,1,2,0).")  
       self.failUnlessEqual(dsds[2,1,2,1],1.0,"ds/ds has wrong value at (2,1,2,1).")  
       self.failUnlessEqual(dsds[2,1,2,2],0.0,"ds/ds has wrong value at (2,1,2,2).")  
       self.failUnlessEqual(dsds[2,1,2,3],0.0,"ds/ds has wrong value at (2,1,2,3).")  
       self.failUnlessEqual(dsds[2,1,2,4],0.0,"ds/ds has wrong value at (2,1,2,4).")  
       self.failUnlessEqual(dsds[2,1,3,0],0.0,"ds/ds has wrong value at (2,1,3,0).")  
       self.failUnlessEqual(dsds[2,1,3,1],0.0,"ds/ds has wrong value at (2,1,3,1).")  
       self.failUnlessEqual(dsds[2,1,3,2],0.0,"ds/ds has wrong value at (2,1,3,2).")  
       self.failUnlessEqual(dsds[2,1,3,3],0.0,"ds/ds has wrong value at (2,1,3,3).")  
       self.failUnlessEqual(dsds[2,1,3,4],0.0,"ds/ds has wrong value at (2,1,3,4).")  
       self.failUnlessEqual(dsds[2,2,0,0],0.0,"ds/ds has wrong value at (2,2,0,0).")  
       self.failUnlessEqual(dsds[2,2,0,1],0.0,"ds/ds has wrong value at (2,2,0,1).")  
       self.failUnlessEqual(dsds[2,2,0,2],0.0,"ds/ds has wrong value at (2,2,0,2).")  
       self.failUnlessEqual(dsds[2,2,0,3],0.0,"ds/ds has wrong value at (2,2,0,3).")  
       self.failUnlessEqual(dsds[2,2,0,4],0.0,"ds/ds has wrong value at (2,2,0,4).")  
       self.failUnlessEqual(dsds[2,2,1,0],0.0,"ds/ds has wrong value at (2,2,1,0).")  
       self.failUnlessEqual(dsds[2,2,1,1],0.0,"ds/ds has wrong value at (2,2,1,1).")  
       self.failUnlessEqual(dsds[2,2,1,2],0.0,"ds/ds has wrong value at (2,2,1,2).")  
       self.failUnlessEqual(dsds[2,2,1,3],0.0,"ds/ds has wrong value at (2,2,1,3).")  
       self.failUnlessEqual(dsds[2,2,1,4],0.0,"ds/ds has wrong value at (2,2,1,4).")  
       self.failUnlessEqual(dsds[2,2,2,0],0.0,"ds/ds has wrong value at (2,2,2,0).")  
       self.failUnlessEqual(dsds[2,2,2,1],0.0,"ds/ds has wrong value at (2,2,2,1).")  
       self.failUnlessEqual(dsds[2,2,2,2],1.0,"ds/ds has wrong value at (2,2,2,2).")  
       self.failUnlessEqual(dsds[2,2,2,3],0.0,"ds/ds has wrong value at (2,2,2,3).")  
       self.failUnlessEqual(dsds[2,2,2,4],0.0,"ds/ds has wrong value at (2,2,2,4).")  
       self.failUnlessEqual(dsds[2,2,3,0],0.0,"ds/ds has wrong value at (2,2,3,0).")  
       self.failUnlessEqual(dsds[2,2,3,1],0.0,"ds/ds has wrong value at (2,2,3,1).")  
       self.failUnlessEqual(dsds[2,2,3,2],0.0,"ds/ds has wrong value at (2,2,3,2).")  
       self.failUnlessEqual(dsds[2,2,3,3],0.0,"ds/ds has wrong value at (2,2,3,3).")  
       self.failUnlessEqual(dsds[2,2,3,4],0.0,"ds/ds has wrong value at (2,2,3,4).")  
       self.failUnlessEqual(dsds[2,3,0,0],0.0,"ds/ds has wrong value at (2,3,0,0).")  
       self.failUnlessEqual(dsds[2,3,0,1],0.0,"ds/ds has wrong value at (2,3,0,1).")  
       self.failUnlessEqual(dsds[2,3,0,2],0.0,"ds/ds has wrong value at (2,3,0,2).")  
       self.failUnlessEqual(dsds[2,3,0,3],0.0,"ds/ds has wrong value at (2,3,0,3).")  
       self.failUnlessEqual(dsds[2,3,0,4],0.0,"ds/ds has wrong value at (2,3,0,4).")  
       self.failUnlessEqual(dsds[2,3,1,0],0.0,"ds/ds has wrong value at (2,3,1,0).")  
       self.failUnlessEqual(dsds[2,3,1,1],0.0,"ds/ds has wrong value at (2,3,1,1).")  
       self.failUnlessEqual(dsds[2,3,1,2],0.0,"ds/ds has wrong value at (2,3,1,2).")  
       self.failUnlessEqual(dsds[2,3,1,3],0.0,"ds/ds has wrong value at (2,3,1,3).")  
       self.failUnlessEqual(dsds[2,3,1,4],0.0,"ds/ds has wrong value at (2,3,1,4).")  
       self.failUnlessEqual(dsds[2,3,2,0],0.0,"ds/ds has wrong value at (2,3,2,0).")  
       self.failUnlessEqual(dsds[2,3,2,1],0.0,"ds/ds has wrong value at (2,3,2,1).")  
       self.failUnlessEqual(dsds[2,3,2,2],0.0,"ds/ds has wrong value at (2,3,2,2).")  
       self.failUnlessEqual(dsds[2,3,2,3],1.0,"ds/ds has wrong value at (2,3,2,3).")  
       self.failUnlessEqual(dsds[2,3,2,4],0.0,"ds/ds has wrong value at (2,3,2,4).")  
       self.failUnlessEqual(dsds[2,3,3,0],0.0,"ds/ds has wrong value at (2,3,3,0).")  
       self.failUnlessEqual(dsds[2,3,3,1],0.0,"ds/ds has wrong value at (2,3,3,1).")  
       self.failUnlessEqual(dsds[2,3,3,2],0.0,"ds/ds has wrong value at (2,3,3,2).")  
       self.failUnlessEqual(dsds[2,3,3,3],0.0,"ds/ds has wrong value at (2,3,3,3).")  
       self.failUnlessEqual(dsds[2,3,3,4],0.0,"ds/ds has wrong value at (2,3,3,4).")  
       self.failUnlessEqual(dsds[2,4,0,0],0.0,"ds/ds has wrong value at (2,4,0,0).")  
       self.failUnlessEqual(dsds[2,4,0,1],0.0,"ds/ds has wrong value at (2,4,0,1).")  
       self.failUnlessEqual(dsds[2,4,0,2],0.0,"ds/ds has wrong value at (2,4,0,2).")  
       self.failUnlessEqual(dsds[2,4,0,3],0.0,"ds/ds has wrong value at (2,4,0,3).")  
       self.failUnlessEqual(dsds[2,4,0,4],0.0,"ds/ds has wrong value at (2,4,0,4).")  
       self.failUnlessEqual(dsds[2,4,1,0],0.0,"ds/ds has wrong value at (2,4,1,0).")  
       self.failUnlessEqual(dsds[2,4,1,1],0.0,"ds/ds has wrong value at (2,4,1,1).")  
       self.failUnlessEqual(dsds[2,4,1,2],0.0,"ds/ds has wrong value at (2,4,1,2).")  
       self.failUnlessEqual(dsds[2,4,1,3],0.0,"ds/ds has wrong value at (2,4,1,3).")  
       self.failUnlessEqual(dsds[2,4,1,4],0.0,"ds/ds has wrong value at (2,4,1,4).")  
       self.failUnlessEqual(dsds[2,4,2,0],0.0,"ds/ds has wrong value at (2,4,2,0).")  
       self.failUnlessEqual(dsds[2,4,2,1],0.0,"ds/ds has wrong value at (2,4,2,1).")  
       self.failUnlessEqual(dsds[2,4,2,2],0.0,"ds/ds has wrong value at (2,4,2,2).")  
       self.failUnlessEqual(dsds[2,4,2,3],0.0,"ds/ds has wrong value at (2,4,2,3).")  
       self.failUnlessEqual(dsds[2,4,2,4],1.0,"ds/ds has wrong value at (2,4,2,4).")  
       self.failUnlessEqual(dsds[2,4,3,0],0.0,"ds/ds has wrong value at (2,4,3,0).")  
       self.failUnlessEqual(dsds[2,4,3,1],0.0,"ds/ds has wrong value at (2,4,3,1).")  
       self.failUnlessEqual(dsds[2,4,3,2],0.0,"ds/ds has wrong value at (2,4,3,2).")  
       self.failUnlessEqual(dsds[2,4,3,3],0.0,"ds/ds has wrong value at (2,4,3,3).")  
       self.failUnlessEqual(dsds[2,4,3,4],0.0,"ds/ds has wrong value at (2,4,3,4).")  
       self.failUnlessEqual(dsds[3,0,0,0],0.0,"ds/ds has wrong value at (3,0,0,0).")  
       self.failUnlessEqual(dsds[3,0,0,1],0.0,"ds/ds has wrong value at (3,0,0,1).")  
       self.failUnlessEqual(dsds[3,0,0,2],0.0,"ds/ds has wrong value at (3,0,0,2).")  
       self.failUnlessEqual(dsds[3,0,0,3],0.0,"ds/ds has wrong value at (3,0,0,3).")  
       self.failUnlessEqual(dsds[3,0,0,4],0.0,"ds/ds has wrong value at (3,0,0,4).")  
       self.failUnlessEqual(dsds[3,0,1,0],0.0,"ds/ds has wrong value at (3,0,1,0).")  
       self.failUnlessEqual(dsds[3,0,1,1],0.0,"ds/ds has wrong value at (3,0,1,1).")  
       self.failUnlessEqual(dsds[3,0,1,2],0.0,"ds/ds has wrong value at (3,0,1,2).")  
       self.failUnlessEqual(dsds[3,0,1,3],0.0,"ds/ds has wrong value at (3,0,1,3).")  
       self.failUnlessEqual(dsds[3,0,1,4],0.0,"ds/ds has wrong value at (3,0,1,4).")  
       self.failUnlessEqual(dsds[3,0,2,0],0.0,"ds/ds has wrong value at (3,0,2,0).")  
       self.failUnlessEqual(dsds[3,0,2,1],0.0,"ds/ds has wrong value at (3,0,2,1).")  
       self.failUnlessEqual(dsds[3,0,2,2],0.0,"ds/ds has wrong value at (3,0,2,2).")  
       self.failUnlessEqual(dsds[3,0,2,3],0.0,"ds/ds has wrong value at (3,0,2,3).")  
       self.failUnlessEqual(dsds[3,0,2,4],0.0,"ds/ds has wrong value at (3,0,2,4).")  
       self.failUnlessEqual(dsds[3,0,3,0],1.0,"ds/ds has wrong value at (3,0,3,0).")  
       self.failUnlessEqual(dsds[3,0,3,1],0.0,"ds/ds has wrong value at (3,0,3,1).")  
       self.failUnlessEqual(dsds[3,0,3,2],0.0,"ds/ds has wrong value at (3,0,3,2).")  
       self.failUnlessEqual(dsds[3,0,3,3],0.0,"ds/ds has wrong value at (3,0,3,3).")  
       self.failUnlessEqual(dsds[3,0,3,4],0.0,"ds/ds has wrong value at (3,0,3,4).")  
       self.failUnlessEqual(dsds[3,1,0,0],0.0,"ds/ds has wrong value at (3,1,0,0).")  
       self.failUnlessEqual(dsds[3,1,0,1],0.0,"ds/ds has wrong value at (3,1,0,1).")  
       self.failUnlessEqual(dsds[3,1,0,2],0.0,"ds/ds has wrong value at (3,1,0,2).")  
       self.failUnlessEqual(dsds[3,1,0,3],0.0,"ds/ds has wrong value at (3,1,0,3).")  
       self.failUnlessEqual(dsds[3,1,0,4],0.0,"ds/ds has wrong value at (3,1,0,4).")  
       self.failUnlessEqual(dsds[3,1,1,0],0.0,"ds/ds has wrong value at (3,1,1,0).")  
       self.failUnlessEqual(dsds[3,1,1,1],0.0,"ds/ds has wrong value at (3,1,1,1).")  
       self.failUnlessEqual(dsds[3,1,1,2],0.0,"ds/ds has wrong value at (3,1,1,2).")  
       self.failUnlessEqual(dsds[3,1,1,3],0.0,"ds/ds has wrong value at (3,1,1,3).")  
       self.failUnlessEqual(dsds[3,1,1,4],0.0,"ds/ds has wrong value at (3,1,1,4).")  
       self.failUnlessEqual(dsds[3,1,2,0],0.0,"ds/ds has wrong value at (3,1,2,0).")  
       self.failUnlessEqual(dsds[3,1,2,1],0.0,"ds/ds has wrong value at (3,1,2,1).")  
       self.failUnlessEqual(dsds[3,1,2,2],0.0,"ds/ds has wrong value at (3,1,2,2).")  
       self.failUnlessEqual(dsds[3,1,2,3],0.0,"ds/ds has wrong value at (3,1,2,3).")  
       self.failUnlessEqual(dsds[3,1,2,4],0.0,"ds/ds has wrong value at (3,1,2,4).")  
       self.failUnlessEqual(dsds[3,1,3,0],0.0,"ds/ds has wrong value at (3,1,3,0).")  
       self.failUnlessEqual(dsds[3,1,3,1],1.0,"ds/ds has wrong value at (3,1,3,1).")  
       self.failUnlessEqual(dsds[3,1,3,2],0.0,"ds/ds has wrong value at (3,1,3,2).")  
       self.failUnlessEqual(dsds[3,1,3,3],0.0,"ds/ds has wrong value at (3,1,3,3).")  
       self.failUnlessEqual(dsds[3,1,3,4],0.0,"ds/ds has wrong value at (3,1,3,4).")  
       self.failUnlessEqual(dsds[3,2,0,0],0.0,"ds/ds has wrong value at (3,2,0,0).")  
       self.failUnlessEqual(dsds[3,2,0,1],0.0,"ds/ds has wrong value at (3,2,0,1).")  
       self.failUnlessEqual(dsds[3,2,0,2],0.0,"ds/ds has wrong value at (3,2,0,2).")  
       self.failUnlessEqual(dsds[3,2,0,3],0.0,"ds/ds has wrong value at (3,2,0,3).")  
       self.failUnlessEqual(dsds[3,2,0,4],0.0,"ds/ds has wrong value at (3,2,0,4).")  
       self.failUnlessEqual(dsds[3,2,1,0],0.0,"ds/ds has wrong value at (3,2,1,0).")  
       self.failUnlessEqual(dsds[3,2,1,1],0.0,"ds/ds has wrong value at (3,2,1,1).")  
       self.failUnlessEqual(dsds[3,2,1,2],0.0,"ds/ds has wrong value at (3,2,1,2).")  
       self.failUnlessEqual(dsds[3,2,1,3],0.0,"ds/ds has wrong value at (3,2,1,3).")  
       self.failUnlessEqual(dsds[3,2,1,4],0.0,"ds/ds has wrong value at (3,2,1,4).")  
       self.failUnlessEqual(dsds[3,2,2,0],0.0,"ds/ds has wrong value at (3,2,2,0).")  
       self.failUnlessEqual(dsds[3,2,2,1],0.0,"ds/ds has wrong value at (3,2,2,1).")  
       self.failUnlessEqual(dsds[3,2,2,2],0.0,"ds/ds has wrong value at (3,2,2,2).")  
       self.failUnlessEqual(dsds[3,2,2,3],0.0,"ds/ds has wrong value at (3,2,2,3).")  
       self.failUnlessEqual(dsds[3,2,2,4],0.0,"ds/ds has wrong value at (3,2,2,4).")  
       self.failUnlessEqual(dsds[3,2,3,0],0.0,"ds/ds has wrong value at (3,2,3,0).")  
       self.failUnlessEqual(dsds[3,2,3,1],0.0,"ds/ds has wrong value at (3,2,3,1).")  
       self.failUnlessEqual(dsds[3,2,3,2],1.0,"ds/ds has wrong value at (3,2,3,2).")  
       self.failUnlessEqual(dsds[3,2,3,3],0.0,"ds/ds has wrong value at (3,2,3,3).")  
       self.failUnlessEqual(dsds[3,2,3,4],0.0,"ds/ds has wrong value at (3,2,3,4).")  
       self.failUnlessEqual(dsds[3,3,0,0],0.0,"ds/ds has wrong value at (3,3,0,0).")  
       self.failUnlessEqual(dsds[3,3,0,1],0.0,"ds/ds has wrong value at (3,3,0,1).")  
       self.failUnlessEqual(dsds[3,3,0,2],0.0,"ds/ds has wrong value at (3,3,0,2).")  
       self.failUnlessEqual(dsds[3,3,0,3],0.0,"ds/ds has wrong value at (3,3,0,3).")  
       self.failUnlessEqual(dsds[3,3,0,4],0.0,"ds/ds has wrong value at (3,3,0,4).")  
       self.failUnlessEqual(dsds[3,3,1,0],0.0,"ds/ds has wrong value at (3,3,1,0).")  
       self.failUnlessEqual(dsds[3,3,1,1],0.0,"ds/ds has wrong value at (3,3,1,1).")  
       self.failUnlessEqual(dsds[3,3,1,2],0.0,"ds/ds has wrong value at (3,3,1,2).")  
       self.failUnlessEqual(dsds[3,3,1,3],0.0,"ds/ds has wrong value at (3,3,1,3).")  
       self.failUnlessEqual(dsds[3,3,1,4],0.0,"ds/ds has wrong value at (3,3,1,4).")  
       self.failUnlessEqual(dsds[3,3,2,0],0.0,"ds/ds has wrong value at (3,3,2,0).")  
       self.failUnlessEqual(dsds[3,3,2,1],0.0,"ds/ds has wrong value at (3,3,2,1).")  
       self.failUnlessEqual(dsds[3,3,2,2],0.0,"ds/ds has wrong value at (3,3,2,2).")  
       self.failUnlessEqual(dsds[3,3,2,3],0.0,"ds/ds has wrong value at (3,3,2,3).")  
       self.failUnlessEqual(dsds[3,3,2,4],0.0,"ds/ds has wrong value at (3,3,2,4).")  
       self.failUnlessEqual(dsds[3,3,3,0],0.0,"ds/ds has wrong value at (3,3,3,0).")  
       self.failUnlessEqual(dsds[3,3,3,1],0.0,"ds/ds has wrong value at (3,3,3,1).")  
       self.failUnlessEqual(dsds[3,3,3,2],0.0,"ds/ds has wrong value at (3,3,3,2).")  
       self.failUnlessEqual(dsds[3,3,3,3],1.0,"ds/ds has wrong value at (3,3,3,3).")  
       self.failUnlessEqual(dsds[3,3,3,4],0.0,"ds/ds has wrong value at (3,3,3,4).")  
       self.failUnlessEqual(dsds[3,4,0,0],0.0,"ds/ds has wrong value at (3,4,0,0).")  
       self.failUnlessEqual(dsds[3,4,0,1],0.0,"ds/ds has wrong value at (3,4,0,1).")  
       self.failUnlessEqual(dsds[3,4,0,2],0.0,"ds/ds has wrong value at (3,4,0,2).")  
       self.failUnlessEqual(dsds[3,4,0,3],0.0,"ds/ds has wrong value at (3,4,0,3).")  
       self.failUnlessEqual(dsds[3,4,0,4],0.0,"ds/ds has wrong value at (3,4,0,4).")  
       self.failUnlessEqual(dsds[3,4,1,0],0.0,"ds/ds has wrong value at (3,4,1,0).")  
       self.failUnlessEqual(dsds[3,4,1,1],0.0,"ds/ds has wrong value at (3,4,1,1).")  
       self.failUnlessEqual(dsds[3,4,1,2],0.0,"ds/ds has wrong value at (3,4,1,2).")  
       self.failUnlessEqual(dsds[3,4,1,3],0.0,"ds/ds has wrong value at (3,4,1,3).")  
       self.failUnlessEqual(dsds[3,4,1,4],0.0,"ds/ds has wrong value at (3,4,1,4).")  
       self.failUnlessEqual(dsds[3,4,2,0],0.0,"ds/ds has wrong value at (3,4,2,0).")  
       self.failUnlessEqual(dsds[3,4,2,1],0.0,"ds/ds has wrong value at (3,4,2,1).")  
       self.failUnlessEqual(dsds[3,4,2,2],0.0,"ds/ds has wrong value at (3,4,2,2).")  
       self.failUnlessEqual(dsds[3,4,2,3],0.0,"ds/ds has wrong value at (3,4,2,3).")  
       self.failUnlessEqual(dsds[3,4,2,4],0.0,"ds/ds has wrong value at (3,4,2,4).")  
       self.failUnlessEqual(dsds[3,4,3,0],0.0,"ds/ds has wrong value at (3,4,3,0).")  
       self.failUnlessEqual(dsds[3,4,3,1],0.0,"ds/ds has wrong value at (3,4,3,1).")  
       self.failUnlessEqual(dsds[3,4,3,2],0.0,"ds/ds has wrong value at (3,4,3,2).")  
       self.failUnlessEqual(dsds[3,4,3,3],0.0,"ds/ds has wrong value at (3,4,3,3).")  
       self.failUnlessEqual(dsds[3,4,3,4],1.0,"ds/ds has wrong value at (3,4,3,4).")  
   
       self.failUnlessEqual(s.getArgument(0),1,"wrong argument 0.")  
       self.failUnlessEqual(s.getArgument(1),-1.0,"wrong argument 1.")  
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),2,"wrong number of substituted arguments")  
       self.failUnlessEqual(sa[0],1,"wrongly substituted argument 0.")  
       self.failUnlessEqual(sa[1],-1.0,"wrongly substituted argument 1.")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(4, 5),dim=self.functionspace.getDim())),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(5,))),"Symbol is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(escript.Data(0.,(4, 5),self.functionspace)),"Data is appropriate substitute")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((4, 5))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank2_d1_nargs0(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(4, 5),dim=1,args=[])  
       self.failUnlessEqual(s.getRank(),2,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(4, 5),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),1,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((4, 5))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(4, 5),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(4, 5, 4, 5),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0,0,0],1.0,"ds/ds has wrong value at (0,0,0,0).")  
       self.failUnlessEqual(dsds[0,0,0,1],0.0,"ds/ds has wrong value at (0,0,0,1).")  
       self.failUnlessEqual(dsds[0,0,0,2],0.0,"ds/ds has wrong value at (0,0,0,2).")  
       self.failUnlessEqual(dsds[0,0,0,3],0.0,"ds/ds has wrong value at (0,0,0,3).")  
       self.failUnlessEqual(dsds[0,0,0,4],0.0,"ds/ds has wrong value at (0,0,0,4).")  
       self.failUnlessEqual(dsds[0,0,1,0],0.0,"ds/ds has wrong value at (0,0,1,0).")  
       self.failUnlessEqual(dsds[0,0,1,1],0.0,"ds/ds has wrong value at (0,0,1,1).")  
       self.failUnlessEqual(dsds[0,0,1,2],0.0,"ds/ds has wrong value at (0,0,1,2).")  
       self.failUnlessEqual(dsds[0,0,1,3],0.0,"ds/ds has wrong value at (0,0,1,3).")  
       self.failUnlessEqual(dsds[0,0,1,4],0.0,"ds/ds has wrong value at (0,0,1,4).")  
       self.failUnlessEqual(dsds[0,0,2,0],0.0,"ds/ds has wrong value at (0,0,2,0).")  
       self.failUnlessEqual(dsds[0,0,2,1],0.0,"ds/ds has wrong value at (0,0,2,1).")  
       self.failUnlessEqual(dsds[0,0,2,2],0.0,"ds/ds has wrong value at (0,0,2,2).")  
       self.failUnlessEqual(dsds[0,0,2,3],0.0,"ds/ds has wrong value at (0,0,2,3).")  
       self.failUnlessEqual(dsds[0,0,2,4],0.0,"ds/ds has wrong value at (0,0,2,4).")  
       self.failUnlessEqual(dsds[0,0,3,0],0.0,"ds/ds has wrong value at (0,0,3,0).")  
       self.failUnlessEqual(dsds[0,0,3,1],0.0,"ds/ds has wrong value at (0,0,3,1).")  
       self.failUnlessEqual(dsds[0,0,3,2],0.0,"ds/ds has wrong value at (0,0,3,2).")  
       self.failUnlessEqual(dsds[0,0,3,3],0.0,"ds/ds has wrong value at (0,0,3,3).")  
       self.failUnlessEqual(dsds[0,0,3,4],0.0,"ds/ds has wrong value at (0,0,3,4).")  
       self.failUnlessEqual(dsds[0,1,0,0],0.0,"ds/ds has wrong value at (0,1,0,0).")  
       self.failUnlessEqual(dsds[0,1,0,1],1.0,"ds/ds has wrong value at (0,1,0,1).")  
       self.failUnlessEqual(dsds[0,1,0,2],0.0,"ds/ds has wrong value at (0,1,0,2).")  
       self.failUnlessEqual(dsds[0,1,0,3],0.0,"ds/ds has wrong value at (0,1,0,3).")  
       self.failUnlessEqual(dsds[0,1,0,4],0.0,"ds/ds has wrong value at (0,1,0,4).")  
       self.failUnlessEqual(dsds[0,1,1,0],0.0,"ds/ds has wrong value at (0,1,1,0).")  
       self.failUnlessEqual(dsds[0,1,1,1],0.0,"ds/ds has wrong value at (0,1,1,1).")  
       self.failUnlessEqual(dsds[0,1,1,2],0.0,"ds/ds has wrong value at (0,1,1,2).")  
       self.failUnlessEqual(dsds[0,1,1,3],0.0,"ds/ds has wrong value at (0,1,1,3).")  
       self.failUnlessEqual(dsds[0,1,1,4],0.0,"ds/ds has wrong value at (0,1,1,4).")  
       self.failUnlessEqual(dsds[0,1,2,0],0.0,"ds/ds has wrong value at (0,1,2,0).")  
       self.failUnlessEqual(dsds[0,1,2,1],0.0,"ds/ds has wrong value at (0,1,2,1).")  
       self.failUnlessEqual(dsds[0,1,2,2],0.0,"ds/ds has wrong value at (0,1,2,2).")  
       self.failUnlessEqual(dsds[0,1,2,3],0.0,"ds/ds has wrong value at (0,1,2,3).")  
       self.failUnlessEqual(dsds[0,1,2,4],0.0,"ds/ds has wrong value at (0,1,2,4).")  
       self.failUnlessEqual(dsds[0,1,3,0],0.0,"ds/ds has wrong value at (0,1,3,0).")  
       self.failUnlessEqual(dsds[0,1,3,1],0.0,"ds/ds has wrong value at (0,1,3,1).")  
       self.failUnlessEqual(dsds[0,1,3,2],0.0,"ds/ds has wrong value at (0,1,3,2).")  
       self.failUnlessEqual(dsds[0,1,3,3],0.0,"ds/ds has wrong value at (0,1,3,3).")  
       self.failUnlessEqual(dsds[0,1,3,4],0.0,"ds/ds has wrong value at (0,1,3,4).")  
       self.failUnlessEqual(dsds[0,2,0,0],0.0,"ds/ds has wrong value at (0,2,0,0).")  
       self.failUnlessEqual(dsds[0,2,0,1],0.0,"ds/ds has wrong value at (0,2,0,1).")  
       self.failUnlessEqual(dsds[0,2,0,2],1.0,"ds/ds has wrong value at (0,2,0,2).")  
       self.failUnlessEqual(dsds[0,2,0,3],0.0,"ds/ds has wrong value at (0,2,0,3).")  
       self.failUnlessEqual(dsds[0,2,0,4],0.0,"ds/ds has wrong value at (0,2,0,4).")  
       self.failUnlessEqual(dsds[0,2,1,0],0.0,"ds/ds has wrong value at (0,2,1,0).")  
       self.failUnlessEqual(dsds[0,2,1,1],0.0,"ds/ds has wrong value at (0,2,1,1).")  
       self.failUnlessEqual(dsds[0,2,1,2],0.0,"ds/ds has wrong value at (0,2,1,2).")  
       self.failUnlessEqual(dsds[0,2,1,3],0.0,"ds/ds has wrong value at (0,2,1,3).")  
       self.failUnlessEqual(dsds[0,2,1,4],0.0,"ds/ds has wrong value at (0,2,1,4).")  
       self.failUnlessEqual(dsds[0,2,2,0],0.0,"ds/ds has wrong value at (0,2,2,0).")  
       self.failUnlessEqual(dsds[0,2,2,1],0.0,"ds/ds has wrong value at (0,2,2,1).")  
       self.failUnlessEqual(dsds[0,2,2,2],0.0,"ds/ds has wrong value at (0,2,2,2).")  
       self.failUnlessEqual(dsds[0,2,2,3],0.0,"ds/ds has wrong value at (0,2,2,3).")  
       self.failUnlessEqual(dsds[0,2,2,4],0.0,"ds/ds has wrong value at (0,2,2,4).")  
       self.failUnlessEqual(dsds[0,2,3,0],0.0,"ds/ds has wrong value at (0,2,3,0).")  
       self.failUnlessEqual(dsds[0,2,3,1],0.0,"ds/ds has wrong value at (0,2,3,1).")  
       self.failUnlessEqual(dsds[0,2,3,2],0.0,"ds/ds has wrong value at (0,2,3,2).")  
       self.failUnlessEqual(dsds[0,2,3,3],0.0,"ds/ds has wrong value at (0,2,3,3).")  
       self.failUnlessEqual(dsds[0,2,3,4],0.0,"ds/ds has wrong value at (0,2,3,4).")  
       self.failUnlessEqual(dsds[0,3,0,0],0.0,"ds/ds has wrong value at (0,3,0,0).")  
       self.failUnlessEqual(dsds[0,3,0,1],0.0,"ds/ds has wrong value at (0,3,0,1).")  
       self.failUnlessEqual(dsds[0,3,0,2],0.0,"ds/ds has wrong value at (0,3,0,2).")  
       self.failUnlessEqual(dsds[0,3,0,3],1.0,"ds/ds has wrong value at (0,3,0,3).")  
       self.failUnlessEqual(dsds[0,3,0,4],0.0,"ds/ds has wrong value at (0,3,0,4).")  
       self.failUnlessEqual(dsds[0,3,1,0],0.0,"ds/ds has wrong value at (0,3,1,0).")  
       self.failUnlessEqual(dsds[0,3,1,1],0.0,"ds/ds has wrong value at (0,3,1,1).")  
       self.failUnlessEqual(dsds[0,3,1,2],0.0,"ds/ds has wrong value at (0,3,1,2).")  
       self.failUnlessEqual(dsds[0,3,1,3],0.0,"ds/ds has wrong value at (0,3,1,3).")  
       self.failUnlessEqual(dsds[0,3,1,4],0.0,"ds/ds has wrong value at (0,3,1,4).")  
       self.failUnlessEqual(dsds[0,3,2,0],0.0,"ds/ds has wrong value at (0,3,2,0).")  
       self.failUnlessEqual(dsds[0,3,2,1],0.0,"ds/ds has wrong value at (0,3,2,1).")  
       self.failUnlessEqual(dsds[0,3,2,2],0.0,"ds/ds has wrong value at (0,3,2,2).")  
       self.failUnlessEqual(dsds[0,3,2,3],0.0,"ds/ds has wrong value at (0,3,2,3).")  
       self.failUnlessEqual(dsds[0,3,2,4],0.0,"ds/ds has wrong value at (0,3,2,4).")  
       self.failUnlessEqual(dsds[0,3,3,0],0.0,"ds/ds has wrong value at (0,3,3,0).")  
       self.failUnlessEqual(dsds[0,3,3,1],0.0,"ds/ds has wrong value at (0,3,3,1).")  
       self.failUnlessEqual(dsds[0,3,3,2],0.0,"ds/ds has wrong value at (0,3,3,2).")  
       self.failUnlessEqual(dsds[0,3,3,3],0.0,"ds/ds has wrong value at (0,3,3,3).")  
       self.failUnlessEqual(dsds[0,3,3,4],0.0,"ds/ds has wrong value at (0,3,3,4).")  
       self.failUnlessEqual(dsds[0,4,0,0],0.0,"ds/ds has wrong value at (0,4,0,0).")  
       self.failUnlessEqual(dsds[0,4,0,1],0.0,"ds/ds has wrong value at (0,4,0,1).")  
       self.failUnlessEqual(dsds[0,4,0,2],0.0,"ds/ds has wrong value at (0,4,0,2).")  
       self.failUnlessEqual(dsds[0,4,0,3],0.0,"ds/ds has wrong value at (0,4,0,3).")  
       self.failUnlessEqual(dsds[0,4,0,4],1.0,"ds/ds has wrong value at (0,4,0,4).")  
       self.failUnlessEqual(dsds[0,4,1,0],0.0,"ds/ds has wrong value at (0,4,1,0).")  
       self.failUnlessEqual(dsds[0,4,1,1],0.0,"ds/ds has wrong value at (0,4,1,1).")  
       self.failUnlessEqual(dsds[0,4,1,2],0.0,"ds/ds has wrong value at (0,4,1,2).")  
       self.failUnlessEqual(dsds[0,4,1,3],0.0,"ds/ds has wrong value at (0,4,1,3).")  
       self.failUnlessEqual(dsds[0,4,1,4],0.0,"ds/ds has wrong value at (0,4,1,4).")  
       self.failUnlessEqual(dsds[0,4,2,0],0.0,"ds/ds has wrong value at (0,4,2,0).")  
       self.failUnlessEqual(dsds[0,4,2,1],0.0,"ds/ds has wrong value at (0,4,2,1).")  
       self.failUnlessEqual(dsds[0,4,2,2],0.0,"ds/ds has wrong value at (0,4,2,2).")  
       self.failUnlessEqual(dsds[0,4,2,3],0.0,"ds/ds has wrong value at (0,4,2,3).")  
       self.failUnlessEqual(dsds[0,4,2,4],0.0,"ds/ds has wrong value at (0,4,2,4).")  
       self.failUnlessEqual(dsds[0,4,3,0],0.0,"ds/ds has wrong value at (0,4,3,0).")  
       self.failUnlessEqual(dsds[0,4,3,1],0.0,"ds/ds has wrong value at (0,4,3,1).")  
       self.failUnlessEqual(dsds[0,4,3,2],0.0,"ds/ds has wrong value at (0,4,3,2).")  
       self.failUnlessEqual(dsds[0,4,3,3],0.0,"ds/ds has wrong value at (0,4,3,3).")  
       self.failUnlessEqual(dsds[0,4,3,4],0.0,"ds/ds has wrong value at (0,4,3,4).")  
       self.failUnlessEqual(dsds[1,0,0,0],0.0,"ds/ds has wrong value at (1,0,0,0).")  
       self.failUnlessEqual(dsds[1,0,0,1],0.0,"ds/ds has wrong value at (1,0,0,1).")  
       self.failUnlessEqual(dsds[1,0,0,2],0.0,"ds/ds has wrong value at (1,0,0,2).")  
       self.failUnlessEqual(dsds[1,0,0,3],0.0,"ds/ds has wrong value at (1,0,0,3).")  
       self.failUnlessEqual(dsds[1,0,0,4],0.0,"ds/ds has wrong value at (1,0,0,4).")  
       self.failUnlessEqual(dsds[1,0,1,0],1.0,"ds/ds has wrong value at (1,0,1,0).")  
       self.failUnlessEqual(dsds[1,0,1,1],0.0,"ds/ds has wrong value at (1,0,1,1).")  
       self.failUnlessEqual(dsds[1,0,1,2],0.0,"ds/ds has wrong value at (1,0,1,2).")  
       self.failUnlessEqual(dsds[1,0,1,3],0.0,"ds/ds has wrong value at (1,0,1,3).")  
       self.failUnlessEqual(dsds[1,0,1,4],0.0,"ds/ds has wrong value at (1,0,1,4).")  
       self.failUnlessEqual(dsds[1,0,2,0],0.0,"ds/ds has wrong value at (1,0,2,0).")  
       self.failUnlessEqual(dsds[1,0,2,1],0.0,"ds/ds has wrong value at (1,0,2,1).")  
       self.failUnlessEqual(dsds[1,0,2,2],0.0,"ds/ds has wrong value at (1,0,2,2).")  
       self.failUnlessEqual(dsds[1,0,2,3],0.0,"ds/ds has wrong value at (1,0,2,3).")  
       self.failUnlessEqual(dsds[1,0,2,4],0.0,"ds/ds has wrong value at (1,0,2,4).")  
       self.failUnlessEqual(dsds[1,0,3,0],0.0,"ds/ds has wrong value at (1,0,3,0).")  
       self.failUnlessEqual(dsds[1,0,3,1],0.0,"ds/ds has wrong value at (1,0,3,1).")  
       self.failUnlessEqual(dsds[1,0,3,2],0.0,"ds/ds has wrong value at (1,0,3,2).")  
       self.failUnlessEqual(dsds[1,0,3,3],0.0,"ds/ds has wrong value at (1,0,3,3).")  
       self.failUnlessEqual(dsds[1,0,3,4],0.0,"ds/ds has wrong value at (1,0,3,4).")  
       self.failUnlessEqual(dsds[1,1,0,0],0.0,"ds/ds has wrong value at (1,1,0,0).")  
       self.failUnlessEqual(dsds[1,1,0,1],0.0,"ds/ds has wrong value at (1,1,0,1).")  
       self.failUnlessEqual(dsds[1,1,0,2],0.0,"ds/ds has wrong value at (1,1,0,2).")  
       self.failUnlessEqual(dsds[1,1,0,3],0.0,"ds/ds has wrong value at (1,1,0,3).")  
       self.failUnlessEqual(dsds[1,1,0,4],0.0,"ds/ds has wrong value at (1,1,0,4).")  
       self.failUnlessEqual(dsds[1,1,1,0],0.0,"ds/ds has wrong value at (1,1,1,0).")  
       self.failUnlessEqual(dsds[1,1,1,1],1.0,"ds/ds has wrong value at (1,1,1,1).")  
       self.failUnlessEqual(dsds[1,1,1,2],0.0,"ds/ds has wrong value at (1,1,1,2).")  
       self.failUnlessEqual(dsds[1,1,1,3],0.0,"ds/ds has wrong value at (1,1,1,3).")  
       self.failUnlessEqual(dsds[1,1,1,4],0.0,"ds/ds has wrong value at (1,1,1,4).")  
       self.failUnlessEqual(dsds[1,1,2,0],0.0,"ds/ds has wrong value at (1,1,2,0).")  
       self.failUnlessEqual(dsds[1,1,2,1],0.0,"ds/ds has wrong value at (1,1,2,1).")  
       self.failUnlessEqual(dsds[1,1,2,2],0.0,"ds/ds has wrong value at (1,1,2,2).")  
       self.failUnlessEqual(dsds[1,1,2,3],0.0,"ds/ds has wrong value at (1,1,2,3).")  
       self.failUnlessEqual(dsds[1,1,2,4],0.0,"ds/ds has wrong value at (1,1,2,4).")  
       self.failUnlessEqual(dsds[1,1,3,0],0.0,"ds/ds has wrong value at (1,1,3,0).")  
       self.failUnlessEqual(dsds[1,1,3,1],0.0,"ds/ds has wrong value at (1,1,3,1).")  
       self.failUnlessEqual(dsds[1,1,3,2],0.0,"ds/ds has wrong value at (1,1,3,2).")  
       self.failUnlessEqual(dsds[1,1,3,3],0.0,"ds/ds has wrong value at (1,1,3,3).")  
       self.failUnlessEqual(dsds[1,1,3,4],0.0,"ds/ds has wrong value at (1,1,3,4).")  
       self.failUnlessEqual(dsds[1,2,0,0],0.0,"ds/ds has wrong value at (1,2,0,0).")  
       self.failUnlessEqual(dsds[1,2,0,1],0.0,"ds/ds has wrong value at (1,2,0,1).")  
       self.failUnlessEqual(dsds[1,2,0,2],0.0,"ds/ds has wrong value at (1,2,0,2).")  
       self.failUnlessEqual(dsds[1,2,0,3],0.0,"ds/ds has wrong value at (1,2,0,3).")  
       self.failUnlessEqual(dsds[1,2,0,4],0.0,"ds/ds has wrong value at (1,2,0,4).")  
       self.failUnlessEqual(dsds[1,2,1,0],0.0,"ds/ds has wrong value at (1,2,1,0).")  
       self.failUnlessEqual(dsds[1,2,1,1],0.0,"ds/ds has wrong value at (1,2,1,1).")  
       self.failUnlessEqual(dsds[1,2,1,2],1.0,"ds/ds has wrong value at (1,2,1,2).")  
       self.failUnlessEqual(dsds[1,2,1,3],0.0,"ds/ds has wrong value at (1,2,1,3).")  
       self.failUnlessEqual(dsds[1,2,1,4],0.0,"ds/ds has wrong value at (1,2,1,4).")  
       self.failUnlessEqual(dsds[1,2,2,0],0.0,"ds/ds has wrong value at (1,2,2,0).")  
       self.failUnlessEqual(dsds[1,2,2,1],0.0,"ds/ds has wrong value at (1,2,2,1).")  
       self.failUnlessEqual(dsds[1,2,2,2],0.0,"ds/ds has wrong value at (1,2,2,2).")  
       self.failUnlessEqual(dsds[1,2,2,3],0.0,"ds/ds has wrong value at (1,2,2,3).")  
       self.failUnlessEqual(dsds[1,2,2,4],0.0,"ds/ds has wrong value at (1,2,2,4).")  
       self.failUnlessEqual(dsds[1,2,3,0],0.0,"ds/ds has wrong value at (1,2,3,0).")  
       self.failUnlessEqual(dsds[1,2,3,1],0.0,"ds/ds has wrong value at (1,2,3,1).")  
       self.failUnlessEqual(dsds[1,2,3,2],0.0,"ds/ds has wrong value at (1,2,3,2).")  
       self.failUnlessEqual(dsds[1,2,3,3],0.0,"ds/ds has wrong value at (1,2,3,3).")  
       self.failUnlessEqual(dsds[1,2,3,4],0.0,"ds/ds has wrong value at (1,2,3,4).")  
       self.failUnlessEqual(dsds[1,3,0,0],0.0,"ds/ds has wrong value at (1,3,0,0).")  
       self.failUnlessEqual(dsds[1,3,0,1],0.0,"ds/ds has wrong value at (1,3,0,1).")  
       self.failUnlessEqual(dsds[1,3,0,2],0.0,"ds/ds has wrong value at (1,3,0,2).")  
       self.failUnlessEqual(dsds[1,3,0,3],0.0,"ds/ds has wrong value at (1,3,0,3).")  
       self.failUnlessEqual(dsds[1,3,0,4],0.0,"ds/ds has wrong value at (1,3,0,4).")  
       self.failUnlessEqual(dsds[1,3,1,0],0.0,"ds/ds has wrong value at (1,3,1,0).")  
       self.failUnlessEqual(dsds[1,3,1,1],0.0,"ds/ds has wrong value at (1,3,1,1).")  
       self.failUnlessEqual(dsds[1,3,1,2],0.0,"ds/ds has wrong value at (1,3,1,2).")  
       self.failUnlessEqual(dsds[1,3,1,3],1.0,"ds/ds has wrong value at (1,3,1,3).")  
       self.failUnlessEqual(dsds[1,3,1,4],0.0,"ds/ds has wrong value at (1,3,1,4).")  
       self.failUnlessEqual(dsds[1,3,2,0],0.0,"ds/ds has wrong value at (1,3,2,0).")  
       self.failUnlessEqual(dsds[1,3,2,1],0.0,"ds/ds has wrong value at (1,3,2,1).")  
       self.failUnlessEqual(dsds[1,3,2,2],0.0,"ds/ds has wrong value at (1,3,2,2).")  
       self.failUnlessEqual(dsds[1,3,2,3],0.0,"ds/ds has wrong value at (1,3,2,3).")  
       self.failUnlessEqual(dsds[1,3,2,4],0.0,"ds/ds has wrong value at (1,3,2,4).")  
       self.failUnlessEqual(dsds[1,3,3,0],0.0,"ds/ds has wrong value at (1,3,3,0).")  
       self.failUnlessEqual(dsds[1,3,3,1],0.0,"ds/ds has wrong value at (1,3,3,1).")  
       self.failUnlessEqual(dsds[1,3,3,2],0.0,"ds/ds has wrong value at (1,3,3,2).")  
       self.failUnlessEqual(dsds[1,3,3,3],0.0,"ds/ds has wrong value at (1,3,3,3).")  
       self.failUnlessEqual(dsds[1,3,3,4],0.0,"ds/ds has wrong value at (1,3,3,4).")  
       self.failUnlessEqual(dsds[1,4,0,0],0.0,"ds/ds has wrong value at (1,4,0,0).")  
       self.failUnlessEqual(dsds[1,4,0,1],0.0,"ds/ds has wrong value at (1,4,0,1).")  
       self.failUnlessEqual(dsds[1,4,0,2],0.0,"ds/ds has wrong value at (1,4,0,2).")  
       self.failUnlessEqual(dsds[1,4,0,3],0.0,"ds/ds has wrong value at (1,4,0,3).")  
       self.failUnlessEqual(dsds[1,4,0,4],0.0,"ds/ds has wrong value at (1,4,0,4).")  
       self.failUnlessEqual(dsds[1,4,1,0],0.0,"ds/ds has wrong value at (1,4,1,0).")  
       self.failUnlessEqual(dsds[1,4,1,1],0.0,"ds/ds has wrong value at (1,4,1,1).")  
       self.failUnlessEqual(dsds[1,4,1,2],0.0,"ds/ds has wrong value at (1,4,1,2).")  
       self.failUnlessEqual(dsds[1,4,1,3],0.0,"ds/ds has wrong value at (1,4,1,3).")  
       self.failUnlessEqual(dsds[1,4,1,4],1.0,"ds/ds has wrong value at (1,4,1,4).")  
       self.failUnlessEqual(dsds[1,4,2,0],0.0,"ds/ds has wrong value at (1,4,2,0).")  
       self.failUnlessEqual(dsds[1,4,2,1],0.0,"ds/ds has wrong value at (1,4,2,1).")  
       self.failUnlessEqual(dsds[1,4,2,2],0.0,"ds/ds has wrong value at (1,4,2,2).")  
       self.failUnlessEqual(dsds[1,4,2,3],0.0,"ds/ds has wrong value at (1,4,2,3).")  
       self.failUnlessEqual(dsds[1,4,2,4],0.0,"ds/ds has wrong value at (1,4,2,4).")  
       self.failUnlessEqual(dsds[1,4,3,0],0.0,"ds/ds has wrong value at (1,4,3,0).")  
       self.failUnlessEqual(dsds[1,4,3,1],0.0,"ds/ds has wrong value at (1,4,3,1).")  
       self.failUnlessEqual(dsds[1,4,3,2],0.0,"ds/ds has wrong value at (1,4,3,2).")  
       self.failUnlessEqual(dsds[1,4,3,3],0.0,"ds/ds has wrong value at (1,4,3,3).")  
       self.failUnlessEqual(dsds[1,4,3,4],0.0,"ds/ds has wrong value at (1,4,3,4).")  
       self.failUnlessEqual(dsds[2,0,0,0],0.0,"ds/ds has wrong value at (2,0,0,0).")  
       self.failUnlessEqual(dsds[2,0,0,1],0.0,"ds/ds has wrong value at (2,0,0,1).")  
       self.failUnlessEqual(dsds[2,0,0,2],0.0,"ds/ds has wrong value at (2,0,0,2).")  
       self.failUnlessEqual(dsds[2,0,0,3],0.0,"ds/ds has wrong value at (2,0,0,3).")  
       self.failUnlessEqual(dsds[2,0,0,4],0.0,"ds/ds has wrong value at (2,0,0,4).")  
       self.failUnlessEqual(dsds[2,0,1,0],0.0,"ds/ds has wrong value at (2,0,1,0).")  
       self.failUnlessEqual(dsds[2,0,1,1],0.0,"ds/ds has wrong value at (2,0,1,1).")  
       self.failUnlessEqual(dsds[2,0,1,2],0.0,"ds/ds has wrong value at (2,0,1,2).")  
       self.failUnlessEqual(dsds[2,0,1,3],0.0,"ds/ds has wrong value at (2,0,1,3).")  
       self.failUnlessEqual(dsds[2,0,1,4],0.0,"ds/ds has wrong value at (2,0,1,4).")  
       self.failUnlessEqual(dsds[2,0,2,0],1.0,"ds/ds has wrong value at (2,0,2,0).")  
       self.failUnlessEqual(dsds[2,0,2,1],0.0,"ds/ds has wrong value at (2,0,2,1).")  
       self.failUnlessEqual(dsds[2,0,2,2],0.0,"ds/ds has wrong value at (2,0,2,2).")  
       self.failUnlessEqual(dsds[2,0,2,3],0.0,"ds/ds has wrong value at (2,0,2,3).")  
       self.failUnlessEqual(dsds[2,0,2,4],0.0,"ds/ds has wrong value at (2,0,2,4).")  
       self.failUnlessEqual(dsds[2,0,3,0],0.0,"ds/ds has wrong value at (2,0,3,0).")  
       self.failUnlessEqual(dsds[2,0,3,1],0.0,"ds/ds has wrong value at (2,0,3,1).")  
       self.failUnlessEqual(dsds[2,0,3,2],0.0,"ds/ds has wrong value at (2,0,3,2).")  
       self.failUnlessEqual(dsds[2,0,3,3],0.0,"ds/ds has wrong value at (2,0,3,3).")  
       self.failUnlessEqual(dsds[2,0,3,4],0.0,"ds/ds has wrong value at (2,0,3,4).")  
       self.failUnlessEqual(dsds[2,1,0,0],0.0,"ds/ds has wrong value at (2,1,0,0).")  
       self.failUnlessEqual(dsds[2,1,0,1],0.0,"ds/ds has wrong value at (2,1,0,1).")  
       self.failUnlessEqual(dsds[2,1,0,2],0.0,"ds/ds has wrong value at (2,1,0,2).")  
       self.failUnlessEqual(dsds[2,1,0,3],0.0,"ds/ds has wrong value at (2,1,0,3).")  
       self.failUnlessEqual(dsds[2,1,0,4],0.0,"ds/ds has wrong value at (2,1,0,4).")  
       self.failUnlessEqual(dsds[2,1,1,0],0.0,"ds/ds has wrong value at (2,1,1,0).")  
       self.failUnlessEqual(dsds[2,1,1,1],0.0,"ds/ds has wrong value at (2,1,1,1).")  
       self.failUnlessEqual(dsds[2,1,1,2],0.0,"ds/ds has wrong value at (2,1,1,2).")  
       self.failUnlessEqual(dsds[2,1,1,3],0.0,"ds/ds has wrong value at (2,1,1,3).")  
       self.failUnlessEqual(dsds[2,1,1,4],0.0,"ds/ds has wrong value at (2,1,1,4).")  
       self.failUnlessEqual(dsds[2,1,2,0],0.0,"ds/ds has wrong value at (2,1,2,0).")  
       self.failUnlessEqual(dsds[2,1,2,1],1.0,"ds/ds has wrong value at (2,1,2,1).")  
       self.failUnlessEqual(dsds[2,1,2,2],0.0,"ds/ds has wrong value at (2,1,2,2).")  
       self.failUnlessEqual(dsds[2,1,2,3],0.0,"ds/ds has wrong value at (2,1,2,3).")  
       self.failUnlessEqual(dsds[2,1,2,4],0.0,"ds/ds has wrong value at (2,1,2,4).")  
       self.failUnlessEqual(dsds[2,1,3,0],0.0,"ds/ds has wrong value at (2,1,3,0).")  
       self.failUnlessEqual(dsds[2,1,3,1],0.0,"ds/ds has wrong value at (2,1,3,1).")  
       self.failUnlessEqual(dsds[2,1,3,2],0.0,"ds/ds has wrong value at (2,1,3,2).")  
       self.failUnlessEqual(dsds[2,1,3,3],0.0,"ds/ds has wrong value at (2,1,3,3).")  
       self.failUnlessEqual(dsds[2,1,3,4],0.0,"ds/ds has wrong value at (2,1,3,4).")  
       self.failUnlessEqual(dsds[2,2,0,0],0.0,"ds/ds has wrong value at (2,2,0,0).")  
       self.failUnlessEqual(dsds[2,2,0,1],0.0,"ds/ds has wrong value at (2,2,0,1).")  
       self.failUnlessEqual(dsds[2,2,0,2],0.0,"ds/ds has wrong value at (2,2,0,2).")  
       self.failUnlessEqual(dsds[2,2,0,3],0.0,"ds/ds has wrong value at (2,2,0,3).")  
       self.failUnlessEqual(dsds[2,2,0,4],0.0,"ds/ds has wrong value at (2,2,0,4).")  
       self.failUnlessEqual(dsds[2,2,1,0],0.0,"ds/ds has wrong value at (2,2,1,0).")  
       self.failUnlessEqual(dsds[2,2,1,1],0.0,"ds/ds has wrong value at (2,2,1,1).")  
       self.failUnlessEqual(dsds[2,2,1,2],0.0,"ds/ds has wrong value at (2,2,1,2).")  
       self.failUnlessEqual(dsds[2,2,1,3],0.0,"ds/ds has wrong value at (2,2,1,3).")  
       self.failUnlessEqual(dsds[2,2,1,4],0.0,"ds/ds has wrong value at (2,2,1,4).")  
       self.failUnlessEqual(dsds[2,2,2,0],0.0,"ds/ds has wrong value at (2,2,2,0).")  
       self.failUnlessEqual(dsds[2,2,2,1],0.0,"ds/ds has wrong value at (2,2,2,1).")  
       self.failUnlessEqual(dsds[2,2,2,2],1.0,"ds/ds has wrong value at (2,2,2,2).")  
       self.failUnlessEqual(dsds[2,2,2,3],0.0,"ds/ds has wrong value at (2,2,2,3).")  
       self.failUnlessEqual(dsds[2,2,2,4],0.0,"ds/ds has wrong value at (2,2,2,4).")  
       self.failUnlessEqual(dsds[2,2,3,0],0.0,"ds/ds has wrong value at (2,2,3,0).")  
       self.failUnlessEqual(dsds[2,2,3,1],0.0,"ds/ds has wrong value at (2,2,3,1).")  
       self.failUnlessEqual(dsds[2,2,3,2],0.0,"ds/ds has wrong value at (2,2,3,2).")  
       self.failUnlessEqual(dsds[2,2,3,3],0.0,"ds/ds has wrong value at (2,2,3,3).")  
       self.failUnlessEqual(dsds[2,2,3,4],0.0,"ds/ds has wrong value at (2,2,3,4).")  
       self.failUnlessEqual(dsds[2,3,0,0],0.0,"ds/ds has wrong value at (2,3,0,0).")  
       self.failUnlessEqual(dsds[2,3,0,1],0.0,"ds/ds has wrong value at (2,3,0,1).")  
       self.failUnlessEqual(dsds[2,3,0,2],0.0,"ds/ds has wrong value at (2,3,0,2).")  
       self.failUnlessEqual(dsds[2,3,0,3],0.0,"ds/ds has wrong value at (2,3,0,3).")  
       self.failUnlessEqual(dsds[2,3,0,4],0.0,"ds/ds has wrong value at (2,3,0,4).")  
       self.failUnlessEqual(dsds[2,3,1,0],0.0,"ds/ds has wrong value at (2,3,1,0).")  
       self.failUnlessEqual(dsds[2,3,1,1],0.0,"ds/ds has wrong value at (2,3,1,1).")  
       self.failUnlessEqual(dsds[2,3,1,2],0.0,"ds/ds has wrong value at (2,3,1,2).")  
       self.failUnlessEqual(dsds[2,3,1,3],0.0,"ds/ds has wrong value at (2,3,1,3).")  
       self.failUnlessEqual(dsds[2,3,1,4],0.0,"ds/ds has wrong value at (2,3,1,4).")  
       self.failUnlessEqual(dsds[2,3,2,0],0.0,"ds/ds has wrong value at (2,3,2,0).")  
       self.failUnlessEqual(dsds[2,3,2,1],0.0,"ds/ds has wrong value at (2,3,2,1).")  
       self.failUnlessEqual(dsds[2,3,2,2],0.0,"ds/ds has wrong value at (2,3,2,2).")  
       self.failUnlessEqual(dsds[2,3,2,3],1.0,"ds/ds has wrong value at (2,3,2,3).")  
       self.failUnlessEqual(dsds[2,3,2,4],0.0,"ds/ds has wrong value at (2,3,2,4).")  
       self.failUnlessEqual(dsds[2,3,3,0],0.0,"ds/ds has wrong value at (2,3,3,0).")  
       self.failUnlessEqual(dsds[2,3,3,1],0.0,"ds/ds has wrong value at (2,3,3,1).")  
       self.failUnlessEqual(dsds[2,3,3,2],0.0,"ds/ds has wrong value at (2,3,3,2).")  
       self.failUnlessEqual(dsds[2,3,3,3],0.0,"ds/ds has wrong value at (2,3,3,3).")  
       self.failUnlessEqual(dsds[2,3,3,4],0.0,"ds/ds has wrong value at (2,3,3,4).")  
       self.failUnlessEqual(dsds[2,4,0,0],0.0,"ds/ds has wrong value at (2,4,0,0).")  
       self.failUnlessEqual(dsds[2,4,0,1],0.0,"ds/ds has wrong value at (2,4,0,1).")  
       self.failUnlessEqual(dsds[2,4,0,2],0.0,"ds/ds has wrong value at (2,4,0,2).")  
       self.failUnlessEqual(dsds[2,4,0,3],0.0,"ds/ds has wrong value at (2,4,0,3).")  
       self.failUnlessEqual(dsds[2,4,0,4],0.0,"ds/ds has wrong value at (2,4,0,4).")  
       self.failUnlessEqual(dsds[2,4,1,0],0.0,"ds/ds has wrong value at (2,4,1,0).")  
       self.failUnlessEqual(dsds[2,4,1,1],0.0,"ds/ds has wrong value at (2,4,1,1).")  
       self.failUnlessEqual(dsds[2,4,1,2],0.0,"ds/ds has wrong value at (2,4,1,2).")  
       self.failUnlessEqual(dsds[2,4,1,3],0.0,"ds/ds has wrong value at (2,4,1,3).")  
       self.failUnlessEqual(dsds[2,4,1,4],0.0,"ds/ds has wrong value at (2,4,1,4).")  
       self.failUnlessEqual(dsds[2,4,2,0],0.0,"ds/ds has wrong value at (2,4,2,0).")  
       self.failUnlessEqual(dsds[2,4,2,1],0.0,"ds/ds has wrong value at (2,4,2,1).")  
       self.failUnlessEqual(dsds[2,4,2,2],0.0,"ds/ds has wrong value at (2,4,2,2).")  
       self.failUnlessEqual(dsds[2,4,2,3],0.0,"ds/ds has wrong value at (2,4,2,3).")  
       self.failUnlessEqual(dsds[2,4,2,4],1.0,"ds/ds has wrong value at (2,4,2,4).")  
       self.failUnlessEqual(dsds[2,4,3,0],0.0,"ds/ds has wrong value at (2,4,3,0).")  
       self.failUnlessEqual(dsds[2,4,3,1],0.0,"ds/ds has wrong value at (2,4,3,1).")  
       self.failUnlessEqual(dsds[2,4,3,2],0.0,"ds/ds has wrong value at (2,4,3,2).")  
       self.failUnlessEqual(dsds[2,4,3,3],0.0,"ds/ds has wrong value at (2,4,3,3).")  
       self.failUnlessEqual(dsds[2,4,3,4],0.0,"ds/ds has wrong value at (2,4,3,4).")  
       self.failUnlessEqual(dsds[3,0,0,0],0.0,"ds/ds has wrong value at (3,0,0,0).")  
       self.failUnlessEqual(dsds[3,0,0,1],0.0,"ds/ds has wrong value at (3,0,0,1).")  
       self.failUnlessEqual(dsds[3,0,0,2],0.0,"ds/ds has wrong value at (3,0,0,2).")  
       self.failUnlessEqual(dsds[3,0,0,3],0.0,"ds/ds has wrong value at (3,0,0,3).")  
       self.failUnlessEqual(dsds[3,0,0,4],0.0,"ds/ds has wrong value at (3,0,0,4).")  
       self.failUnlessEqual(dsds[3,0,1,0],0.0,"ds/ds has wrong value at (3,0,1,0).")  
       self.failUnlessEqual(dsds[3,0,1,1],0.0,"ds/ds has wrong value at (3,0,1,1).")  
       self.failUnlessEqual(dsds[3,0,1,2],0.0,"ds/ds has wrong value at (3,0,1,2).")  
       self.failUnlessEqual(dsds[3,0,1,3],0.0,"ds/ds has wrong value at (3,0,1,3).")  
       self.failUnlessEqual(dsds[3,0,1,4],0.0,"ds/ds has wrong value at (3,0,1,4).")  
       self.failUnlessEqual(dsds[3,0,2,0],0.0,"ds/ds has wrong value at (3,0,2,0).")  
       self.failUnlessEqual(dsds[3,0,2,1],0.0,"ds/ds has wrong value at (3,0,2,1).")  
       self.failUnlessEqual(dsds[3,0,2,2],0.0,"ds/ds has wrong value at (3,0,2,2).")  
       self.failUnlessEqual(dsds[3,0,2,3],0.0,"ds/ds has wrong value at (3,0,2,3).")  
       self.failUnlessEqual(dsds[3,0,2,4],0.0,"ds/ds has wrong value at (3,0,2,4).")  
       self.failUnlessEqual(dsds[3,0,3,0],1.0,"ds/ds has wrong value at (3,0,3,0).")  
       self.failUnlessEqual(dsds[3,0,3,1],0.0,"ds/ds has wrong value at (3,0,3,1).")  
       self.failUnlessEqual(dsds[3,0,3,2],0.0,"ds/ds has wrong value at (3,0,3,2).")  
       self.failUnlessEqual(dsds[3,0,3,3],0.0,"ds/ds has wrong value at (3,0,3,3).")  
       self.failUnlessEqual(dsds[3,0,3,4],0.0,"ds/ds has wrong value at (3,0,3,4).")  
       self.failUnlessEqual(dsds[3,1,0,0],0.0,"ds/ds has wrong value at (3,1,0,0).")  
       self.failUnlessEqual(dsds[3,1,0,1],0.0,"ds/ds has wrong value at (3,1,0,1).")  
       self.failUnlessEqual(dsds[3,1,0,2],0.0,"ds/ds has wrong value at (3,1,0,2).")  
       self.failUnlessEqual(dsds[3,1,0,3],0.0,"ds/ds has wrong value at (3,1,0,3).")  
       self.failUnlessEqual(dsds[3,1,0,4],0.0,"ds/ds has wrong value at (3,1,0,4).")  
       self.failUnlessEqual(dsds[3,1,1,0],0.0,"ds/ds has wrong value at (3,1,1,0).")  
       self.failUnlessEqual(dsds[3,1,1,1],0.0,"ds/ds has wrong value at (3,1,1,1).")  
       self.failUnlessEqual(dsds[3,1,1,2],0.0,"ds/ds has wrong value at (3,1,1,2).")  
       self.failUnlessEqual(dsds[3,1,1,3],0.0,"ds/ds has wrong value at (3,1,1,3).")  
       self.failUnlessEqual(dsds[3,1,1,4],0.0,"ds/ds has wrong value at (3,1,1,4).")  
       self.failUnlessEqual(dsds[3,1,2,0],0.0,"ds/ds has wrong value at (3,1,2,0).")  
       self.failUnlessEqual(dsds[3,1,2,1],0.0,"ds/ds has wrong value at (3,1,2,1).")  
       self.failUnlessEqual(dsds[3,1,2,2],0.0,"ds/ds has wrong value at (3,1,2,2).")  
       self.failUnlessEqual(dsds[3,1,2,3],0.0,"ds/ds has wrong value at (3,1,2,3).")  
       self.failUnlessEqual(dsds[3,1,2,4],0.0,"ds/ds has wrong value at (3,1,2,4).")  
       self.failUnlessEqual(dsds[3,1,3,0],0.0,"ds/ds has wrong value at (3,1,3,0).")  
       self.failUnlessEqual(dsds[3,1,3,1],1.0,"ds/ds has wrong value at (3,1,3,1).")  
       self.failUnlessEqual(dsds[3,1,3,2],0.0,"ds/ds has wrong value at (3,1,3,2).")  
       self.failUnlessEqual(dsds[3,1,3,3],0.0,"ds/ds has wrong value at (3,1,3,3).")  
       self.failUnlessEqual(dsds[3,1,3,4],0.0,"ds/ds has wrong value at (3,1,3,4).")  
       self.failUnlessEqual(dsds[3,2,0,0],0.0,"ds/ds has wrong value at (3,2,0,0).")  
       self.failUnlessEqual(dsds[3,2,0,1],0.0,"ds/ds has wrong value at (3,2,0,1).")  
       self.failUnlessEqual(dsds[3,2,0,2],0.0,"ds/ds has wrong value at (3,2,0,2).")  
       self.failUnlessEqual(dsds[3,2,0,3],0.0,"ds/ds has wrong value at (3,2,0,3).")  
       self.failUnlessEqual(dsds[3,2,0,4],0.0,"ds/ds has wrong value at (3,2,0,4).")  
       self.failUnlessEqual(dsds[3,2,1,0],0.0,"ds/ds has wrong value at (3,2,1,0).")  
       self.failUnlessEqual(dsds[3,2,1,1],0.0,"ds/ds has wrong value at (3,2,1,1).")  
       self.failUnlessEqual(dsds[3,2,1,2],0.0,"ds/ds has wrong value at (3,2,1,2).")  
       self.failUnlessEqual(dsds[3,2,1,3],0.0,"ds/ds has wrong value at (3,2,1,3).")  
       self.failUnlessEqual(dsds[3,2,1,4],0.0,"ds/ds has wrong value at (3,2,1,4).")  
       self.failUnlessEqual(dsds[3,2,2,0],0.0,"ds/ds has wrong value at (3,2,2,0).")  
       self.failUnlessEqual(dsds[3,2,2,1],0.0,"ds/ds has wrong value at (3,2,2,1).")  
       self.failUnlessEqual(dsds[3,2,2,2],0.0,"ds/ds has wrong value at (3,2,2,2).")  
       self.failUnlessEqual(dsds[3,2,2,3],0.0,"ds/ds has wrong value at (3,2,2,3).")  
       self.failUnlessEqual(dsds[3,2,2,4],0.0,"ds/ds has wrong value at (3,2,2,4).")  
       self.failUnlessEqual(dsds[3,2,3,0],0.0,"ds/ds has wrong value at (3,2,3,0).")  
       self.failUnlessEqual(dsds[3,2,3,1],0.0,"ds/ds has wrong value at (3,2,3,1).")  
       self.failUnlessEqual(dsds[3,2,3,2],1.0,"ds/ds has wrong value at (3,2,3,2).")  
       self.failUnlessEqual(dsds[3,2,3,3],0.0,"ds/ds has wrong value at (3,2,3,3).")  
       self.failUnlessEqual(dsds[3,2,3,4],0.0,"ds/ds has wrong value at (3,2,3,4).")  
       self.failUnlessEqual(dsds[3,3,0,0],0.0,"ds/ds has wrong value at (3,3,0,0).")  
       self.failUnlessEqual(dsds[3,3,0,1],0.0,"ds/ds has wrong value at (3,3,0,1).")  
       self.failUnlessEqual(dsds[3,3,0,2],0.0,"ds/ds has wrong value at (3,3,0,2).")  
       self.failUnlessEqual(dsds[3,3,0,3],0.0,"ds/ds has wrong value at (3,3,0,3).")  
       self.failUnlessEqual(dsds[3,3,0,4],0.0,"ds/ds has wrong value at (3,3,0,4).")  
       self.failUnlessEqual(dsds[3,3,1,0],0.0,"ds/ds has wrong value at (3,3,1,0).")  
       self.failUnlessEqual(dsds[3,3,1,1],0.0,"ds/ds has wrong value at (3,3,1,1).")  
       self.failUnlessEqual(dsds[3,3,1,2],0.0,"ds/ds has wrong value at (3,3,1,2).")  
       self.failUnlessEqual(dsds[3,3,1,3],0.0,"ds/ds has wrong value at (3,3,1,3).")  
       self.failUnlessEqual(dsds[3,3,1,4],0.0,"ds/ds has wrong value at (3,3,1,4).")  
       self.failUnlessEqual(dsds[3,3,2,0],0.0,"ds/ds has wrong value at (3,3,2,0).")  
       self.failUnlessEqual(dsds[3,3,2,1],0.0,"ds/ds has wrong value at (3,3,2,1).")  
       self.failUnlessEqual(dsds[3,3,2,2],0.0,"ds/ds has wrong value at (3,3,2,2).")  
       self.failUnlessEqual(dsds[3,3,2,3],0.0,"ds/ds has wrong value at (3,3,2,3).")  
       self.failUnlessEqual(dsds[3,3,2,4],0.0,"ds/ds has wrong value at (3,3,2,4).")  
       self.failUnlessEqual(dsds[3,3,3,0],0.0,"ds/ds has wrong value at (3,3,3,0).")  
       self.failUnlessEqual(dsds[3,3,3,1],0.0,"ds/ds has wrong value at (3,3,3,1).")  
       self.failUnlessEqual(dsds[3,3,3,2],0.0,"ds/ds has wrong value at (3,3,3,2).")  
       self.failUnlessEqual(dsds[3,3,3,3],1.0,"ds/ds has wrong value at (3,3,3,3).")  
       self.failUnlessEqual(dsds[3,3,3,4],0.0,"ds/ds has wrong value at (3,3,3,4).")  
       self.failUnlessEqual(dsds[3,4,0,0],0.0,"ds/ds has wrong value at (3,4,0,0).")  
       self.failUnlessEqual(dsds[3,4,0,1],0.0,"ds/ds has wrong value at (3,4,0,1).")  
       self.failUnlessEqual(dsds[3,4,0,2],0.0,"ds/ds has wrong value at (3,4,0,2).")  
       self.failUnlessEqual(dsds[3,4,0,3],0.0,"ds/ds has wrong value at (3,4,0,3).")  
       self.failUnlessEqual(dsds[3,4,0,4],0.0,"ds/ds has wrong value at (3,4,0,4).")  
       self.failUnlessEqual(dsds[3,4,1,0],0.0,"ds/ds has wrong value at (3,4,1,0).")  
       self.failUnlessEqual(dsds[3,4,1,1],0.0,"ds/ds has wrong value at (3,4,1,1).")  
       self.failUnlessEqual(dsds[3,4,1,2],0.0,"ds/ds has wrong value at (3,4,1,2).")  
       self.failUnlessEqual(dsds[3,4,1,3],0.0,"ds/ds has wrong value at (3,4,1,3).")  
       self.failUnlessEqual(dsds[3,4,1,4],0.0,"ds/ds has wrong value at (3,4,1,4).")  
       self.failUnlessEqual(dsds[3,4,2,0],0.0,"ds/ds has wrong value at (3,4,2,0).")  
       self.failUnlessEqual(dsds[3,4,2,1],0.0,"ds/ds has wrong value at (3,4,2,1).")  
       self.failUnlessEqual(dsds[3,4,2,2],0.0,"ds/ds has wrong value at (3,4,2,2).")  
       self.failUnlessEqual(dsds[3,4,2,3],0.0,"ds/ds has wrong value at (3,4,2,3).")  
       self.failUnlessEqual(dsds[3,4,2,4],0.0,"ds/ds has wrong value at (3,4,2,4).")  
       self.failUnlessEqual(dsds[3,4,3,0],0.0,"ds/ds has wrong value at (3,4,3,0).")  
       self.failUnlessEqual(dsds[3,4,3,1],0.0,"ds/ds has wrong value at (3,4,3,1).")  
       self.failUnlessEqual(dsds[3,4,3,2],0.0,"ds/ds has wrong value at (3,4,3,2).")  
       self.failUnlessEqual(dsds[3,4,3,3],0.0,"ds/ds has wrong value at (3,4,3,3).")  
       self.failUnlessEqual(dsds[3,4,3,4],1.0,"ds/ds has wrong value at (3,4,3,4).")  
   
       sa=s.getSubstitutedArguments({s2:-10})  
       self.failUnlessEqual(len(sa),0,"wrong number of substituted arguments")  
   
       self.failIf(s.isAppropriateValue(10.)," 10. is not appropriate substitute")  
       self.failIf(s.isAppropriateValue(10)," 10 is not appropriate substitute")  
       self.failUnless(s.isAppropriateValue(Symbol(shape=(4, 5),dim=1)),"Symbol is appropriate substitute")  
       self.failIf(s.isAppropriateValue(Symbol(shape=(4, 5),dim=2)),"Symbol is not appropriate substitute (dim)")  
       self.failIf(s.isAppropriateValue(escript.Data(0.,(5,),self.functionspace)),"Data is not appropriate substitute (shape)")  
       self.failUnless(s.isAppropriateValue(numpy.zeros((4, 5))),"ndarray is appropriate substitute")  
       self.failIf(s.isAppropriateValue(numpy.zeros((5,))),"ndarray is not appropriate substitute (shape)")  
    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
    def test_Symbol_rank2_d1_nargs1(self):  
       s2=Symbol(shape=())  
       s=Symbol(shape=(4, 5),dim=1,args=[s2])  
       self.failUnlessEqual(s.getRank(),2,"wrong rank.")  
       self.failUnlessEqual(s.getShape(),(4, 5),"wrong shape.")  
       self.failUnlessEqual(s.getDim(),1,"wrong spatial dimension.")  
       self.failUnlessEqual(s.getArgument(),[s2],"wrong arguments.")  
   
       ss=s.substitute({s:numpy.zeros((4, 5))})  
       self.failUnless(isinstance(ss,numpy.ndarray),"value after substitution is not ndarray.")  
       self.failUnlessEqual(ss.shape,(4, 5),"value after substitution has not expected shape")  
       try:  
         s.substitute({s:numpy.zeros((5,))})  
         fail("illegal substition was successful")  
       except TypeError:  
         pass  
   
       dsdarg=s.diff(Symbol(shape=()))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds() has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5),"ds/ds() has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds() has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(2,)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(2,) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5, 2),"ds/ds(2,) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(2,) has wrong value.")  
       dsdarg=s.diff(Symbol(shape=(4, 5)))  
       self.failUnless(isinstance(dsdarg,numpy.ndarray),"ds/ds(4, 5) has wrong type.")  
       self.failUnlessEqual(dsdarg.shape,(4, 5, 4, 5),"ds/ds(4, 5) has wrong shape.")  
       self.failIf(Lsup(dsdarg)>0.,"ds/ds(4, 5) has wrong value.")  
   
       dsds=s.diff(s)  
       self.failUnless(isinstance(dsds,numpy.ndarray),"ds/ds has wrong type.")  
       self.failUnlessEqual(dsds.shape,(4, 5, 4, 5),"ds/ds has wrong shape.")  
       self.failUnlessEqual(dsds[0,0,0,0],1.0,"ds/ds has wrong value at (0,0,0,0).")  
       self.failUnlessEqual(dsds[0,0,0,1],0.0,"ds/ds has wrong value at (0,0,0,1).")  
       self.failUnlessEqual(dsds[0,0,0,2],0.0,"ds/ds has wrong value at (0,0,0,2).")  
       self.failUnlessEqual(dsds[0,0,0,3],0.0,"ds/ds has wrong value at (0,0,0,3).")  
       self.failUnlessEqual(dsds[0,0,0,4],0.0,"ds/ds has wrong value at (0,0,0,4).")  
       self.failUnlessEqual(dsds[0,0,1,0],0.0,"ds/ds has wrong value at (0,0,1,0).")  
       self.failUnlessEqual(dsds[0,0,1,1],0.0,"ds/ds has wrong value at (0,0,1,1).")  
       self.failUnlessEqual(dsds[0,0,1,2],0.0,"ds/ds has wrong value at (0,0,1,2).")  
       self.failUnlessEqual(dsds[0,0,1,3],0.0,"ds/ds has wrong value at (0,0,1,3).")  
       self.failUnlessEqual(dsds[0,0,1,4],0.0,"ds/ds has wrong value at (0,0,1,4).")  
       self.failUnlessEqual(dsds[0,0,2,0],0.0,"ds/ds has wrong value at (0,0,2,0).")  
       self.failUnlessEqual(dsds[0,0,2,1],0.0,"ds/ds has wrong value at (0,0,2,1).")  
       self.failUnlessEqual(dsds[0,0,2,2],0.0,"ds/ds has wrong value at (0,0,2,2).")  
       self.failUnlessEqual(dsds[0,0,2,3],0.0,"ds/ds has wrong value at (0,0,2,3).")  
       self.failUnlessEqual(dsds[0,0,2,4],0.0,"ds/ds has wrong value at (0,0,2,4).")  
       self.failUnlessEqual(dsds[0,0,3,0],0.0,"ds/ds has wrong value at (0,0,3,0).")  
       self.failUnlessEqual(dsds[0,0,3,1],0.0,"ds/ds has wrong value at (0,0,3,1).")  
       self.failUnlessEqual(dsds[0,0,3,2],0.0,"ds/ds has wrong value at (0,0,3,2).")  
       self.failUnlessEqual(dsds[0,0,3,3],0.0,"ds/ds has wrong value at (0,0,3,3).")  
       self.failUnlessEqual(dsds[0,0,3,4],0.0,"ds/ds has wrong value at (0,0,3,4).")  
       self.failUnlessEqual(dsds[0,1,0,0],0.0,"ds/ds has wrong value at (0,1,0,0).")  
       self.failUnlessEqual(dsds[0,1,0,1],1.0,"ds/ds has wrong value at (0,1,0,1).")  
       self.failUnlessEqual(dsds[0,1,0,2],0.0,"ds/ds has wrong value at (0,1,0,2).")  
       self.failUnlessEqual(dsds[0,1,0,3],0.0,"ds/ds has wrong value at (0,1,0,3).")  
       self.failUnlessEqual(dsds[0,1,0,4],0.0,"ds/ds has wrong value at (0,1,0,4).")  
       self.failUnlessEqual(dsds[0,1,1,0],0.0,"ds/ds has wrong value at (0,1,1,0).")  
       self.failUnlessEqual(dsds[0,1,1,1],0.0,"ds/ds has wrong value at (0,1,1,1).")  
       self.failUnlessEqual(dsds[0,1,1,2],0.0,"ds/ds has wrong value at (0,1,1,2).")  
       self.failUnlessEqual(dsds[0,1,1,3],0.0,"ds/ds has wrong value at (0,1,1,3).")  
       self.failUnlessEqual(dsds[0,1,1,4],0.0,"ds/ds has wrong value at (0,1,1,4).")  
       self.failUnlessEqual(dsds[0,1,2,0],0.0,"ds/ds has wrong value at (0,1,2,0).")  
       self.failUnlessEqual(dsds[0,1,2,1],0.0,"ds/ds has wrong value at (0,1,2,1).")  
       self.failUnlessEqual(dsds[0,1,2,2],0.0,"ds/ds has wrong value at (0,1,2,2).")  
       self.failUnlessEqual(dsds[0,1,2,3],0.0,"ds/ds has wrong value at (0,1,2,3).")  
       self.failUnlessEqual(dsds[0,1,2,4],0.0,"ds/ds has wrong value at (0,1,2,4).")  
       self.failUnlessEqual(dsds[0,1,3,0],0.0,"ds/ds has wrong value at (0,1,3,0).")  
       self.failUnlessEqual(dsds[0,1,3,1],0.0,"ds/ds has wrong value at (0,1,3,1).")  
       self.failUnlessEqual(dsds[0,1,3,2],0.0,"ds/ds has wrong value at (0,1,3,2).")  
       self.failUnlessEqual(dsds[0,1,3,3],0.0,"ds/ds has wrong value at (0,1,3,3).")  
       self.failUnlessEqual(dsds[0,1,3,4],0.0,"ds/ds has wrong value at (0,1,3,4).")  
       self.failUnlessEqual(dsds[0,2,0,0],0.0,"ds/ds has wrong value at (0,2,0,0).")  
       self.failUnlessEqual(dsds[0,2,0,1],0.0,"ds/ds has wrong value at (0,2,0,1).")  
       self.failUnlessEqual(dsds[0,2,0,2],1.0,"ds/ds has wrong value at (0,2,0,2).")  
       self.failUnlessEqual(dsds[0,2,0,3],0.0,"ds/ds has wrong value at (0,2,0,3).")  
       self.failUnlessEqual(dsds[0,2,0,4],0.0,"ds/ds has wrong value at (0,2,0,4).")  
       self.failUnlessEqual(dsds[0,2,1,0],0.0,"ds/ds has wrong value at (0,2,1,0).")  
       self.failUnlessEqual(dsds[0,2,1,1],0.0,"ds/ds has wrong value at (0,2,1,1).")  
       self.failUnlessEqual(dsds[0,2,1,2],0.0,"ds/ds has wrong value at (0,2,1,2).")  
       self.failUnlessEqual(dsds[0,2,1,3],0.0,"ds/ds has wrong value at (0,2,1,3).")  
       self.failUnlessEqual(dsds[0,2,1,4],0.0,"ds/ds has wrong value at (0,2,1,4).")  
       self.failUnlessEqual(dsds[0,2,2,0],0.0,"ds/ds has wrong value at (0,2,2,0).")  
       self.failUnlessEqual(dsds[0,2,2,1],0.0,"ds/ds has wrong value at (0,2,2,1).")  
       self.failUnlessEqual(dsds[0,2,2,2],0.0,"ds/ds has wrong value at (0,2,2,2).")  
       self.failUnlessEqual(dsds[0,2,2,3],0.0,"ds/ds has wrong value at (0,2,2,3).")  
       self.failUnlessEqual(dsds[0,2,2,4],0.0,"ds/ds has wrong value at (0,2,2,4).")  
       self.failUnlessEqual(dsds[0,2,3,0],0.0,"ds/ds has wrong value at (0,2,3,0).")  
       self.failUnlessEqual(dsds[0,2,3,1],0.0,"ds/ds has wrong value at (0,2,3,1).")  
       self.failUnlessEqual(dsds[0,2,3,2],0.0,"ds/ds has wrong value at (0,2,3,2).")  
       self.failUnlessEqual(dsds[0,2,3,3],0.0,"ds/ds has wrong value at (0,2,3,3).")  
       self.failUnlessEqual(dsds[0,2,3,4],0.0,"ds/ds has wrong value at (0,2,3,4).")  
       self.failUnlessEqual(dsds[0,3,0,0],0.0,"ds/ds has wrong value at (0,3,0,0).")  
       self.failUnlessEqual(dsds[0,3,0,1],0.0,"ds/ds has wrong value at (0,3,0,1).")  
       self.failUnlessEqual(dsds[0,3,0,2],0.0,"ds/ds has wrong value at (0,3,0,2).")  
       self.failUnlessEqual(dsds[0,3,0,3],1.0,"ds/ds has wrong value at (0,3,0,3).")  
       self.failUnlessEqual(dsds[0,3,0,4],0.0,"ds/ds has wrong value at (0,3,0,4).")  
       self.failUnlessEqual(dsds[0,3,1,0],0.0,"ds/ds has wrong value at (0,3,1,0).")  
       self.failUnlessEqual(dsds[0,3,1,1],0.0,"ds/ds has wrong value at (0,3,1,1).")  
       self.failUnlessEqual(dsds[0,3,1,2],0.0,"ds/ds has wrong value at (0,3,1,2).")  
       self.failUnlessEqual(dsds[0,3,1,3],0.0,"ds/ds has wrong value at (0,3,1,3).")  
       self.failUnlessEqual(dsds[0,3,1,4],0.0,"ds/ds has wrong value at (0,3,1,4).")  
       self.failUnlessEqual(dsds[0,3,2,0],0.0,"ds/ds has wrong value at (0,3,2,0).")  
       self.failUnlessEqual(dsds[0,3,2,1],0.0,"ds/ds has wrong value at (0,3,2,1).")  
       self.failUnlessEqual(dsds[0,3,2,2],0.0,"ds/ds has wrong value at (0,3,2,2).")  
       self.failUnlessEqual(dsds[0,3,2,3],0.0,"ds/ds has wrong value at (0,3,2,3).")  
       self.failUnlessEqual(dsds[0,3,2,4],0.0,"ds/ds has wrong value at (0,3,2,4).")  
       self.failUnlessEqual(dsds[0,3,3,0],0.0,"ds/ds has wrong value at (0,3,3,0).")  
       self.failUnlessEqual(dsds[0,3,3,1],0.0,"ds/ds has wrong value at (0,3,3,1).")  
       self.failUnlessEqual(dsds[0,3,3,2],0.0,"ds/ds has wrong value at (0,3,3,2).")  
       self.failUnlessEqual(dsds[0,3,3,3],0.0,"ds/ds has wrong value at (0,3,3,3).")  
       self.failUnlessEqual(dsds[0,3,3,4],0.0,"ds/ds has wrong value at (0,3,3,4).")  
       self.failUnlessEqual(dsds[0,4,0,0],0.0,"ds/ds has wrong value at (0,4,0,0).")  
       self.failUnlessEqual(dsds[0,4,0,1],0.0,"ds/ds has wrong value at (0,4,0,1).")  
       self.failUnlessEqual(dsds[0,4,0,2],0.0,"ds/ds has wrong value at (0,4,0,2).")  
       self.failUnlessEqual(dsds[0,4,0,3],0.0,"ds/ds has wrong value at (0,4,0,3).")  
       self.failUnlessEqual(dsds[0,4,0,4],1.0,"ds/ds has wrong value at (0,4,0,4).")  
       self.failUnlessEqual(dsds[0,4,1,0],0.0,"ds/ds has wrong value at (0,4,1,0).")  
       self.failUnlessEqual(dsds[0,4,1,1],0.0,"ds/ds has wrong value at (0,4,1,1).")  
       self.failUnlessEqual(dsds[0,4,1,2],0.0,"ds/ds has wrong value at (0,4,1,2).")  
       self.failUnlessEqual(dsds[0,4,1,3],0.0,"ds/ds has wrong value at (0,4,1,3).")  
       self.failUnlessEqual(dsds[0,4,1,4],0.0,"ds/ds has wrong value at (0,4,1,4).")  
       self.failUnlessEqual(dsds[0,4,2,0],0.0,"ds/ds has wrong value at (0,4,2,0).")  
       self.failUnlessEqual(dsds[0,4,2,1],0.0,"ds/ds has wrong value at (0,4,2,1).")  
       self.failUnlessEqual(dsds[0,4,2,2],0.0,"ds/ds has wrong value at (0,4,2,2).")  
       self.failUnlessEqual(dsds[0,4,2,3],0.0,"ds/ds has wrong value at (0,4,2,3).")  
       self.failUnlessEqual(dsds[0,4,2,4],0.0,"ds/ds has wrong value at (0,4,2,4).")  
       self.failUnlessEqual(dsds[0,4,3,0],0.0,"ds/ds has wrong value at (0,4,3,0).")  
       self.failUnlessEqual(dsds[0,4,3,1],0.0,"ds/ds has wrong value at (0,4,3,1).")  
       self.failUnlessEqual(dsds[0,4,3,2],0.0,"ds/ds has wrong value at (0,4,3,2).")  
       self.failUnlessEqual(dsds[0,4,3,3],0.0,"ds/ds has wrong value at (0,4,3,3).")  
       self.failUnlessEqual(dsds[0,4,3,4],0.0,"ds/ds has wrong value at (0,4,3,4).")  
       self.failUnlessEqual(dsds[1,0,0,0],0.0,"ds/ds has wrong value at (1,0,0,0).")  
       self.failUnlessEqual(dsds[1,0,0,1],0.0,"ds/ds has wrong value at (1,0,0,1).")  
       self.failUnlessEqual(dsds[1,0,0,2],0.0,"ds/ds has wrong value at (1,0,0,2).")  
       self.failUnlessEqual(dsds[1,0,0,3],0.0,"ds/ds has wrong value at (1,0,0,3).")  
       self.failUnlessEqual(dsds[1,0,0,4],0.0,"ds/ds has wrong value at (1,0,0,4).")  
       self.failUnlessEqual(dsds[1,0,1,0],1.0,"ds/ds has wrong value at (1,0,1,0).")  
       self.failUnlessEqual(dsds[1,0,1,1],0.0,"ds/ds has wrong value at (1,0,1,1).")  
       self.failUnlessEqual(dsds[1,0,1,2],0.0,"ds/ds has wrong value at (1,0,1,2).")  
       self.failUnlessEqual(dsds[1,0,1,3],0.0,"ds/ds has wrong value at (1,0,1,3).")  
       self.failUnlessEqual(dsds[1,0,1,4],0.0,"ds/ds has wrong value at (1,0,1,4).")  
       self.failUnlessEqual(dsds[1,0,2,0],0.0,"ds/ds has wrong value at (1,0,2,0).")  
       self.failUnlessEqual(dsds[1,0,2,1],0.0,"ds/ds has wrong value at (1,0,2,1).")  
       self.failUnlessEqual(dsds[1,0,2,2],0.0,"ds/ds has wrong value at (1,0,2,2).")  
       self.failUnlessEqual(dsds[1,0,2,3],0.0,"ds/ds has wrong value at (1,0,2,3).")  
       self.failUnlessEqual(dsds[1,0,2,4],0.0,"ds/ds has wrong value at (1,0,2,4).")  
       self.failUnlessEqual(dsds[1,0,3,0],0.0,"ds/ds has wrong value at (1,0,3,0).")  
       self.failUnlessEqual(dsds[1,0,3,1],0.0,"ds/ds has wrong value at (1,0,3,1).")  
       self.failUnlessEqual(dsds[1,0,3,2],0.0,"ds/ds has wrong value at (1,0,3,2).")  
       self.failUnlessEqual(dsds[1,0,3,3],0.0,"ds/ds has wrong value at (1,0,3,3).")  
       self.failUnlessEqual(dsds[1,0,3,4],0.0,"ds/ds has wrong value at (1,0,3,4).")  
       self.failUnlessEqual(dsds[1,1,0,0],0.0,"ds/ds has wrong value at (1,1,0,0).")  
       self.failUnlessEqual(dsds[1,1,0,1],0.0,"ds/ds has wrong value at (1,1,0,1).")  
       self.failUnlessEqual(dsds[1,1,0,2],0.0,"ds/ds has wrong value at (1,1,0,2).")  
       self.failUnlessEqual(dsds[1,1,0,3],0.0,"ds/ds has wrong value at (1,1,0,3).")  
       self.failUnlessEqual(dsds[1,1,0,4],0.0,"ds/ds has wrong value at (1,1,0,4).")  
       self.failUnlessEqual(dsds[1,1,1,0],0.0,"ds/ds has wrong value at (1,1,1,0).")  
       self.failUnlessEqual(dsds[1,1,1,1],1.0,"ds/ds has wrong value at (1,1,1,1).")  
       self.failUnlessEqual(dsds[1,1,1,2],0.0,"ds/ds has wrong value at (1,1,1,2).")  
       self.failUnlessEqual(dsds[1,1,1,3],0.0,"ds/ds has wrong value at (1,1,1,3).")  
       self.failUnlessEqual(dsds[1,1,1,4],0.0,"ds/ds has wrong value at (1,1,1,4).")  
       self.failUnlessEqual(dsds[1,1,2,0],0.0,"ds/ds has wrong value at (1,1,2,0).")  
       self.failUnlessEqual(dsds[1,1,2,1],0.0,"ds/ds has wrong value at (1,1,2,1).")  
       self.failUnlessEqual(dsds[1,1,2,2],0.0,"ds/ds has wrong value at (1,1,2,2).")  
       self.failUnlessEqual(dsds[1,1,2,3],0.0,"ds/ds has wrong value at (1,1,2,3).")  
       self.failUnlessEqual(dsds[1,1,2,4],0.0,"ds/ds has wrong value at (1,1,2,4).")  
       self.failUnlessEqual(dsds[1,1,3,0],0.0,"ds/ds has wrong value at (1,1,3,0).")  
       self.failUnlessEqual(dsds[1,1,3,1],0.0,"ds/ds has wrong value at (1,1,3,1).")  
       self.failUnlessEqual(dsds[1,1,3,2],0.0,"ds/ds has wrong value at (1,1,3,2).")  
       self.failUnlessEqual(dsds[1,1,3,3],0.0,"ds/ds has wrong value at (1,1,3,3).")  
       self.failUnlessEqual(dsds[1,1,3,4],0.0,"ds/ds has wrong value at (1,1,3,4).")  
       self.failUnlessEqual(dsds[1,2,0,0],0.0,"ds/ds has wrong value at (1,2,0,0).")  
       self.failUnlessEqual(dsds[1,2,0,1],0.0,"ds/ds has wrong value at (1,2,0,1).")  
       self.failUnlessEqual(dsds[1,2,0,2],0.0,"ds/ds has wrong value at (1,2,0,2).")  
       self.failUnlessEqual(dsds[1,2,0,3],0.0,"ds/ds has wrong value at (1,2,0,3).")  
       self.failUnlessEqual(dsds[1,2,0,4],0.0,"ds/ds has wrong value at (1,2,0,4).")  
       self.failUnlessEqual(dsds[1,2,1,0],0.0,"ds/ds has wrong value at (1,2,1,0).")  
       self.failUnlessEqual(dsds[1,2,1,1],0.0,"ds/ds has wrong value at (1,2,1,1).")  
       self.failUnlessEqual(dsds[1,2,1,2],1.0,"ds/ds has wrong value at (1,2,1,2).")  
       self.failUnlessEqual(dsds[1,2,1,3],0.0,"ds/ds has wrong value at (1,2,1,3).")  
       self.failUnlessEqual(dsds[1,2,1,4],0.0,"ds/ds has wrong value at (1,2,1,4).")  
       self.failUnlessEqual(dsds[1,2,2,0],0.0,"ds/ds has wrong value at (1,2,2,0).")  
       self.failUnlessEqual(dsds[1,2,2,1],0.0,"ds/ds has wrong value at (1,2,2,1).")  
       self.failUnlessEqual(dsds[1,2,2,2],0.0,"ds/ds has wrong value at (1,2,2,2).")  
       self.failUnlessEqual(dsds[1,2,2,3],0.0,"ds/ds has wrong value at (1,2,2,3).")  
       self.failUnlessEqual(dsds[1,2,2,4],0.0,"ds/ds has wrong value at (1,2,2,4).")  
       self.failUnlessEqual(dsds[1,2,3,0],0.0,"ds/ds has wrong value at (1,2,3,0).")  
       self.failUnlessEqual(dsds[1,2,3,1],0.0,"ds/ds has wrong value at (1,2,3,1).")  
       self.failUnlessEqual(dsds[1,2,3,2],0.0,"ds/ds has wrong value at (1,2,3,2).")  
       self.failUnlessEqual(dsds[1,2,3,3],0.0,"ds/ds has wrong value at (1,2,3,3).")  
       self.failUnlessEqual(dsds[1,2,3,4],0.0,"ds/ds has wrong value at (1,2,3,4).")  
       self.failUnlessEqual(dsds[1,3,0,0],0.0,"ds/ds has wrong value at (1,3,0,0).")  
       self.failUnlessEqual(dsds[1,3,0,1],0.0,"ds/ds has wrong value at (1,3,0,1).")  
       self.failUnlessEqual(dsds[1,3,0,2],0.0,"ds/ds has wrong value at (1,3,0,2).")  
       self.failUnlessEqual(dsds[1,3,0,3],0.0,"ds/ds has wrong value at (1,3,0,3).")  
       self.failUnlessEqual(dsds[1,3,0,4],0.0,"ds/ds has wrong value at (1,3,0,4).")  
       self.failUnlessEqual(dsds[1,3,1,0],0.0,"ds/ds has wrong value at (1,3,1,0).")  
       self.failUnlessEqual(dsds[1,3,1,1],0.0,"ds/ds has wrong value at (1,3,1,1).")  
       self.failUnlessEqual(dsds[1,3,1,2],0.0,"ds/ds has wrong value at (1,3,1,2).")  
       self.failUnlessEqual(dsds[1,3,1,3],1.0,"ds/ds has wrong value at (1,3,1,3).")  
       self.failUnlessEqual(dsds[1,3,1,4],0.0,"ds/ds has wrong value at (1,3,1,4).")  
       self.failUnlessEqual(dsds[1,3,2,0],0.0,"ds/ds has wrong value at (1,3,2,0).")  
       self.failUnlessEqual(dsds[1,3,2,1],0.0,"ds/ds has wrong value at (1,3,2,1).")  
       self.failUnlessEqual(dsds[1,3,2,2],0.0,"ds/ds has wrong value at (1,3,2,2).")  
       self.failUnlessEqual(dsds[1,3,2,3],0.0,"ds/ds has wrong value at (1,3,2,3).")  
       self.failUnlessEqual(dsds[1,3,2,4],0.0,"ds/ds has wrong value at (1,3,2,4).")  
       self.failUnlessEqual(dsds[1,3,3,0],0.0,"ds/ds has wrong value at (1,3,3,0).")  
       self.failUnlessEqual(dsds[1,3,3,1],0.0,"ds/ds has wrong value at (1,3,3,1).")  
       self.failUnlessEqual(dsds[1,3,3,2],0.0,"ds/ds has wrong value at (1,3,3,2).")  
       self.failUnlessEqual(dsds[1,3,3,3],0.0,"ds/ds has wrong value at (1,3,3,3).")  
       self.failUnlessEqual(dsds[1,3,3,4],0.0,"ds/ds has wrong value at (1,3,3,4).")  
       self.failUnlessEqual(dsds[1,4,0,0],0.0,"ds/ds has wrong value at (1,4,0,0).")  
       self.failUnlessEqual(dsds[1,4,0,1],0.0,"ds/ds has wrong value at (1,4,0,1).")  
       self.failUnlessEqual(dsds[1,4,0,2],0.0,"ds/ds has wrong value at (1,4,0,2).")  
       self.failUnlessEqual(dsds[1,4,0,3],0.0,"ds/ds has wrong value at (1,4,0,3).")  
       self.failUnlessEqual(dsds[1,4,0,4],0.0,"ds/ds has wrong value at (1,4,0,4).")  
       self.failUnlessEqual(dsds[1,4,1,0],0.0,"ds/ds has wrong value at (1,4,1,0).")  
       self.failUnlessEqual(dsds[1,4,1,1],0.0,"ds/ds has wrong value at (1,4,1,1).")  
       self.failUnlessEqual(dsds[1,4,1,2],0.0,"ds/ds has wrong value at (1,4,1,2).")  
       self.failUnlessEqual(dsds[1,4,1,3],0.0,"ds/ds has wrong value at (1,4,1,3).")  
       self.failUnlessEqual(dsds[1,4,1,4],1.0,"ds/ds has wrong value at (1,4,1,4).")  
       self.failUnlessEqual(dsds[1,4,2,0],0.0,"ds/ds has wrong value at (1,4,2,0).")  
       self.failUnlessEqual(dsds[1,4,2,1],0.0,"ds/ds has wrong value at (1,4,2,1).")  
       self.failUnlessEqual(dsds[1,4,2,2],0.0,"ds/ds has wrong value at (1,4,2,2).")  
       self.failUnlessEqual(dsds[1,4,2,3],0.0,"ds/ds has wrong value at (1,4,2,3).")  
       self.failUnlessEqual(dsds[1,4,2,4],0.0,"ds/ds has wrong value at (1,4,2,4).")  
       self.failUnlessEqual(dsds[1,4,3,0],0.0,"ds/ds has wrong value at (1,4,3,0).")  
       self.failUnlessEqual(dsds[1,4,3,1],0.0,"ds/ds has wrong value at (1,4,3,1).")  
       self.failUnlessEqual(dsds[1,4,3,2],0.0,"ds/ds has wrong value at (1,4,3,2).")  
       self.failUnlessEqual(dsds[1,4,3,3],0.0,"ds/ds has wrong value at (1,4,3,3).")  
       self.failUnlessEqual(dsds[1,4,3,4],0.0,"ds/ds has wrong value at (1,4,3,4).")  
       self.failUnlessEqual(dsds[2,0,0,0],0.0,"ds/ds has wrong value at (2,0,0,0).")  
       self.failUnlessEqual(dsds[2,0,0,1],0.0,"ds/ds has wrong value at (2,0,0,1).")  
       self.failUnlessEqual(dsds[2,0,0,2],0.0,"ds/ds has wrong value at (2,0,0,2).")  
       self.failUnlessEqual(dsds[2,0,0,3],0.0,"ds/ds has wrong value at (2,0,0,3).")  
       self.failUnlessEqual(dsds[2,0,0,4],0.0,"ds/ds has wrong value at (2,0,0,4).")  
       self.failUnlessEqual(dsds[2,0,1,0],0.0,"ds/ds has wrong value at (2,0,1,0).")  
       self.failUnlessEqual(dsds[2,0,1,1],0.0,"ds/ds has wrong value at (2,0,1,1).")  
       self.failUnlessEqual(dsds[2,0,1,2],0.0,"ds/ds has wrong value at (2,0,1,2).")  
       self.failUnlessEqual(dsds[2,0,1,3],0.0,"ds/ds has wrong value at (2,0,1,3).")  
       self.failUnlessEqual(dsds[2,0,1,4],0.0,"ds/ds has wrong value at (2,0,1,4).")  
       self.failUnlessEqual(dsds[2,0,2,0],1.0,"ds/ds has wrong value at (2,0,2,0).")  
       self.failUnlessEqual(dsds[2,0,2,1],0.0,"ds/ds has wrong value at (2,0,2,1).")  
       self.failUnlessEqual(dsds[2,0,2,2],0.0,"ds/ds has wrong value at (2,0,2,2).")  
       self.failUnlessEqual(dsds[2,0,2,3],0.0,"ds/ds has wrong value at (2,0,2,3).")  
       self.failUnlessEqual(dsds[2,0,2,4],0.0,"ds/ds has wrong value at (2,0,2,4).")  
       self.failUnlessEqual(dsds[2,0,3,0],0.0,"ds/ds has wrong value at (2,0,3,0).")  
       self.failUnlessEqual(dsds[2,0,3,1],0.0,"ds/ds has wrong value at (2,0,3,1).")  
       self.failUnlessEqual(dsds[2,0,3,2],0.0,"ds/ds has wrong value at (2,0,3,2).")  
       self.failUnlessEqual(dsds[2,0,3,3],0.0,"ds/ds has wrong value at (2,0,3,3).")  
       self.failUnlessEqual(dsds[2,0,3,4],0.0,"ds/ds has wrong value at (2,0,3,4).")  
       self.failUnlessEqual(dsds[2,1,0,0],0.0,"ds/ds has wrong value at (2,1,0,0).")  
       self.failUnlessEqual(dsds[2,1,0,1],0.0,"ds/ds has wrong value at (2,1,0,1).")  
       self.failUnlessEqual(dsds[2,1,0,2],0.0,"ds/ds has wrong value at (2,1,0,2).")  
       self.failUnlessEqual(dsds[2,1,0,3],0.0,"ds/ds has wrong value at (2,1,0,3).")  
       self.failUnlessEqual(dsds[2,1,0,4],0.0,"ds/ds has wrong value at (2,1,0,4).")  
       self.failUnlessEqual(dsds[2,1,1,0],0.0,"ds/ds has wrong value at (2,1,1,0).")  
       self.failUnlessEqual(dsds[2,1,1,1],0.0,"ds/ds has wrong value at (2,1,1,1).")  
       self.failUnlessEqual(dsds[2,1,1,2],0.0,"ds/ds has wrong value at (2,1,1,2).")  
       self.failUnlessEqual(dsds[2,1,1,3],0.0,"ds/ds has wrong value at (2,1,1,3).")  
       self.failUnlessEqual(dsds[2,1,1,4],0.0,"ds/ds has wrong value at (2,1,1,4).")  
       self.failUnlessEqual(dsds[2,1,2,0],0.0,"ds/ds has wrong value at (2,1,2,0).")  
       self.failUnlessEqual(dsds[2,1,2,1],1.0,"ds/ds has wrong value at (2,1,2,1).")  
       self.failUnlessEqual(dsds[2,1,2,2],0.0,"ds/ds has wrong value at (2,1,2,2).")  
       self.failUnlessEqual(dsds[2,1,2,3],0.0,"ds/ds has wrong value at (2,1,2,3).")  
       self.failUnlessEqual(dsds[2,1,2,4],0.0,"ds/ds has wrong value at (2,1,2,4).")  
       self.failUnlessEqual(dsds[2,1,3,0],0.0,"ds/ds has wrong value at (2,1,3,0).")  
       self.failUnlessEqual(dsds[2,1,3,1],0.0,"ds/ds has wrong value at (2,1,3,1).")  
       self.failUnlessEqual(dsds[2,1,3,2],0.0,"ds/ds has wrong value at (2,1,3,2).")  
       self.failUnlessEqual(dsds[2,1,3,3],0.0,"ds/ds has wrong value at (2,1,3,3).")  
       self.failUnlessEqual(dsds[2,1,3,4],0.0,"ds/ds has wrong value at (2,1,3,4).")  
       self.failUnlessEqual(dsds[2,2,0,0],0.0,"ds/ds has wrong value at (2,2,0,0).")  
       self.failUnlessEqual(dsds[2,2,0,1],0.0,"ds/ds has wrong value at (2,2,0,1).")  
       self.failUnlessEqual(dsds[2,2,0,2],0.0,"ds/ds has wrong value at (2,2,0,2).")  
       self.failUnlessEqual(dsds[2,2,0,3],0.0,"ds/ds has wrong value at (2,2,0,3).")  
       self.failUnlessEqual(dsds[2,2,0,4],0.0,"ds/ds has wrong value at (2,2,0,4).")  
       self.failUnlessEqual(dsds[2,2,1,0],0.0,"ds/ds has wrong value at (2,2,1,0).")  
       self.failUnlessEqual(dsds[2,2,1,1],0.0,"ds/ds has wrong value at (2,2,1,1).")  
       self.failUnlessEqual(dsds[2,2,1,2],0.0,"ds/ds has wrong value at (2,2,1,2).")  
       self.failUnlessEqual(dsds[2,2,1,3],0.0,"ds/ds has wrong value at (2,2,1,3).")  
       self.failUnlessEqual(dsds[2,2,1,4],0.0,"ds/ds has wrong value at (2,2,1,4).")  
       self.failUnlessEqual(dsds[2,2,2,0],0.0,"ds/ds has wrong value at (2,2,2,0).")  
       self.failUnlessEqual(dsds[2,2,2,1],0.0,"ds/ds has wrong value at (2,2,2,1).")  
       self.failUnlessEqual(dsds[2,2,2,2],1.0,"ds/ds has wrong value at (2,2,2,2).")  
       self.failUnlessEqual(dsds[2,2,2,3],0.0,"ds/ds has wrong value at (2,2,2,3).")  
       self.failUnlessEqual(dsds[2,2,2,4],0.0,"ds/ds has wrong value at (2,2,2,4).")  
       self.failUnlessEqual(dsds[2,2,3,0],0.0,"ds/ds has wrong value at (2,2,3,0).")  
       self.failUnlessEqual(dsds[2,2,3,1],0.0,"ds/ds has wrong value at (2,2,3,1).")  
       self.failUnlessEqual(dsds[2,2,3,2],0.0,"ds/ds has wrong value at (2,2,3,2).")  
       self.failUnlessEqual(dsds[2,2,3,3],0.0,"ds/ds has wrong value at (2,2,3,3).")  
       self.failUnlessEqual(dsds[2,2,3,4],0.0,"ds/ds has wrong value at (2,2,3,4).")  
       self.failUnlessEqual(dsds[2,3,0,0],0.0,"ds/ds has wrong value at (2,3,0,0).")  
       self.failUnlessEqual(dsds[2,3,0,1],0.0,"ds/ds has wrong value at (2,3,0,1).")  
       self.failUnlessEqual(dsds[2,3,0,2],0.0,"ds/ds has wrong value at (2,3,0,2).")  
       self.failUnlessEqual(dsds[2,3,0,3],0.0,"ds/ds has wrong value at (2,3,0,3).")  
       self.failUnlessEqual(dsds[2,3,0,4],0.0,"ds/ds has wrong value at (2,3,0,4).")  
       self.failUnlessEqual(dsds[2,3,1,0],0.0,"ds/ds has wrong value at (2,3,1,0).")  
       self.failUnlessEqual(dsds[2,3,1,1],0.0,"ds/ds has wrong value at (2,3,1,1).")  
       self.failUnlessEqual(dsds[2,3,1,2],0.0,"ds/ds has wrong value at (2,3,1,2).")  
       self.failUnlessEqual(dsds[2,3,1,3],0.0,"ds/ds has wrong value at (2,3,1,3).")  
       self.failUnlessEqual(dsds[2,3,1,4],0.0,"ds/ds has wrong value at (2,3,1,4).")  
       self.failUnlessEqual(dsds[2,3,2,0],0.0,"ds/ds has wrong value at (2,3,2,0).")  
       self.failUnlessEqual(dsds[2,3,2,1],0.0,"ds/ds has wrong value at (2,3,2,1).")  
       self.failUnlessEqual(dsds[2,3,2,2],0.0,"ds/ds has wrong value at (2,3,2,2).")  
       self.failUnlessEqual(dsds[2,3,2,3],1.0,"ds/ds has wrong value at (2,3,2,3).")  
       self.failUnlessEqual(dsds[2,3,2,4],0.0,"ds/ds has wrong value at (2,3,2,4).")  
       self.failUnlessEqual(dsds[2,3,3,0],0.0,"ds/ds has wrong value at (2,3,3,0).")  
       self.failUnlessEqual(dsds[2,3,3,1],0.0,"ds/ds has wrong value at (2,3,3,1).")  
       self.failUnlessEqual(dsds[2,3,3,2],0.0,"ds/ds has wrong value at (2,3,3,2).")  
       self.failUnlessEqual(dsds[2,3,3,3],0.0,"ds/ds has wrong value at (2,3,3,3).")  
       self.failUnlessEqual(dsds[2,3,3,4],0.0,"ds/ds has wrong value at (2,3,3,4).")  
       self.failUnlessEqual(dsds[2,4,0,0],0.0,"ds/ds has wrong value at (2,4,0,0).")  
       self.failUnlessEqual(dsds[2,4,0,1],0.0,"ds/ds has wrong value at (2,4,0,1).")  
       self.failUnlessEqual(dsds[2,4,0,2],0.0,"ds/ds has wrong value at (2,4,0,2).")  
       self.failUnlessEqual(dsds[2,4,0,3],0.0,"ds/ds has wrong value at (2,4,0,3).")  
       self.failUnlessEqual(dsds[2,4,0,4],0.0,"ds/ds has wrong value at (2,4,0,4).")  
       self.failUnlessEqual(dsds[2,4,1,0],0.0,"ds/ds has wrong value at (2,4,1,0).")  
       self.failUnlessEqual(dsds[2,4,1,1],0.0,"ds/ds has wrong value at (2,4,1,1).")  
       self.failUnlessEqual(dsds[2,4,1,2],0.0,"ds/ds has wrong value at (2,4,1,2).")  
       self.failUnlessEqual(dsds[2,4,1,3],0.0,"ds/ds has wrong value at (2,4,1,3).")  
       self.failUnlessEqual(dsds[2,4,1,4],0.0,"ds/ds has wrong value at (2,4,1,4).")  
       self.failUnlessEqual(dsds[2,4,2,0],0.0,"ds/ds has wrong value at (2,4,2,0).")  
       self.failUnlessEqual(dsds[2,4,2,1],0.0,"ds/ds has wrong value at (2,4,2,1).")  
       self.failUnlessEqual(dsds[2,4,2,2],0.0,"ds/ds has wrong value at (2,4,2,2).")  
       self.failUnlessEqual(dsds[2,4,2,3],0.0,"ds/ds has wrong value at (2,4,2,3).")  
       self.failUnlessEqual(dsds[2,4,2,4],1.0,"ds/ds has wrong value at (2,4,2,4).")  
       self.failUnlessEqual(dsds[2,4,3,0],0.0,"ds/ds has wrong value at (2,4,3,0).")  
       self.failUnlessEqual(dsds[2,4,3,1],0.0,"ds/ds has wrong value at (2,4,3,1).")  
       self.failUnlessEqual(dsds[2,4,3,2],0.0,"ds/ds has wrong value at (2,4,3,2).")  
       self.failUnlessEqual(dsds[2,4,3,3],0.0,"ds/ds has wrong value at (2,4,3,3).")  
       self.failUnlessEqual(dsds[2,4,3,4],0.0,"ds/ds has wrong value at (2,4,3,4).")  
       self.failUnlessEqual(dsds[3,0,0,0],0.0,"ds/ds has wrong value at (3,0,0,0).")  
       self.failUnlessEqual(dsds[3,0,0,1],0.0,"ds/ds has wrong value at (3,0,0,1).")  
       self.failUnlessEqual(dsds[3,0,0,2],0.0,"ds/ds has wrong value at (3,0,0,2).")  
       self.failUnlessEqual(dsds[3,0,0,3],0.0,"ds/ds has wrong value at (3,0,0,3).")  
       self.failUnlessEqual(dsds[3,0,0,4],0.0,"ds/ds has wrong value at (3,0,0,4).")  
       self.failUnlessEqual(dsds[3,0,1,0],0.0,"ds/ds has wrong value at (3,0,1,0).")  
       self.failUnlessEqual(dsds[3,0,1,1],0.0,"ds/ds has wrong value at (3,0,1,1).")  
       self.failUnlessEqual(dsds[3,0,1,2],0.0,"ds/ds has wrong value at (3,0,1,2).")  
       self.failUnlessEqual(dsds[3,0,1,3],0.0,"ds/ds has wrong value at (3,0,1,3).")  
       self.failUnlessEqual(dsds[3,0,1,4],0.0,"ds/ds has wrong value at (3,0,1,4).")  
       self.failUnlessEqual(dsds[3,0,2,0],0.0,"ds/ds has wrong value at (3,0,2,0).")  
       self.failUnlessEqual(dsds[3,0,2,1],0.0,"ds/ds has wrong value at (3,0,2,1).")  
       self.failUnlessEqual(dsds[3,0,2,2],0.0,"ds/ds has wrong value at (3,0,2,2).")  
       self.failUnlessEqual(dsds[3,0,2,3],0.0,"ds/ds has wrong value at (3,0,2,3).")  
       self.failUnlessEqual(dsds[3,0,2,4],0.0,"ds/ds has wrong value at (3,0,2,4).")  
       self.failUnlessEqual(dsds[3,0,3,0],1.0,"ds/ds has wrong value at (3,0,3,0).")  
       self.failUnlessEqual(dsds[3,0,3,1],0.0,"ds/ds has wrong value at (3,0,3,1).")  
       self.failUnlessEqual(dsds[3,0,3,2],0.0,"ds/ds has wrong value at (3,0,3,2).")  
       self.failUnlessEqual(dsds[3,0,3,3],0.0,"ds/ds has wrong value at (3,0,3,3).")  
       self.failUnlessEqual(dsds[3,0,3,4],0.0,"ds/ds has wrong value at (3,0,3,4).")  
       self.failUnlessEqual(dsds[3,1,0,0],0.0,"ds/ds has wrong value at (3,1,0,0).")  
       self.failUnlessEqual(dsds[3,1,0,1],0.0,"ds/ds has wrong value at (3,1,0,1).")  
       self.failUnlessEqual(dsds[3,1,0,2],0.0,"ds/ds has wrong value at (3,1,0,2).")  
       self.failUnlessEqual(dsds[3,1,0,3],0.0,"ds/ds has wrong value at (3,1,0,3).")  
       self.failUnlessEqual(dsds[3,1,0,4],0.0,"ds/ds has wrong value at (3,1,0,4).")  
       self.failUnlessEqual(dsds[3,1,1,0],0.0,"ds/ds has wrong value at (3,1,1,0).")  
       self.failUnlessEqual(dsds[3,1,1,1],0.0,"ds/ds has wrong value at (3,1,1,1).")  
       self.failUnlessEqual(dsds[3,1,1,2],0.0,"ds/ds has wrong value at (3,1,1,2).")  
       self.failUnlessEqual(dsds[3,1,1,3],0.0,"ds/ds has wrong value at (3,1,1,3).")  
       self.failUnlessEqual(dsds[3,1,1,4],0.0,"ds/ds has wrong value at (3,1,1,4).")  
       self.failUnlessEqual(dsds[3,1,2,0],0.0,"ds/ds has wrong value at (3,1,2,0).")  
       self.failUnlessEqual(dsds[3,1,2,1],0.0,"ds/ds has wrong value at (3,1,2,1).")  
       self.failUnlessEqual(dsds[3,1,2,2],0.0,"ds/ds has wrong value at (3,1,2,2).")  
       self.failUnlessEqual(dsds[3,1,2,3],0.0,"ds/ds has wrong value at (3,1,2,3).")  
       self.failUnlessEqual(dsds[3,1,2,4],0.0,"ds/ds has wrong value at (3,1,2,4).")  
       self.failUnlessEqual(dsds[3,1,3,0],0.0,"ds/ds has wrong value at (3,1,3,0).")  
       self.failUnlessEqual(dsds[3,1,3,1],1.0,"ds/ds has wrong value at (3,1,3,1).")  
       self.failUnlessEqual(dsds[3,1,3,2],0.0,"ds/ds has wrong value at (3,1,3,2).")  
       self.failUnlessEqual(dsds[3,1,3,3],0.0,"ds/ds has wrong value at (3,1,3,3).")  
       self.failUnlessEqual(dsds[3,1,3,4],0.0,"ds/ds has wrong value at (3,1,3,4).")  
       self.failUnlessEqual(dsds[3,2,0,0],0.0,"ds/ds has wrong value at (3,2,0,0).")  
       self.failUnlessEqual(dsds[3,2,0,1],0.0,"ds/ds has wrong value at (3,2,0,1).")  
       self.failUnlessEqual(dsds[3,2,0,2],0.0,"ds/ds has wrong value at (3,2,0,2).")  
       self.failUnlessEqual(dsds[3,2,0,3],0.0,"ds/ds has wrong value at (3,2,0,3).")  
       self.failUnlessEqual(dsds[3,2,0,4],0.0,"ds/ds has wrong value at (3,2,0,4).")  
       self.failUnlessEqual(dsds[3,2,1,0],0.0,"ds/ds has wrong value at (3,2,1,0).")  
       self.failUnlessEqual(dsds[3,2,1,1],0.0,"ds/ds has wrong value at (3,2,1,1).")  
       self.failUnlessEqual(dsds[3,2,1,2],0.0,"ds/ds has wrong value at (3,2,1,2).")  
       self.failUnlessEqual(dsds[3,2,1,3],0.0,"ds/ds has wrong value at (3,2,1,3).")  
       self.failUnlessEqual(dsds[3,2,1,4],0.0,"ds/ds has wrong value at (3,2,1,4).")  
       self.failUnlessEqual(dsds[3,2,2,0],0.0,"ds/ds has wrong value at (3,2,2,0).")  
       self.failUnlessEqual(dsds[3,2,2,1],0.0,"ds/ds has wrong value at (3,2,2,1).")  
       self.failUnlessEqual(dsds[3,2,2,2],0.0,"ds/ds has wrong value at (3,2,2,2).")  
       self.failUnlessEqual(dsds[3,2,2,3],0.0,"ds/ds has wrong value at (3,2,2,3).")  
       self.failUnlessEqual(dsds[3,2,2,4],0.0,"ds/ds has wrong value at (3,2,2,4).")  
       self.failUnlessEqual(dsds[3,2,3,0],0.0,"ds/ds has wrong value at (3,2,3,0).")  
       self.failUnlessEqual(dsds[3,2,3,1],0.0,"ds/ds has wrong value at (3,2,3,1).")  
       self.failUnlessEqual(dsds[3,2,3,2],1.0,"ds/ds has wrong value at (3,2,3,2).")  
       self.fail