]> www.ginac.de Git - ginac.git/blobdiff - ginac/inifcns.h
- added symmetrize() and antisymmetrize() functions
[ginac.git] / ginac / inifcns.h
index 4c63c8c422ceae2fc98f1878edbd4c34a3fc5475..6a7efbe610a24930690b1462eb42f02427585f9a 100644 (file)
@@ -3,7 +3,7 @@
  *  Interface to GiNaC's initially known functions. */
 
 /*
- *  GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2001 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
@@ -26,9 +26,7 @@
 #include "function.h"
 #include "ex.h"
 
-#ifndef NO_NAMESPACE_GINAC
 namespace GiNaC {
-#endif // ndef NO_NAMESPACE_GINAC
 
 /** Absolute value. */
 DECLARE_FUNCTION_1P(abs)
@@ -135,15 +133,38 @@ DECLARE_FUNCTION_2P(Derivative)
 
 ex lsolve(const ex &eqns, const ex &symbols);
 
-ex ncpower(const ex &basis, unsigned exponent);
+/** Power of non-commutative basis. */
+ex ncpow(const ex & basis, unsigned exponent);
+
+/** Symmetrize expression over a set of objects (symbols, indices). */
+ex symmetrize(const ex & e, exvector::const_iterator first, exvector::const_iterator last);
+
+/** Symmetrize expression over a set of objects (symbols, indices). */
+inline ex symmetrize(const ex & e, const exvector & v)
+{
+       return symmetrize(e, v.begin(), v.end());
+}
+
+/** Symmetrize expression over a list of objects (symbols, indices). */
+ex symmetrize(const ex & e, const lst & l);
+
+/** Antisymmetrize expression over a set of objects (symbols, indices). */
+ex antisymmetrize(const ex & e, exvector::const_iterator first, exvector::const_iterator last);
+
+/** Antisymmetrize expression over a set of objects (symbols, indices). */
+inline ex antisymmetrize(const ex & e, const exvector & v)
+{
+       return antisymmetrize(e, v.begin(), v.end());
+}
+
+/** Antisymmetrize expression over a list of objects (symbols, indices). */
+ex antisymmetrize(const ex & e, const lst & l);
 
 inline bool is_order_function(const ex & e)
 {
        return is_ex_the_function(e, Order);
 }
 
-#ifndef NO_NAMESPACE_GINAC
 } // namespace GiNaC
-#endif // ndef NO_NAMESPACE_GINAC
 
 #endif // ndef __GINAC_INIFCNS_H__