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__
27 #include <ginac/idx.h>
29 class lorentzidx : public idx
31 friend class simp_lor;
32 friend class scalar_products;
36 // default constructor, destructor, copy constructor assignment operator and helpers
40 lorentzidx (lorentzidx const & other);
41 lorentzidx const & operator=(lorentzidx const & other);
43 void copy(lorentzidx const & other);
44 void destroy(bool call_parent);
48 explicit lorentzidx(bool cov, bool oonly=false, unsigned dimp=0);
49 explicit lorentzidx(string const & n, bool cov=false,
50 bool oonly=false, unsigned dimp=0);
51 explicit lorentzidx(char const * n, bool cov=false,
52 bool oonly=false, unsigned dimp=0);
53 explicit lorentzidx(unsigned const v, bool cov=false);
55 // functions overriding virtual functions from bases classes
57 basic * duplicate() const;
58 void printraw(ostream & os) const;
59 void printtree(ostream & os, unsigned indent) const;
60 void print(ostream & os, unsigned upper_precedence=0) const;
61 bool info(unsigned inf) const;
63 // new virtual functions which can be overridden by derived classes
66 // non-virtual functions in this class
68 bool is_orthogonal_only(void) const { return orthogonal_only; }
69 unsigned get_dim_parallel_space(void) const { return dim_parallel_space; }
70 lorentzidx create_anonymous_representative(void) const;
75 unsigned dim_parallel_space;
80 extern const lorentzidx some_lorentzidx;
81 extern type_info const & typeid_lorentzidx;
85 #define ex_to_lorentzidx(X) (static_cast<lorentzidx const &>(*(X).bp))
87 #endif // ndef __GINAC_LORENTZIDX_H__