X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=check%2Fexam_indexed.cpp;h=69816a74bcf81c34160d69fddf6a8b9344163340;hp=4d09bdff625303e7badfb2427b9c2dc30e8ee312;hb=a775c17c710b9fbca130b2f638a0f463b8b56585;hpb=ee1af48a44dbe1e3b743c3683cd3601deb7ce0ed diff --git a/check/exam_indexed.cpp b/check/exam_indexed.cpp index 4d09bdff..69816a74 100644 --- a/check/exam_indexed.cpp +++ b/check/exam_indexed.cpp @@ -3,7 +3,7 @@ * Here we test manipulations on GiNaC's indexed objects. */ /* - * GiNaC Copyright (C) 1999-2002 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2003 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 @@ -55,7 +55,7 @@ static unsigned check_equal_simplify(const ex &e1, const ex &e2, const scalar_pr return 0; } -static unsigned delta_check(void) +static unsigned delta_check() { // checks identities of the delta tensor @@ -81,7 +81,7 @@ static unsigned delta_check(void) return result; } -static unsigned metric_check(void) +static unsigned metric_check() { // checks identities of the metric tensor @@ -114,7 +114,7 @@ static unsigned metric_check(void) return result; } -static unsigned epsilon_check(void) +static unsigned epsilon_check() { // checks identities of the epsilon tensor @@ -148,7 +148,12 @@ static unsigned epsilon_check(void) return result; } -static unsigned symmetry_check(void) +DECLARE_FUNCTION_2P(symm_fcn) +REGISTER_FUNCTION(symm_fcn, set_symmetry(sy_symm(0, 1))); +DECLARE_FUNCTION_2P(anti_fcn) +REGISTER_FUNCTION(anti_fcn, set_symmetry(sy_anti(0, 1))); + +static unsigned symmetry_check() { // check symmetric/antisymmetric objects @@ -190,10 +195,14 @@ static unsigned symmetry_check(void) e = (indexed(A, sy_anti(), i, j, k, l) * (indexed(B, j) * indexed(C, k) + indexed(B, k) * indexed(C, j)) + indexed(B, i, l)).expand(); result += check_equal_simplify(e, indexed(B, i, l)); + result += check_equal(symm_fcn(0, 1) + symm_fcn(1, 0), 2*symm_fcn(0, 1)); + result += check_equal(anti_fcn(0, 1) + anti_fcn(1, 0), 0); + result += check_equal(anti_fcn(0, 0), 0); + return result; } -static unsigned scalar_product_check(void) +static unsigned scalar_product_check() { // check scalar product replacement @@ -216,7 +225,7 @@ static unsigned scalar_product_check(void) return result; } -static unsigned edyn_check(void) +static unsigned edyn_check() { // Relativistic electrodynamics @@ -303,7 +312,7 @@ static unsigned edyn_check(void) return result; } -static unsigned spinor_check(void) +static unsigned spinor_check() { // check identities of the spinor metric @@ -338,7 +347,7 @@ static unsigned spinor_check(void) return result; } -static unsigned dummy_check(void) +static unsigned dummy_check() { // check dummy index renaming/repositioning @@ -371,7 +380,7 @@ static unsigned dummy_check(void) return result; } -unsigned exam_indexed(void) +unsigned exam_indexed() { unsigned result = 0;