3 * Interface to GiNaC's clifford objects.
5 * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef __GINAC_CLIFFORD_H__
23 #define __GINAC_CLIFFORD_H__
27 /** Base class for clifford object */
28 class clifford : public indexed
32 // default constructor, destructor, copy constructor assignment operator and helpers
36 clifford(clifford const & other);
37 clifford const & operator=(clifford const & other);
39 void copy(clifford const & other);
40 void destroy(bool call_parent);
44 explicit clifford(string const & initname);
46 // functions overriding virtual functions from base classes
48 basic * duplicate() const;
49 void printraw(ostream & os) const;
50 void printtree(ostream & os, unsigned indent) const;
51 void print(ostream & os, unsigned upper_precedence=0) const;
52 void printcsrc(ostream & os, unsigned type, unsigned upper_precedence=0) const;
53 bool info(unsigned inf) const;
55 int compare_same_type(basic const & other) const;
56 ex simplify_ncmul(exvector const & v) const;
57 unsigned calchash(void) const;
59 // new virtual functions which can be overridden by derived classes
62 // non-virtual functions in this class
64 void setname(string const & n);
66 string & autoname_prefix(void);
72 unsigned serial; // unique serial number for comparision
74 static unsigned next_serial;
79 extern const clifford some_clifford;
80 extern type_info const & typeid_clifford;
84 #define ex_to_clifford(X) static_cast<clifford const &>(*(X).bp)
86 #endif // ndef __GINAC_CLIFFORD_H__