]> www.ginac.de Git - ginac.git/blobdiff - ginac/ncmul.h
- implemented global class registry (for class basic and derived classes)
[ginac.git] / ginac / ncmul.h
index 458c5ecc159e6fa79b34da327e5b94751b3f4b1d..10477938504795cc7390861e07191b5cc09ea278 100644 (file)
@@ -3,7 +3,7 @@
  *  Interface to GiNaC's non-commutative products of expressions. */
 
 /*
  *  Interface to GiNaC's non-commutative products of expressions. */
 
 /*
- *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ *  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
  *
  *  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
 
 #include <ginac/exprseq.h>
 
 
 #include <ginac/exprseq.h>
 
+#ifndef NO_GINAC_NAMESPACE
+namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
+
 /** Non-commutative product of expressions. */
 class ncmul : public exprseq
 {
 /** Non-commutative product of expressions. */
 class ncmul : public exprseq
 {
+    GINAC_DECLARE_REGISTERED_CLASS(ncmul, exprseq)
+
     friend class power;
     friend ex nonsimplified_ncmul(exvector const & v);
     friend ex simplified_ncmul(exvector const & v);
     friend class power;
     friend ex nonsimplified_ncmul(exvector const & v);
     friend ex simplified_ncmul(exvector const & v);
@@ -60,8 +66,8 @@ public:
     // functions overriding virtual functions from bases classes
 public:
     basic * duplicate() const;
     // functions overriding virtual functions from bases classes
 public:
     basic * duplicate() const;
-    void printraw(ostream & os) const;
     void print(ostream & os, unsigned upper_precedence) const;
     void print(ostream & os, unsigned upper_precedence) const;
+    void printraw(ostream & os) const;
     void printcsrc(ostream & os, unsigned upper_precedence) const;
     bool info(unsigned inf) const;
     int degree(symbol const & s) const;
     void printcsrc(ostream & os, unsigned upper_precedence) const;
     bool info(unsigned inf) const;
     int degree(symbol const & s) const;
@@ -106,7 +112,14 @@ extern type_info const & typeid_ncmul;
 ex nonsimplified_ncmul(exvector const & v);
 ex simplified_ncmul(exvector const & v);
 
 ex nonsimplified_ncmul(exvector const & v);
 ex simplified_ncmul(exvector const & v);
 
-#define ex_to_ncmul(X) static_cast<ncmul const &>(*(X).bp)
+// utility functions
+inline const ncmul &ex_to_ncmul(const ex &e)
+{
+       return static_cast <const ncmul &>(*e.bp);
+}
 
 
-#endif // ndef __GINAC_NCMUL_H__
+#ifndef NO_GINAC_NAMESPACE
+} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
 
 
+#endif // ndef __GINAC_NCMUL_H__