*
* 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
*
* 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
indexed(i1,i2), type(t)
{
debugmsg("simp_lor constructor from simp_lor_types,ex,ex",LOGLEVEL_CONSTRUCT);
indexed(i1,i2), type(t)
{
debugmsg("simp_lor constructor from simp_lor_types,ex,ex",LOGLEVEL_CONSTRUCT);
indexed(i1), type(t), name(n)
{
debugmsg("simp_lor constructor from simp_lor_types,string,ex",LOGLEVEL_CONSTRUCT);
indexed(i1), type(t), name(n)
{
debugmsg("simp_lor constructor from simp_lor_types,string,ex",LOGLEVEL_CONSTRUCT);
indexed(iv), type(t), name(n)
{
debugmsg("simp_lor constructor from simp_lor_types,string,exvector",LOGLEVEL_CONSTRUCT);
indexed(iv), type(t), name(n)
{
debugmsg("simp_lor constructor from simp_lor_types,string,exvector",LOGLEVEL_CONSTRUCT);
indexed(ivp), type(t), name(n)
{
debugmsg("simp_lor constructor from simp_lor_types,string,exvector*",LOGLEVEL_CONSTRUCT);
indexed(ivp), type(t), name(n)
{
debugmsg("simp_lor constructor from simp_lor_types,string,exvector*",LOGLEVEL_CONSTRUCT);
if (sig==0) return _ex0();
return ex(sig)*simp_lor(type,name,iv);
}
if (sig==0) return _ex0();
return ex(sig)*simp_lor(type,name,iv);
}
- lorentzidx const & idx1=ex_to_lorentzidx(seq[0]);
- lorentzidx const & idx2=ex_to_lorentzidx(seq[1]);
+ const lorentzidx & idx1=ex_to_lorentzidx(seq[0]);
+ const lorentzidx & idx2=ex_to_lorentzidx(seq[1]);
if ((!idx1.is_symbolic())&&(!idx2.is_symbolic())) {
// both indices are numeric
if ((idx1.get_value()==idx2.get_value())) {
if ((!idx1.is_symbolic())&&(!idx2.is_symbolic())) {
// both indices are numeric
if ((idx1.get_value()==idx2.get_value())) {
{
GINAC_ASSERT(other.tinfo() == TINFO_simp_lor);
const simp_lor *o = static_cast<const simp_lor *>(&other);
{
GINAC_ASSERT(other.tinfo() == TINFO_simp_lor);
const simp_lor *o = static_cast<const simp_lor *>(&other);
{
GINAC_ASSERT(other.tinfo() == TINFO_simp_lor);
const simp_lor *o = static_cast<const simp_lor *>(&other);
{
GINAC_ASSERT(other.tinfo() == TINFO_simp_lor);
const simp_lor *o = static_cast<const simp_lor *>(&other);
{
GINAC_ASSERT(is_ex_exactly_of_type(m,mul));
exvector v_contracted;
// collect factors in an exvector, store squares twice
{
GINAC_ASSERT(is_ex_exactly_of_type(m,mul));
exvector v_contracted;
// collect factors in an exvector, store squares twice
ex f=m.op(i);
if (is_ex_exactly_of_type(f,power)&&f.op(1).is_equal(_ex2())) {
v_contracted.push_back(f.op(0));
v_contracted.push_back(f.op(0));
} else {
v_contracted.push_back(f);
ex f=m.op(i);
if (is_ex_exactly_of_type(f,power)&&f.op(1).is_equal(_ex2())) {
v_contracted.push_back(f.op(0));
v_contracted.push_back(f.op(0));
} else {
v_contracted.push_back(f);
// process only lor_g objects
if (is_ex_exactly_of_type(*it,simp_lor) &&
(ex_to_simp_lor(*it).type==simp_lor::simp_lor_g)) {
// process only lor_g objects
if (is_ex_exactly_of_type(*it,simp_lor) &&
(ex_to_simp_lor(*it).type==simp_lor::simp_lor_g)) {
- idx const & first_idx=ex_to_lorentzidx(g.seq[0]);
- idx const & second_idx=ex_to_lorentzidx(g.seq[1]);
+ const idx & first_idx=ex_to_lorentzidx(g.seq[0]);
+ const idx & second_idx=ex_to_lorentzidx(g.seq[1]);
// g_{mu,mu} should have been contracted in simp_lor::eval()
GINAC_ASSERT(!first_idx.is_equal(second_idx));
ex saved_g=*it; // save to restore it later
// g_{mu,mu} should have been contracted in simp_lor::eval()
GINAC_ASSERT(!first_idx.is_equal(second_idx));
ex saved_g=*it; // save to restore it later
while ((it2!=v_contracted.end())&&!jump_to_next) {
if (is_ex_exactly_of_type(*it2,simp_lor) &&
(ex_to_simp_lor(*it2).type==simp_lor::simp_lor_vec)) {
while ((it2!=v_contracted.end())&&!jump_to_next) {
if (is_ex_exactly_of_type(*it2,simp_lor) &&
(ex_to_simp_lor(*it2).type==simp_lor::simp_lor_vec)) {
- lorentzidx const & idx1=ex_to_lorentzidx(vec1.seq[0]);
- lorentzidx const & idx2=ex_to_lorentzidx(vec2.seq[0]);
+ const lorentzidx & idx1=ex_to_lorentzidx(vec1.seq[0]);
+ const lorentzidx & idx2=ex_to_lorentzidx(vec2.seq[0]);
if (idx1.is_symbolic() &&
idx1.is_co_contra_pair(idx2) &&
sp.is_defined(vec1,vec2)) {
if (idx1.is_symbolic() &&
idx1.is_co_contra_pair(idx2) &&
sp.is_defined(vec1,vec2)) {
// simplification of sum=sum of simplifications
if (is_ex_exactly_of_type(e_expanded,add)) {
ex sum=_ex0();
// simplification of sum=sum of simplifications
if (is_ex_exactly_of_type(e_expanded,add)) {
ex sum=_ex0();
{
if (v1.compare_same_type(v2)>0) {
return is_defined(v2,v1);
{
if (v1.compare_same_type(v2)>0) {
return is_defined(v2,v1);
{
cerr << "map size=" << spm.size() << endl;
for (spmap::const_iterator cit=spm.begin(); cit!=spm.end(); ++cit) {
{
cerr << "map size=" << spm.size() << endl;
for (spmap::const_iterator cit=spm.begin(); cit!=spm.end(); ++cit) {
cerr << "item key=((" << k.first.first
<< "," << k.first.second << "),";
k.second.printraw(cerr);
cerr << "item key=((" << k.first.first
<< "," << k.first.second << "),";
k.second.printraw(cerr);