]> www.ginac.de Git - ginac.git/blobdiff - ginac/symbol.h
- rotate_31() and golden_hash_ratio() moved to utils.h
[ginac.git] / ginac / symbol.h
index 8b8e9a76cff9ac457f63cd25fbdadb64ea74edaa..9905f3c861efe501dd2a365ed795f98bbf36427a 100644 (file)
@@ -1,7 +1,8 @@
 /** @file symbol.h
  *
- *  Interface to GiNaC's symbolic objects.
- *
+ *  Interface to GiNaC's symbolic objects. */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
 #define __GINAC_SYMBOL_H__
 
 #include <string>
+#include <ginac/basic.h>
+#include <ginac/ex.h>
+
+namespace GiNaC {
 
 /** Basic CAS symbol.  It has a name because it must know how to output itself.
  *  It may be assigned an expression, but this feature is only intended for
@@ -106,9 +111,11 @@ private:
 extern const symbol some_symbol;
 extern type_info const & typeid_symbol;
 
-// macros
-
-#define ex_to_symbol(X) static_cast<symbol const &>(*(X).bp)
+// utility functions
+inline const symbol &ex_to_symbol(const ex &e)
+{
+       return static_cast<const symbol &>(*e.bp);
+}
 
 // wrapper functions around member functions
 inline void unassign(symbol & symarg)
@@ -120,4 +127,6 @@ inline int degree(symbol const & a, symbol const & s)
 inline int ldegree(symbol const & a, symbol const & s)
 { return a.ldegree(s); }
 
+} // namespace GiNaC
+
 #endif // ndef __GINAC_SYMBOL_H__