Annotation of python/pyGiNaC/wrappers/ginac_enhancements.cpp, revision 1.1

1.1     ! pearu       1: /*
        !             2: # This file is part of the PyGiNaC package.
        !             3: # http://cens.ioc.ee/projects/pyginac/
        !             4: #
        !             5: # $Revision: 1.4 $
        !             6: # $Id: python_repr.cpp,v 1.4 2001/04/11 20:31:31 pearu Exp $
        !             7: #
        !             8: # Copyright 2001 Pearu Peterson all rights reserved,
        !             9: # Pearu Peterson <pearu@cens.ioc.ee>
        !            10: # Permission to use, modify, and distribute this software is given under the
        !            11: # terms of the LGPL.  See http://www.fsf.org
        !            12: #
        !            13: # NO WARRANTY IS EXPRESSED OR IMPLIED.  USE AT YOUR OWN RISK.
        !            14: #
        !            15: */
        !            16: 
        !            17: #include <ginac/ginac.h>
        !            18: 
        !            19: namespace GiNaC {
        !            20: 
        !            21:   
        !            22:   ex basic::collect(const ex & s) const
        !            23:   {
        !            24:        ex x;
        !            25:        for (int n=this->ldegree(s), m=this->degree(s); n<=m; ++n)
        !            26:          x += this->coeff(s,n)*power(s,n);
        !            27: 
        !            28:        x += (*this - x).expand();
        !            29:        return x;
        !            30:   }
        !            31: 
        !            32: 
        !            33: }

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