27#ifndef IPPL_TYPE_COMPUTATIONS_H
28#define IPPL_TYPE_COMPUTATIONS_H
37template<
class T,
unsigned D>
class Vektor;
38template<
class T,
unsigned D>
class Tenzor;
40template<
class T,
unsigned D>
class SymTenzor;
47inline int sign(
T a) {
return ((
a > 0) ? 1 : (
a == 0 ? 0 : -1)); }
64#define _SCALAR_RNG_OP_RETURNS_(GEN,SCA,OP) \
66struct PETEBinaryReturn<GEN,SCA,OP> { \
67 typedef PETEBinaryReturn<double,SCA,OP>::type type; \
70struct PETEBinaryReturn<SCA,GEN,OP> { \
71 typedef PETEBinaryReturn<SCA,double,OP>::type type; \
74#define _SCALAR_RNG_RETURNS_(GEN,SCA) \
75_SCALAR_RNG_OP_RETURNS_(GEN,SCA,OpAdd) \
76_SCALAR_RNG_OP_RETURNS_(GEN,SCA,OpSubtract) \
77_SCALAR_RNG_OP_RETURNS_(GEN,SCA,OpMultipply) \
78_SCALAR_RNG_OP_RETURNS_(GEN,SCA,OpDivide)
80#define _PETE_RNG_RETURNS_(GEN) \
82template <> struct PETE_Type2Index< GEN > { \
83 enum { val = PETE_Type2Index<double>::val }; \
86_SCALAR_RNG_RETURNS_(GEN,short) \
87_SCALAR_RNG_RETURNS_(GEN,int) \
88_SCALAR_RNG_RETURNS_(GEN,long) \
89_SCALAR_RNG_RETURNS_(GEN,float) \
90_SCALAR_RNG_RETURNS_(GEN,double) \
91_SCALAR_RNG_RETURNS_(GEN,std::complex<double>)
99template<class
T,
unsigned Dim>
104template<
class T,
unsigned Dim>
109template<
class T,
unsigned Dim>
114template<
class T,
unsigned Dim>
214template<
class T,
unsigned Dim>
219template<
class T,
unsigned Dim>
224template<
class T,
unsigned Dim>
229template<
class T,
unsigned Dim>
234template<
class T,
unsigned Dim>
239template<
class T,
unsigned Dim>
244template<
class T,
unsigned Dim>
249template<
class T,
unsigned Dim>
254template<
class T,
unsigned Dim>
259template<
class T,
unsigned Dim>
264template<
class T,
unsigned Dim>
269template<
class T,
unsigned Dim>
313template<
class T1,
class T2,
unsigned Dim>
318template<
class T1,
class T2,
unsigned Dim>
323template<
class T1,
class T2,
unsigned Dim>
330template<
class T1,
class T2,
unsigned Dim>
335template<
class T1,
class T2,
unsigned Dim>
340template<
class T1,
class T2,
unsigned Dim>
345template<
class T1,
class T2,
unsigned Dim>
352template<
class T1,
class T2,
unsigned Dim>
358template<
class T1,
class T2,
unsigned Dim>
363template<
class T1,
class T2,
unsigned Dim>
368template<
class T1,
class T2,
unsigned Dim>
373template<
class T1,
class T2,
unsigned Dim>
378template<
class T1,
class T2,
unsigned Dim>
383template<
class T1,
class T2,
unsigned Dim>
388template<
class T1,
class T2,
unsigned Dim>
393template<
class T1,
class T2,
unsigned Dim>
398template<
class T1,
class T2,
unsigned Dim>
403template<
class T1,
class T2,
unsigned Dim>
408template<
class T1,
class T2,
unsigned Dim>
413template<
class T1,
class T2,
unsigned Dim>
420template<
class T1,
class T2,
unsigned Dim>
426template<
class T1,
class T2,
unsigned Dim>
432template<
class T1,
class T2,
unsigned Dim>
437template<
class T1,
class T2,
unsigned Dim>
442template<
class T1,
class T2,
unsigned Dim>
447template<
class T1,
class T2,
unsigned Dim>
452template<
class T1,
class T2,
unsigned Dim>
457template<
class T1,
class T2,
unsigned Dim>
462template<
class T1,
class T2,
unsigned Dim>
467template<
class T1,
class T2,
unsigned Dim>
472template<
class T1,
class T2,
unsigned Dim>
477template<
class T1,
class T2,
unsigned Dim>
482template<
class T1,
class T2,
unsigned Dim>
487template<
class T1,
class T2,
unsigned Dim>
492template<
class T1,
class T2,
unsigned Dim>
497template<
class T1,
class T2,
unsigned Dim>
502template<
class T1,
class T2,
unsigned Dim>
507template<
class T1,
class T2,
unsigned Dim>
512template<
class T1,
class T2,
unsigned Dim>
517template<
class T1,
class T2,
unsigned Dim>
522template<
class T1,
class T2,
unsigned Dim>
527template<
class T1,
class T2,
unsigned Dim>
534#define _SCALAR_VST_RETURNS_(Sca) \
535template<class T1, unsigned Dim> \
536struct PETEBinaryReturn<Vektor<T1,Dim>,Sca,OpMultipply> { \
537 typedef Vektor<typename PETEBinaryReturn<T1,Sca,OpMultipply>::type,Dim> \
540template<class T2, unsigned Dim> \
541struct PETEBinaryReturn<Sca,Vektor<T2,Dim>,OpMultipply> { \
542 typedef Vektor<typename PETEBinaryReturn<Sca,T2,OpMultipply>::type,Dim> \
545template<class T1, unsigned Dim> \
546struct PETEBinaryReturn<Vektor<T1,Dim>,Sca,OpDivide> { \
547 typedef Vektor<typename PETEBinaryReturn<T1,Sca,OpDivide>::type,Dim> \
550template<class T1, unsigned Dim> \
551struct PETEBinaryReturn<Tenzor<T1,Dim>,Sca,OpMultipply> { \
552 typedef Tenzor<typename PETEBinaryReturn<T1,Sca,OpMultipply>::type,Dim> \
555template<class T2, unsigned Dim> \
556struct PETEBinaryReturn<Sca,Tenzor<T2,Dim>,OpMultipply> { \
557 typedef Tenzor<typename PETEBinaryReturn<Sca,T2,OpMultipply>::type,Dim> \
560template<class T1, unsigned Dim> \
561struct PETEBinaryReturn<Tenzor<T1,Dim>,Sca,OpDivide> { \
562 typedef Tenzor<typename PETEBinaryReturn<T1,Sca,OpDivide>::type,Dim> \
565template<class T1, unsigned Dim> \
566struct PETEBinaryReturn<SymTenzor<T1,Dim>,Sca,OpMultipply> { \
567 typedef SymTenzor<typename PETEBinaryReturn<T1,Sca,OpMultipply>::type,Dim> \
570template<class T2, unsigned Dim> \
571struct PETEBinaryReturn<Sca,SymTenzor<T2,Dim>,OpMultipply> { \
572 typedef SymTenzor<typename PETEBinaryReturn<Sca,T2,OpMultipply>::type,Dim> \
575template<class T1, unsigned Dim> \
576struct PETEBinaryReturn<SymTenzor<T1,Dim>,Sca,OpDivide> { \
577 typedef SymTenzor<typename PETEBinaryReturn<T1,Sca,OpDivide>::type,Dim> \
580template<class T1, unsigned Dim> \
581struct PETEBinaryReturn<AntiSymTenzor<T1,Dim>,Sca,OpMultipply> { \
583 AntiSymTenzor<typename PETEBinaryReturn<T1,Sca,OpMultipply>::type,Dim> \
586template<class T2, unsigned Dim> \
587struct PETEBinaryReturn<Sca,AntiSymTenzor<T2,Dim>,OpMultipply> { \
589 AntiSymTenzor<typename PETEBinaryReturn<Sca,T2,OpMultipply>::type,Dim> \
592template<class T1, unsigned Dim> \
593struct PETEBinaryReturn<AntiSymTenzor<T1,Dim>,Sca,OpDivide> { \
595 AntiSymTenzor<typename PETEBinaryReturn<T1,Sca,OpDivide>::type,Dim> \
606#undef _SCALAR_VST_RETURNS_
638template<
class T,
class TP,
unsigned Dim>
643template<
class T,
class TP,
unsigned Dim>
648template<
class T,
class TP,
unsigned Dim>
653template<
class T,
class TP,
unsigned Dim>
const int PETE_BinaryUseLeftTag
const int PETE_UnaryPassThruTag
const int PETE_BinaryPromoteTag
#define _PETE_RNG_RETURNS_(GEN)
#define _SCALAR_VST_RETURNS_(Sca)
MMatrix< m_complex > complex(MMatrix< double > real)
AntiSymTenzor< T, Dim > type
AntiSymTenzor< T, Dim > type
Vektor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
PETEBinaryReturn< T1, T2, OpMultipply >::type type
Tenzor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
Vektor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
Vektor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
PETEBinaryReturn< T1, T2, OpMultipply >::type type
Tenzor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
PETEBinaryReturn< T1, T2, OpMultipply >::type type
Vektor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
Vektor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpAdd >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpSubtract >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
PETEBinaryReturn< T1, T2, OpMultipply >::type type
Tenzor< typename PETEBinaryReturn< T1, T2, OpAdd >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpSubtract >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
PETEBinaryReturn< T1, T2, OpMultipply >::type type
Tenzor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
PETEBinaryReturn< T1, T2, OpMultipply >::type type
Vektor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
Vektor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpAdd >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpSubtract >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
PETEBinaryReturn< T1, T2, OpMultipply >::type type
Tenzor< typename PETEBinaryReturn< T1, T2, OpAdd >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpSubtract >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
PETEBinaryReturn< T1, T2, OpMultipply >::type type
Tenzor< typename PETEBinaryReturn< T1, T2, OpAdd >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpSubtract >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
PETEBinaryReturn< T1, T2, OpMultipply >::type type
Tenzor< typename PETEBinaryReturn< T1, T2, OpAdd >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpSubtract >::type, Dim > type
Tenzor< typename PETEBinaryReturn< T1, T2, OpMultipply >::type, Dim > type
PETEBinaryReturn< T1, T2, OpMultipply >::type type
PETE_ComputeBinaryType< T1, T2, Op, Op::tag >::type type