7 #ifndef ANTI_SYM_TENZOR_H
8 #define ANTI_SYM_TENZOR_H
32 template<
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);
271 template<
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); }
352 : elem_m(elem), where_m(where) {}
354 : elem_m(model.elem_m), where_m(model.where_m) {}
357 PAssert_EQ(where_m != 0 || (a.elem_m == -a.elem_m),
true);
358 elem_m = where_m < 0 ? -a.elem_m : a.elem_m;
364 elem_m = where_m < 0 ? -e :
e;
370 return (where_m < 0 ? -elem_m : elem_m);
393 return (*
this)(i, j);
405 return (*
this)(i, j);
428 return !(*
this == that);
471 template <
class T,
unsigned D>
476 template <
class T,
unsigned D>
513 template <
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);
565 template<
class T,
unsigned D>
573 template<
class T,
unsigned D>
600 template < class T1, class T2,
unsigned D >
602 dot(const AntiSymTenzor<T1,D> &lhs, const AntiSymTenzor<T2,D> &rhs)
608 template <
class T1,
class T2,
unsigned D >
616 template <
class T1,
class T2,
unsigned D >
624 template <
class T1,
class T2,
unsigned D >
632 template <
class T1,
class T2,
unsigned D >
640 template <
class T1,
class T2,
unsigned D >
647 template <
class T1,
class T2,
unsigned D >
658 template <
class T1,
class T2,
unsigned D >
666 template <
class T1,
class T2,
unsigned D >
674 template <
class T1,
class T2,
unsigned D >
682 template <
class T1,
class T2,
unsigned D >
690 template <
class T1,
class T2,
unsigned D >
700 template<
class T,
unsigned D>
701 inline std::ostream& operator<<(std::ostream& out, const AntiSymTenzor<T,D>& rhs) {
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) <<
" )";
719 #endif // ANTI_SYM_TENZOR_H
Message & put(const T &val)
AntiSymTenzor(const Tenzor< T, D > &t)
AntiSymTenzor(const T &x10, const T &x20, const T &x21)
const AssignProxy & operator=(const Element_t &e)
AntiSymTenzor(DontInitialize)
T det(const AntiSymTenzor< T, 3 > &)
AssignProxy operator()(std::pair< int, int > a)
AssignProxy operator()(unsigned int i, unsigned int j)
AntiSymTenzor< T, 1 > & operator/=(const T &)
#define TSV_ELEMENTWISE_OPERATOR(TSV, OP, APP)
Message & putMessage(Message &m) const
double Min(double a, double b)
const AssignProxy & operator=(const AssignProxy &a)
Element_t operator()(std::pair< int, int > a) const
Element_t operator[](unsigned int i) const
AntiSymTenzor(const AntiSymTenzor< T, 1 > &)
Matrix< T > operator-(const Matrix< T > &, const Matrix< T > &)
Matrix subtraction.
BOOST_UBLAS_INLINE V trace(ublas::matrix< V > &e)
Computes the trace of a square matrix.
AssignProxy(const AssignProxy &model)
Tenzor< T, D > cofactors(const AntiSymTenzor< T, D > &)
AntiSymTenzor< T, D > transpose(const AntiSymTenzor< T, D > &rhs)
const AssignProxy & operator=(const AssignProxy &a)
PETE_ComputeBinaryType< T1, T2, Op, Op::tag >::type type
Element_t operator()(std::pair< int, int > a) const
Message & get(const T &cval)
AntiSymTenzor< T, 1 > & operator+=(const AntiSymTenzor< T1, 1 > &)
PETEBinaryReturn< T1, T2, OpMultipply >::type dotdot(const AntiSymTenzor< T1, D > &lhs, const AntiSymTenzor< T2, D > &rhs)
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
AntiSymTenzor(const Tenzor< T, 1 > &)
const AssignProxy & operator=(const Element_t &e)
AssignProxy(Element_t &elem, int where)
AssignProxy operator()(std::pair< int, int > a)
AntiSymTenzor< T, D > & operator-=(const AntiSymTenzor< T1, D > &rhs)
Element_t operator()(unsigned int i, unsigned int j) const
Element_t operator()(unsigned int i, unsigned int j) const
const AntiSymTenzor< T, 1 > & operator=(const T &rhs)
AntiSymTenzor< T, 1 > & operator/=(const AntiSymTenzor< T1, 1 > &)
Message & setCopy(const bool c)
Element_t & operator()(unsigned int i)
double Max(double a, double b)
AntiSymTenzor< T, D > & operator+=(const AntiSymTenzor< T1, D > &rhs)
bool operator==(const AntiSymTenzor< T, D > &that) const
Element_t & operator[](unsigned int i)
const AntiSymTenzor< T, D > & operator=(const AntiSymTenzor< T, D > &rhs)
Message & putMessage(Message &m) const
AntiSymTenzor(const AntiSymTenzor< T, D > &rhs)
Matrix< T > operator+(const Matrix< T > &, const Matrix< T > &)
Matrix addition.
Message & getMessage(Message &m)
const AntiSymTenzor< T, 1 > & operator=(const AntiSymTenzor< T, 1 > &)
const AntiSymTenzor< T, 1 > & operator=(const AntiSymTenzor< T1, 1 > &)
AntiSymTenzor< T, D > & operator*=(const AntiSymTenzor< T1, D > &rhs)
bool operator!=(const AntiSymTenzor< T, 1 > &that) const
AntiSymTenzor< T, D > & operator/=(const AntiSymTenzor< T1, D > &rhs)
AntiSymTenzor< T, 1 > & operator*=(const AntiSymTenzor< T1, 1 > &)
AssignProxy operator()(unsigned int i, unsigned int j)
AssignProxy(Element_t &elem, int where)
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)
bool operator==(const AntiSymTenzor< T, 1 > &) const
AntiSymTenzor(DontInitialize)
constexpr double e
The value of .
Element_t operator[](unsigned int i) const
AntiSymTenzor< T, 1 > & operator-=(const AntiSymTenzor< T1, 1 > &)
AntiSymTenzor< T, 1 > & operator*=(const T &)
AntiSymTenzor< T, D > & operator*=(const T &rhs)
AssignProxy(const AssignProxy &model)
AntiSymTenzor< T, D > & operator/=(const T &rhs)
Element_t operator()(unsigned int i) const
Message & getMessage(Message &m)
double dot(const Vector3D &lhs, const Vector3D &rhs)
Vector dot product.
AntiSymTenzor(const T &x00)
Element_t operator()(unsigned int i) const
bool operator!=(const AntiSymTenzor< T, D > &that) const