* Implementation of GiNaC's non-commutative products of expressions. */
/*
- * GiNaC Copyright (C) 1999-2003 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2004 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
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(ncmul, exprseq,
print_func<print_context>(&ncmul::do_print).
- print_func<print_tree>(&basic::do_print_tree).
+ print_func<print_tree>(&ncmul::do_print_tree).
print_func<print_csrc>(&ncmul::do_print_csrc).
print_func<print_python_repr>(&ncmul::do_print_csrc))
return (new ncmul(vp))->setflag(status_flags::dynallocated);
}
+ex ncmul::conjugate() const
+{
+ if (return_type() != return_types::noncommutative) {
+ return exprseq::conjugate();
+ }
+
+ if (return_type_tinfo() & 0xffffff00U != TINFO_clifford) {
+ return exprseq::conjugate();
+ }
+
+ exvector ev;
+ ev.reserve(nops());
+ for (const_iterator i=end(); i!=begin();) {
+ --i;
+ ev.push_back(i->conjugate());
+ }
+ return (new ncmul(ev, true))->setflag(status_flags::dynallocated).eval();
+}
+
// protected
/** Implementation of ex::diff() for a non-commutative product. It applies