X-Git-Url: https://ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Fsymmetry.cpp;h=9719531e3e72959fc38ea47c353ee4c9b82fa59b;hb=aed514f534cc6b4438822c1fcf80c203a828a94c;hp=146700397ec83d2b2f6738ea0d29abb909694327;hpb=1b8bcb068171ce9d5c8202ae3c76647b65c9a06d;p=ginac.git diff --git a/ginac/symmetry.cpp b/ginac/symmetry.cpp index 14670039..9719531e 100644 --- a/ginac/symmetry.cpp +++ b/ginac/symmetry.cpp @@ -3,7 +3,7 @@ * Implementation of GiNaC's symmetry definitions. */ /* - * GiNaC Copyright (C) 1999-2015 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2022 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 @@ -325,71 +325,71 @@ void symmetry::validate(unsigned n) static const symmetry & index0() { - static ex s = (new symmetry(0))->setflag(status_flags::dynallocated); + static ex s = dynallocate(0); return ex_to(s); } static const symmetry & index1() { - static ex s = (new symmetry(1))->setflag(status_flags::dynallocated); + static ex s = dynallocate(1); return ex_to(s); } static const symmetry & index2() { - static ex s = (new symmetry(2))->setflag(status_flags::dynallocated); + static ex s = dynallocate(2); return ex_to(s); } static const symmetry & index3() { - static ex s = (new symmetry(3))->setflag(status_flags::dynallocated); + static ex s = dynallocate(3); return ex_to(s); } const symmetry & not_symmetric() { - static ex s = (new symmetry)->setflag(status_flags::dynallocated); + static ex s = dynallocate(); return ex_to(s); } const symmetry & symmetric2() { - static ex s = (new symmetry(symmetry::symmetric, index0(), index1()))->setflag(status_flags::dynallocated); + static ex s = dynallocate(symmetry::symmetric, index0(), index1()); return ex_to(s); } const symmetry & symmetric3() { - static ex s = (new symmetry(symmetry::symmetric, index0(), index1()))->add(index2()).setflag(status_flags::dynallocated); + static ex s = dynallocate(symmetry::symmetric, index0(), index1()).add(index2()); return ex_to(s); } const symmetry & symmetric4() { - static ex s = (new symmetry(symmetry::symmetric, index0(), index1()))->add(index2()).add(index3()).setflag(status_flags::dynallocated); + static ex s = dynallocate(symmetry::symmetric, index0(), index1()).add(index2()).add(index3()); return ex_to(s); } const symmetry & antisymmetric2() { - static ex s = (new symmetry(symmetry::antisymmetric, index0(), index1()))->setflag(status_flags::dynallocated); + static ex s = dynallocate(symmetry::antisymmetric, index0(), index1()); return ex_to(s); } const symmetry & antisymmetric3() { - static ex s = (new symmetry(symmetry::antisymmetric, index0(), index1()))->add(index2()).setflag(status_flags::dynallocated); + static ex s = dynallocate(symmetry::antisymmetric, index0(), index1()).add(index2()); return ex_to(s); } const symmetry & antisymmetric4() { - static ex s = (new symmetry(symmetry::antisymmetric, index0(), index1()))->add(index2()).add(index3()).setflag(status_flags::dynallocated); + static ex s = dynallocate(symmetry::antisymmetric, index0(), index1()).add(index2()).add(index3()); return ex_to(s); } -class sy_is_less : public std::binary_function { +class sy_is_less { exvector::iterator v; public: @@ -413,7 +413,7 @@ public: } }; -class sy_swap : public std::binary_function { +class sy_swap { exvector::iterator v; public: @@ -513,7 +513,7 @@ static ex symm(const ex & e, exvector::const_iterator first, exvector::const_ite } sum_v.push_back(term); } - ex sum = (new add(sum_v))->setflag(status_flags::dynallocated); + ex sum = dynallocate(sum_v); delete[] iv; delete[] iv2;