]> www.ginac.de Git - ginac.git/blobdiff - ginac/add.h
- rotate_31() and golden_hash_ratio() moved to utils.h
[ginac.git] / ginac / add.h
index 783830345b682f4d18ee7bcd6741fc6a77e4104e..37d502a0bfe77925ba55c55743a6264d54762267 100644 (file)
@@ -1,7 +1,8 @@
 /** @file add.h
  *
- *  Interface to GiNaC's sums of expressions.
- *
+ *  Interface to GiNaC's sums of expressions. */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
 #ifndef __GINAC_ADD_H__
 #define __GINAC_ADD_H__
 
+#include <ginac/expairseq.h>
+
+namespace GiNaC {
+
 /** Sum of expressions. */
 class add : public expairseq
 {
@@ -76,8 +81,6 @@ protected:
     unsigned return_type_tinfo(void) const;
     ex thisexpairseq(epvector const & v, ex const & oc) const;
     ex thisexpairseq(epvector * vp, ex const & oc) const;
-    void printpair(ostream & os, expair const & p,
-                   unsigned upper_precedence) const;
     expair split_ex_to_pair(ex const & e) const;
     expair combine_ex_with_coeff_to_pair(ex const & e,
                                          ex const & c) const;
@@ -103,7 +106,12 @@ protected:
 extern const add some_add;
 extern type_info const & typeid_add;
 
-#define ex_to_add(X) static_cast<add const &>(*(X).bp)
+// utility functions
+inline const add &ex_to_add(const ex &e)
+{
+       return static_cast<const add &>(*e.bp);
+}
 
-#endif // ndef __GINAC_ADD_H__
+} // namespace GiNaC
 
+#endif // ndef __GINAC_ADD_H__