]> www.ginac.de Git - ginac.git/blobdiff - ginac/structure.cpp
- Added some tests from the Lewis-Wester testsuite.
[ginac.git] / ginac / structure.cpp
index d17bab24499ca17033dea6a1868207d9b9e17b5c..4e27c49e1db8fc499f8a190a8fd4db3c82969c6f 100644 (file)
@@ -2,9 +2,32 @@
  *
  *  Implementation of 'abstract' class structure. */
 
+/*
+ *  GiNaC Copyright (C) 1999-2000 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
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  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
+ */
+
 #include <string>
 
-#include "ginac.h"
+#include "structure.h"
+#include "debugmsg.h"
+
+#ifndef NO_NAMESPACE_GINAC
+namespace GiNaC {
+#endif // ndef NO_NAMESPACE_GINAC
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -15,7 +38,7 @@
 structure::structure()
 {
     debugmsg("structure default constructor",LOGLEVEL_CONSTRUCT);
-    tinfo_key = TINFO_STRUCTURE;
+    tinfo_key = TINFO_structure;
 }
 
 structure::~structure()
@@ -24,13 +47,13 @@ structure::~structure()
     destroy(0);
 }
 
-structure::structure(structure const & other)
+structure::structure(const structure & other)
 {
     debugmsg("structure copy constructor",LOGLEVEL_CONSTRUCT);
     copy(other);
 }
 
-structure const & structure::operator=(structure const & other)
+const structure & structure::operator=(const structure & other)
 {
     debugmsg("structure operator=",LOGLEVEL_ASSIGNMENT);
     if (this != &other) {
@@ -42,7 +65,7 @@ structure const & structure::operator=(structure const & other)
 
 // protected
 
-void structure::copy(structure const & other)
+void structure::copy(const structure & other)
 {
     basic::copy(other);
 }
@@ -102,15 +125,15 @@ void structure::printcsrc(ostream & os, unsigned type, unsigned upper_precedence
 
 // protected
 
-int structure::compare_same_type(basic const & other) const
+int structure::compare_same_type(const basic & other) const
 {
-    ASSERT(is_of_type(other, structure));
+    GINAC_ASSERT(is_of_type(other, structure));
     return 0; // all structures are the same
 }
 
-bool structure::is_equal_same_type(basic const & other) const
+bool structure::is_equal_same_type(const basic & other) const
 {
-    ASSERT(is_of_type(other, structure));
+    GINAC_ASSERT(is_of_type(other, structure));
     return true; // all structures are the same
 }
 
@@ -134,7 +157,7 @@ vector<registered_structure_info> & structure::registered_structures(void)
 
 // public
 
-unsigned structure::register_new(char const * nm)
+unsigned structure::register_new(const char * nm)
 {
     registered_structure_info rsi={nm};
     registered_structures().push_back(rsi);
@@ -152,5 +175,8 @@ unsigned structure::register_new(char const * nm)
 //////////
 
 const structure some_structure;
-type_info const & typeid_structure=typeid(some_structure);
+const type_info & typeid_structure=typeid(some_structure);
 
+#ifndef NO_NAMESPACE_GINAC
+} // namespace GiNaC
+#endif // ndef NO_NAMESPACE_GINAC