]> www.ginac.de Git - ginac.git/blobdiff - ginac/symbol.cpp
Synced to HEAD:
[ginac.git] / ginac / symbol.cpp
index 32c44802402882084cacae793231837d8832e16f..0e51f0e588f9a08bd938333c7fdbceae896b416f 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's symbolic objects. */
 
 /*
- *  GiNaC Copyright (C) 1999-2005 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2007 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
  */
 
 #include <string>
@@ -190,19 +190,22 @@ void symbol::do_print_python_repr(const print_python_repr & c, unsigned level) c
 
 bool symbol::info(unsigned inf) const
 {
-       if (inf == info_flags::symbol)
-               return true;
-       if (inf == info_flags::polynomial ||
-           inf == info_flags::integer_polynomial ||
-           inf == info_flags::cinteger_polynomial ||
-           inf == info_flags::rational_polynomial ||
-           inf == info_flags::crational_polynomial ||
-           inf == info_flags::rational_function)
-               return true;
-       if (inf == info_flags::real)
-               return domain == domain::real;
-       else
-               return inherited::info(inf);
+       switch (inf) {
+               case info_flags::symbol:
+               case info_flags::polynomial:
+               case info_flags::integer_polynomial: 
+               case info_flags::cinteger_polynomial: 
+               case info_flags::rational_polynomial: 
+               case info_flags::crational_polynomial: 
+               case info_flags::rational_function: 
+               case info_flags::expanded:
+                       return true;
+               case info_flags::has_indices:
+                       return false;
+               case info_flags::real:
+                       return domain == domain::real;
+       }
+       return inherited::info(inf);
 }
 
 ex symbol::eval(int level) const