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

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

  $Revision: 1.2 $
  $Id: test_ncmul.py,v 1.2 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 test_all
import ginac

class test_ncmul(ginac.ncmul):
    def __init__(self):
        """
        >>> ncmul()
        numeric('1')
        >>> f = newfunction('f')
        >>> x = symbol('x')
        >>> n = f(lst (x)).diff(x)
        >>> test_save(n=n,x=x)
        >>> n
        ncmul(D[0](f)(lst(symbol('x'))),lst(numeric('1')))
        """
    def get_precedence(self):
        """
        >>> n.get_precedence()
        50
        """
    def get_class_name(self):
        """
        >>> n.get_class_name()
        'ncmul'
        """
    def __str__(self):
        """See to_string."""
    def __repr__(self):
        """See __init__."""
    def __str__(self):
        """
        >>> n.__str__()
        'D[0](f)([x])*[1]'
        >>> (n).__str__()
        'D[0](f)([x])*[1]'
        """
    def extract_archived(self):
        """
        >>> n.extract_archived()
        {'seq': [{'seq': [{'seq': [{'class': 'symbol', 'name': 'x'}], 'class': 'lst'}], 'class': 'fderivative', 'name': 'f', 'param': [0L]}, {'seq': [{'number': '1', 'class': 'numeric'}], 'class': 'lst'}], 'class': 'ncmul'}
        """
    def to_context(self):
        """
        >>> n.to_context('context')
        'D[0](f)({x})*{1}'
        >>> n.to_context()
        'D[0](f)([x])*[1]'
        >>> n.to_context('python_repr')
        "ncmul(D[0](f)(lst(symbol('x'))),lst(numeric('1')))"
        >>> n.to_context('latex')
        'D[0](f)({x})*{1}'
        >>> n.to_context('csrc')
        'ncmul(D[0](f)({x}),{1.000000e+00})'
        """
    def nops(self):
        """
        >>> n.nops()
        2
        """
    def op(self):
        """
        >>> n.op(0)
        D[0](f)(lst(symbol('x')))
        >>> n.op(1)
        lst(numeric('1'))
        """
    def get_hash(self):
        pass

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

if __name__ == "__main__":
    _test()

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