* Implementation of GiNaC's special tensors. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2015 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)
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);
+ }
+ }
}
}