File:  [CENS] / python / pyGiNaC / test4 / test_build_function.py
Revision 1.2: download - view: text, annotated - select for diffs - revision graph
Tue Aug 21 08:17:17 2001 UTC (16 years, 3 months ago) by pearu
Branches: MAIN
CVS tags: HEAD
Fixed D[0,0] bug, introduced newfunction

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

  $Revision: 1.2 $
  $Id: test_build_function.py,v 1.2 2001-08-21 08:17:17 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_build_function(ginac.function):
    def __init__(self):
        """
        >>> sin(2)
        sin(numeric('2'))
        >>> atan2(3,4)
        atan2(numeric('3'), numeric('4'))
        """
    def get_precedence(self):
        """
        >>> sin(2).get_precedence()
        70
        """
    def get_class_name(self):
        """
        >>> sin(2).get_class_name()
        'function'
        """
    def get_name(self):
        """
        >>> sin(2).get_name()
        'sin'
        """
    def get_serial(self):
        """
        >>> sin(2).get_serial()
        9
        """
    def extract_archived(self):
        """
        >>> sin(2).extract_archived()
        {'seq': [{'number': '2', 'class': 'numeric'}], 'class': 'function', 'name': 'sin'}
        """
    def to_context(self):
        """
        >>> sin(2).to_context()
        'sin(2)'
        >>> sin(2).to_context('latex')
        '\\\\sin(2)'
        >>> sin(2).to_context('csrc')
        'sin(2.000000e+00)'
        """
    def evalf(self):
        """
        >>> sin(2).evalf()
        numeric('0.9092974268256816954')
        """
    def __str__(self):
        """See to_string."""
    def to_string(self):
        """
        >>> sin(2).to_string()
        'sin(2)'
        >>> atan2(3,4).to_string()
        'atan2(3, 4)'
        """
    def get_hash(self):
        pass

def _test():
    import test_build_function
    return test_all.test(test_build_function)

if __name__ == "__main__":
    _test()

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