X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fcontainer.h;h=28cf05e44546ee511ad8d888a2d046fb63afe634;hp=c5dd6253359013d27c82de19acd459ea00b4330e;hb=92203097b593322eda950cf8c831177a0c204129;hpb=695f6ae955ec530cded8f21efd5569df39447f76 diff --git a/ginac/container.h b/ginac/container.h index c5dd6253..28cf05e4 100644 --- a/ginac/container.h +++ b/ginac/container.h @@ -3,7 +3,7 @@ * Wrapper template for making GiNaC classes out of STL containers. */ /* - * GiNaC Copyright (C) 1999-2005 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2006 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __GINAC_CONTAINER_H__ @@ -137,7 +137,7 @@ public: protected: // helpers - static unsigned get_tinfo() { return TINFO_fail; } + static tinfo_t get_tinfo() { return NULL; } static unsigned get_default_flags() { return 0; } static char get_open_delim() { return '('; } static char get_close_delim() { return ')'; } @@ -394,6 +394,28 @@ protected: return *this; } + ex real_part() const + { + STLT cont; + reserve(cont, nops()); + const_iterator b = begin(); + const_iterator e = end(); + for(const_iterator i=b; i!=e; ++i) + cont.push_back(i->real_part()); + return thiscontainer(cont); + } + + ex imag_part() const + { + STLT cont; + reserve(cont, nops()); + const_iterator b = begin(); + const_iterator e = end(); + for(const_iterator i=b; i!=e; ++i) + cont.push_back(i->imag_part()); + return thiscontainer(cont); + } + bool is_equal_same_type(const basic & other) const; // new virtual functions which can be overridden by derived classes