X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Ftensor.cpp;h=cec35808b516220a62411c530224fcc27d568104;hp=89fc6a0767898cc9b89c020eee8523ef5446add8;hb=9985e28882888663fd8e43e8c59728ddcad552d0;hpb=67edef78ce992a8f6ad704bfac228b8dec6eacd2 diff --git a/ginac/tensor.cpp b/ginac/tensor.cpp index 89fc6a07..cec35808 100644 --- a/ginac/tensor.cpp +++ b/ginac/tensor.cpp @@ -3,7 +3,7 @@ * Implementation of GiNaC's special tensors. */ /* - * GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2020 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"));