3 * Interface to GiNaC's lorentz indices.
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_LORENTZIDX_H__
23 #define __GINAC_LORENTZIDX_H__
28 class lorentzidx : public idx
30 friend class simp_lor;
31 friend class scalar_products;
35 // default constructor, destructor, copy constructor assignment operator and helpers
39 lorentzidx (lorentzidx const & other);
40 lorentzidx const & operator=(lorentzidx const & other);
42 void copy(lorentzidx const & other);
43 void destroy(bool call_parent);
47 explicit lorentzidx(bool cov, bool oonly=false, unsigned dimp=0);
48 explicit lorentzidx(string const & n, bool cov=false,
49 bool oonly=false, unsigned dimp=0);
50 explicit lorentzidx(char const * n, bool cov=false,
51 bool oonly=false, unsigned dimp=0);
52 explicit lorentzidx(unsigned const v, bool cov=false);
54 // functions overriding virtual functions from bases classes
56 basic * duplicate() const;
57 void printraw(ostream & os) const;
58 void printtree(ostream & os, unsigned indent) const;
59 void print(ostream & os, unsigned upper_precedence=0) const;
60 bool info(unsigned inf) const;
62 // new virtual functions which can be overridden by derived classes
65 // non-virtual functions in this class
67 bool is_orthogonal_only(void) const { return orthogonal_only; }
68 unsigned get_dim_parallel_space(void) const { return dim_parallel_space; }
69 lorentzidx create_anonymous_representative(void) const;
74 unsigned dim_parallel_space;
79 extern const lorentzidx some_lorentzidx;
80 extern type_info const & typeid_lorentzidx;
84 #define ex_to_lorentzidx(X) (static_cast<lorentzidx const &>(*(X).bp))
86 #endif // ndef __GINAC_LORENTZIDX_H__