File:  [CENS] / python / pyGiNaC / test4 / test_D.py
Revision 1.4: download - view: text, annotated - select for diffs - revision graph
Mon Nov 26 22:37:44 2001 UTC (15 years, 11 months ago) by pearu
Branches: MAIN
CVS tags: HEAD
See NEWS.txt (impl. matrix)

#!/usr/bin/env python
"""
  test_D - run ginac.fderivative tests.
  Usage:
    python test_D.py [-v]
"""
"""
  This file is part of the PyGiNaC package.
  http://cens.ioc.ee/projects/pyginac/

  $Revision: 1.4 $
  $Id: test_D.py,v 1.4 2001-11-26 22:37:44 pearu Exp $
 
  Copyright 2001 Pearu Peterson all rights reserved,
  Pearu Peterson <pearu@cens.ioc.ee>
  Permission to use, modify, and distribute this software is given under the
  terms of the LGPL.  See http://www.fsf.org
 
  NO WARRANTY IS EXPRESSED OR IMPLIED.  USE AT YOUR OWN RISK.
"""

import ginac
import test_all

class test_D(ginac.fderivative):
    def __init__(self):
        """
        >>> f = newfunction('f')
        >>> x=symbol('x')
        >>> f(x)
        f(symbol('x'))
        >>> g = f(x).diff(x)
        >>> test_save(f=f,x=x,g=g)
        """
    def extract_archived(self):
        """
        >>> g.extract_archived()
        {'seq': [{'class': 'symbol', 'name': 'x'}], 'class': 'fderivative', 'name': 'f', 'param': [0L]}
        """
    def get_params(self):
        """
        >>> g.get_params()
        [0]
        """
    def get_serial(self):
        """
        >>> f(x).get_serial() == g.get_serial()
        1
        """
    def get_name(self):
        """
        >>> g.get_name()
        'f'
        """
    def __repr__(self):
        """
        >>> g
        D[0](f)(symbol('x'))
        >>> D([0,0], f(x))
        D[0,0](f)(symbol('x'))
        """
    def __str__(self):
        """
        >>> g.__str__()
        'D[0](f)(x)'
        >>> D([0,0], f(x)).__str__()
        'D[0,0](f)(x)'
        """
    def get_class_name(self):
        """
        >>> g.get_class_name()
        'fderivative'
        """
        
def _test():
    import test_D
    return test_all.test(test_D)

if __name__ == "__main__":
    _test()

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>