]> www.ginac.de Git - ginac.git/blobdiff - ginac/indexed.h
- rotate_31() and golden_hash_ratio() moved to utils.h
[ginac.git] / ginac / indexed.h
index 4bade0b2666f5cde9bac718daf097913d08c3fd3..3707e6290184d56d613b135a3ab0c7536a3df1ca 100644 (file)
@@ -2,15 +2,31 @@
  *
  *  Interface to GiNaC's index carrying objects. */
 
-#ifndef _INDEXED_H_
-#define _INDEXED_H_
+/*
+ *  GiNaC Copyright (C) 1999 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
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
-#include <string>
+#ifndef __GINAC_INDEXED_H__
+#define __GINAC_INDEXED_H__
 
-class indexed;
+#include <string>
+#include <ginac/exprseq.h>
 
-#include "exprseq.h"
-#include "idx.h"
+namespace GiNaC {
 
 /** Base class for non-commutative indexed objects */
 class indexed : public exprseq
@@ -72,10 +88,12 @@ protected:
 extern const indexed some_indexed;
 extern type_info const & typeid_indexed;
 
-// macros
-
-#define ex_to_indexed(X) static_cast<indexed const &>(*(X).bp)
-
-#endif // ndef _INDEXED_H_
+// utility functions
+inline const indexed &ex_to_indexed(const ex &e)
+{
+       return static_cast<const indexed &>(*e.bp);
+}
 
+} // namespace GiNaC
 
+#endif // ndef __GINAC_INDEXED_H__