]> 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 5bd60159dd9553fab62a027f8d221dbb23056c72..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
@@ -26,6 +27,8 @@
 #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
  *  programs like 'ginsh' that want to associate symbols with expressions.
@@ -108,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)
@@ -122,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__