X-Git-Url: https://ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Ftensor.cpp;h=2f12154d7023556911ea176c2478d74d3cab45bf;hb=3ea59519b3fa572a2aba7b8540b336dcb2924262;hp=42056ed150d61668c5a5923fd26fa159bebd340d;hpb=286b0d93528e35957a50c51343e0b4a9bc623bce;p=ginac.git diff --git a/ginac/tensor.cpp b/ginac/tensor.cpp index 42056ed1..2f12154d 100644 --- a/ginac/tensor.cpp +++ b/ginac/tensor.cpp @@ -3,7 +3,7 @@ * Implementation of GiNaC's special tensors. */ /* - * GiNaC Copyright (C) 1999-2011 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2019 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 @@ -576,7 +576,7 @@ bool tensepsilon::contract_with(exvector::iterator self, exvector::iterator othe ex delta_tensor(const ex & i1, const ex & i2) { - static ex delta = (new tensdelta)->setflag(status_flags::dynallocated); + static ex delta = dynallocate(); if (!is_a(i1) || !is_a(i2)) throw(std::invalid_argument("indices of delta tensor must be of type idx")); @@ -586,7 +586,7 @@ ex delta_tensor(const ex & i1, const ex & i2) ex metric_tensor(const ex & i1, const ex & i2) { - static ex metric = (new tensmetric)->setflag(status_flags::dynallocated); + static ex metric = dynallocate(); if (!is_a(i1) || !is_a(i2)) throw(std::invalid_argument("indices of metric tensor must be of type varidx")); @@ -596,8 +596,8 @@ ex metric_tensor(const ex & i1, const ex & i2) ex lorentz_g(const ex & i1, const ex & i2, bool pos_sig) { - static ex metric_neg = (new minkmetric(false))->setflag(status_flags::dynallocated); - static ex metric_pos = (new minkmetric(true))->setflag(status_flags::dynallocated); + static ex metric_neg = dynallocate(false); + static ex metric_pos = dynallocate(true); if (!is_a(i1) || !is_a(i2)) throw(std::invalid_argument("indices of metric tensor must be of type varidx")); @@ -607,7 +607,7 @@ ex lorentz_g(const ex & i1, const ex & i2, bool pos_sig) ex spinor_metric(const ex & i1, const ex & i2) { - static ex metric = (new spinmetric)->setflag(status_flags::dynallocated); + static ex metric = dynallocate(); if (!is_a(i1) || !is_a(i2)) throw(std::invalid_argument("indices of spinor metric must be of type spinidx")); @@ -619,7 +619,7 @@ ex spinor_metric(const ex & i1, const ex & i2) ex epsilon_tensor(const ex & i1, const ex & i2) { - static ex epsilon = (new tensepsilon)->setflag(status_flags::dynallocated); + static ex epsilon = dynallocate(); if (!is_a(i1) || !is_a(i2)) throw(std::invalid_argument("indices of epsilon tensor must be of type idx")); @@ -638,7 +638,7 @@ ex epsilon_tensor(const ex & i1, const ex & i2) ex epsilon_tensor(const ex & i1, const ex & i2, const ex & i3) { - static ex epsilon = (new tensepsilon)->setflag(status_flags::dynallocated); + static ex epsilon = dynallocate(); if (!is_a(i1) || !is_a(i2) || !is_a(i3)) throw(std::invalid_argument("indices of epsilon tensor must be of type idx")); @@ -657,8 +657,8 @@ ex epsilon_tensor(const ex & i1, const ex & i2, const ex & i3) ex lorentz_eps(const ex & i1, const ex & i2, const ex & i3, const ex & i4, bool pos_sig) { - static ex epsilon_neg = (new tensepsilon(true, false))->setflag(status_flags::dynallocated); - static ex epsilon_pos = (new tensepsilon(true, true))->setflag(status_flags::dynallocated); + static ex epsilon_neg = dynallocate(true, false); + static ex epsilon_pos = dynallocate(true, true); if (!is_a(i1) || !is_a(i2) || !is_a(i3) || !is_a(i4)) throw(std::invalid_argument("indices of Lorentz epsilon tensor must be of type varidx"));