/** @file lortensor.cpp
*
- * Implementation of GiNaCĀ“s lortensor objects.
- * No real implementation yet, do be done. */
+ * Implementation of GiNaC's Lorentz tensors. */
/*
* GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
#include "add.h"
#include "mul.h"
#include "debugmsg.h"
-#include "flags.h"
#include "lst.h"
#include "lortensor.h"
#include "operators.h"
#include "utils.h"
#include "config.h"
-#ifndef NO_NAMESPACE_GINAC
namespace GiNaC {
-#endif // ndef NO_NAMESPACE_GINAC
GINAC_IMPLEMENT_REGISTERED_CLASS(lortensor, indexed)
name=autoname_prefix()+ToString(serial);
}
-lortensor::~lortensor()
-{
- debugmsg("lortensor destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-lortensor::lortensor(const lortensor & other)
-{
- debugmsg("lortensor copy constructor",LOGLEVEL_CONSTRUCT);
- copy (other);
-}
-
-const lortensor & lortensor::operator=(const lortensor & other)
-{
- debugmsg("lortensor operator=",LOGLEVEL_ASSIGNMENT);
- if (this != & other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
//protected
void lortensor::copy(const lortensor & other)
//public
-basic * lortensor::duplicate() const
-{
- debugmsg("lortensor duplicate",LOGLEVEL_DUPLICATE);
- return new lortensor(*this);
-}
-
void lortensor::printraw(std::ostream & os) const
{
debugmsg("lortensor printraw",LOGLEVEL_PRINT);
return _ex0();
}
} else if (idx1.is_symbolic() && idx1.is_co_contra_pair(idx2)) {
- return Dim() - 2;
+ if (idx1.is_orthogonal_only())
+ return Dim() - idx1.get_dim_parallel_space();
+ else
+ return Dim();
}
}
return this -> hold();
ex simplify_lortensor(const ex & e)
{
// all simplification is done on expanded objects
- ex e_expanded=e.expand();
+ ex e_expanded = e.expand();
// simplification of sum=sum of simplifications
if (is_ex_exactly_of_type(e_expanded,add)) {
return e_expanded;
}
-//////////
-// global constants
-//////////
-
-const lortensor some_lortensor;
-const std::type_info & typeid_lortensor = typeid(some_lortensor);
-
-#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
-#endif // ndef NO_NAMESPACE_GINAC