7#ifndef ANTI_SYM_TENZOR_H
8#define ANTI_SYM_TENZOR_H
32template<
class T,
unsigned D>
58 "Number of arguments does not match AntiSymTenzor dimension!!");
59 X[0]= x10;
X[1]= x20;
X[2]= x21;
71 for (
unsigned int i=1; i<D; ++i) {
72 for (
unsigned int j=0; j<i; ++j)
73 (*
this)[((i-1)*i/2)+j] = (t(i,j)-t(j,i))*0.5;
145 int size(
void)
const {
return sizeof(*this); }
184 return -
X[((j-1)*j/2) + i];
186 return X[((i-1)*i/2) + j];
192 return (*
this)(i, j);
200 int lo = i < j ? i : j;
201 int hi = i > j ? i : j;
209 return (*
this)(i, j);
240 return !(*
this == that);
271template<
class T,
unsigned int D>
295 class DontInitialize {};
312 PInsist(rhs==0,
"Cannot assign non-zero value to a 1D AntiSymTenzor!");
346 int size(
void)
const {
return sizeof(*this); }
393 return (*
this)(i, j);
405 return (*
this)(i, j);
428 return !(*
this == that);
471template <
class T,
unsigned D>
476template <
class T,
unsigned D>
513template <
class T,
unsigned D>
515 PInsist(D<4,
"AntiSymTenzor cofactors() function not implemented for D>3!");
524 result(0,0) = rhs(1,1)*rhs(2,2) - rhs(1,2)*rhs(2,1);
525 result(1,0) = rhs(0,2)*rhs(2,1) - rhs(0,1)*rhs(2,2);
526 result(2,0) = rhs(0,1)*rhs(1,2) - rhs(1,1)*rhs(0,2);
527 result(0,1) = rhs(2,0)*rhs(1,2) - rhs(1,0)*rhs(2,2);
528 result(1,1) = rhs(0,0)*rhs(2,2) - rhs(0,2)*rhs(2,0);
529 result(2,1) = rhs(1,0)*rhs(0,2) - rhs(0,0)*rhs(1,2);
530 result(0,2) = rhs(1,0)*rhs(2,1) - rhs(2,0)*rhs(1,1);
531 result(1,2) = rhs(0,1)*rhs(2,0) - rhs(0,0)*rhs(2,1);
532 result(2,2) = rhs(0,0)*rhs(1,1) - rhs(1,0)*rhs(0,1);
541 result(0,0) = rhs(1,1);
542 result(1,0) = -rhs(0,1);
543 result(0,1) = -rhs(1,0);
544 result(1,1) = rhs(0,0);
565template<
class T,
unsigned D>
573template<
class T,
unsigned D>
600template <
class T1,
class T2,
unsigned D >
608template <
class T1,
class T2,
unsigned D >
616template <
class T1,
class T2,
unsigned D >
624template <
class T1,
class T2,
unsigned D >
632template <
class T1,
class T2,
unsigned D >
640template <
class T1,
class T2,
unsigned D >
647template <
class T1,
class T2,
unsigned D >
658template <
class T1,
class T2,
unsigned D >
666template <
class T1,
class T2,
unsigned D >
674template <
class T1,
class T2,
unsigned D >
682template <
class T1,
class T2,
unsigned D >
690template <
class T1,
class T2,
unsigned D >
700template<
class T,
unsigned D>
703 for (
unsigned int i=0; i<D; i++) {
705 for (
unsigned int j=0; j<D-1; j++) {
706 out << rhs(i,j) <<
" , ";
708 out << rhs(i,D-1) <<
")";
712 out <<
"( " << rhs(0,0) <<
" )";
PETE_TTTree< OpWhere, typename Cond_t::PETE_Expr_t, typename True_t::PETE_Expr_t, PETE_Scalar< Vektor< T, Dim > > > where(const PETE_Expr< Cond_t > &c, const PETE_Expr< True_t > &t, const Vektor< T, Dim > &f)
PETEBinaryReturn< T1, T2, OpMultipply >::type dotdot(const AntiSymTenzor< T1, D > &lhs, const AntiSymTenzor< T2, D > &rhs)
std::ostream & operator<<(std::ostream &out, const AntiSymTenzor< T, D > &rhs)
const AntiSymTenzor< T, D > & operator+(const AntiSymTenzor< T, D > &op)
AntiSymTenzor< T, D > operator-(const AntiSymTenzor< T, D > &op)
Tenzor< T, D > cofactors(const AntiSymTenzor< T, D > &)
T det(const AntiSymTenzor< T, 3 > &)
AntiSymTenzor< T, D > transpose(const AntiSymTenzor< T, D > &rhs)
Tenzor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, D > dot(const AntiSymTenzor< T1, D > &lhs, const AntiSymTenzor< T2, D > &rhs)
T trace(const AntiSymTenzor< T, D > &)
#define TSV_ELEMENTWISE_OPERATOR(TSV, OP, APP)
double Min(double a, double b)
double Max(double a, double b)
constexpr double e
The value of.
AntiSymTenzor(DontInitialize)
Message & getMessage(Message &m)
bool operator!=(const AntiSymTenzor< T, D > &that) const
const AntiSymTenzor< T, D > & operator=(const AntiSymTenzor< T, D > &rhs)
AntiSymTenzor< T, D > & operator*=(const AntiSymTenzor< T1, D > &rhs)
Element_t & operator()(unsigned int i)
AssignProxy operator()(unsigned int i, unsigned int j)
Element_t operator[](unsigned int i) const
AntiSymTenzor< T, D > & operator-=(const AntiSymTenzor< T1, D > &rhs)
AntiSymTenzor(const Tenzor< T, D > &t)
Element_t & operator[](unsigned int i)
AssignProxy operator()(std::pair< int, int > a)
Element_t operator()(unsigned int i, unsigned int j) const
AntiSymTenzor< T, D > & operator+=(const AntiSymTenzor< T1, D > &rhs)
Element_t operator()(std::pair< int, int > a) const
Element_t operator()(unsigned int i) const
AntiSymTenzor< T, D > & operator/=(const AntiSymTenzor< T1, D > &rhs)
AntiSymTenzor(const T &x10, const T &x20, const T &x21)
AntiSymTenzor(const AntiSymTenzor< T, D > &rhs)
AntiSymTenzor(const T &x00)
AntiSymTenzor< T, D > & operator*=(const T &rhs)
bool operator==(const AntiSymTenzor< T, D > &that) const
Message & putMessage(Message &m) const
AntiSymTenzor< T, D > & operator/=(const T &rhs)
const AssignProxy & operator=(const AssignProxy &a)
const AssignProxy & operator=(const Element_t &e)
AssignProxy(const AssignProxy &model)
AssignProxy(Element_t &elem, int where)
AntiSymTenzor< T, 1 > & operator/=(const AntiSymTenzor< T1, 1 > &)
AntiSymTenzor(const Tenzor< T, 1 > &)
AntiSymTenzor< T, 1 > & operator-=(const AntiSymTenzor< T1, 1 > &)
const AntiSymTenzor< T, 1 > & operator=(const AntiSymTenzor< T, 1 > &)
AntiSymTenzor< T, 1 > & operator/=(const T &)
AntiSymTenzor(DontInitialize)
const AntiSymTenzor< T, 1 > & operator=(const T &rhs)
AntiSymTenzor< T, 1 > & operator*=(const T &)
Element_t operator()(unsigned int i, unsigned int j) const
Element_t operator()(std::pair< int, int > a) const
Message & putMessage(Message &m) const
AntiSymTenzor(const AntiSymTenzor< T, 1 > &)
AssignProxy operator()(unsigned int i, unsigned int j)
AntiSymTenzor< T, 1 > & operator+=(const AntiSymTenzor< T1, 1 > &)
Element_t operator[](unsigned int i) const
Message & getMessage(Message &m)
bool operator!=(const AntiSymTenzor< T, 1 > &that) const
AntiSymTenzor< T, 1 > & operator*=(const AntiSymTenzor< T1, 1 > &)
Element_t operator()(unsigned int i) const
const AntiSymTenzor< T, 1 > & operator=(const AntiSymTenzor< T1, 1 > &)
AssignProxy operator()(std::pair< int, int > a)
bool operator==(const AntiSymTenzor< T, 1 > &) const
const AssignProxy & operator=(const AssignProxy &a)
const AssignProxy & operator=(const Element_t &e)
AssignProxy(Element_t &elem, int where)
AssignProxy(const AssignProxy &model)
Message & setCopy(const bool c)
Message & put(const T &val)
Message & get(const T &cval)
PETE_ComputeBinaryType< T1, T2, Op, Op::tag >::type type