]> www.ginac.de Git - ginac.git/blobdiff - ginac/tensor.cpp
Omit extra qualification (as in struct foo f() vs foo f()).
[ginac.git] / ginac / tensor.cpp
index 259af3e45d3a579639f1712e7b5100bf9123d9e7..89fc6a0767898cc9b89c020eee8523ef5446add8 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's special tensors. */
 
 /*
- *  GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2010 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
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <iostream>
-#include <stdexcept>
-#include <vector>
-
 #include "tensor.h"
 #include "idx.h"
 #include "indexed.h"
 #include "archive.h"
 #include "utils.h"
 
+#include <iostream>
+#include <stdexcept>
+#include <vector>
+
 namespace GiNaC {
 
 GINAC_IMPLEMENT_REGISTERED_CLASS(tensor, basic)
@@ -364,13 +364,17 @@ ex tensepsilon::eval_indexed(const basic & i) const
                if (minkowski) {
                        for (size_t j=1; j<i.nops(); j++) {
                                const ex & x = i.op(j);
-                               if (!is_a<varidx>(x))
+                               if (!is_a<varidx>(x)) {
                                        throw(std::runtime_error("indices of epsilon tensor in Minkowski space must be of type varidx"));
-                               if (ex_to<varidx>(x).is_covariant())
-                                       if (ex_to<idx>(x).get_value().is_zero())
+                               }
+                               if (ex_to<varidx>(x).is_covariant()) {
+                                       if (ex_to<idx>(x).get_value().is_zero()) {
                                                sign = (pos_sig ? -sign : sign);
-                                       else
+                                       }
+                                       else {
                                                sign = (pos_sig ? sign : -sign);
+                                       }
+                               }
                        }
                }