41 #ifndef MAT_MATRIX_PROXY 42 #define MAT_MATRIX_PROXY 50 template<
typename TX,
typename TY>
56 XY(TX
const & AA, TY
const & BB,
57 bool const tAA =
false,
bool const tBB =
false)
58 :
A(AA),
B(BB),
tA(tAA),
tB(tBB)
66 template<
typename TX,
typename TY,
typename TZ>
74 XYZ(TX
const & AA, TY
const & BB, TZ
const & CC,
75 bool const tAA =
false,
76 bool const tBB =
false,
77 bool const tCC =
false)
78 :
A(AA),
B(BB),
C(CC),
tA(tAA),
tB(tBB),
tC(tCC)
87 template<
typename TX,
typename TY,
typename TZ,
typename TU,
typename TV>
99 XYZpUV(TX
const & AA, TY
const & BB, TZ
const & CC,
100 TU
const & DD, TV
const & EE,
101 bool const tAA =
false,
102 bool const tBB =
false,
103 bool const tCC =
false,
104 bool const tDD =
false,
105 bool const tEE =
false)
106 :
A(AA),
B(BB),
C(CC),
D(DD),
E(EE),
117 template<
typename TX>
121 explicit Xtrans(TX
const & AA,
bool const tAA =
false)
130 template<
typename TX>
141 template<
typename TX>
156 template<
typename TX,
typename TY>
171 template<
typename TX,
typename TY>
186 template<
typename TX,
typename TY>
199 template<
typename TX,
typename TY>
212 template<
typename TX,
typename TY,
typename TZ>
213 inline XYZ<TX, TY, TZ>
223 template<
typename TX,
typename TY,
typename TZ>
224 inline XYZ<TX, TY, TZ>
235 template<
typename TX,
typename TY,
typename TZ,
typename TU,
typename TV>
236 inline XYZpUV<TX, TY, TZ, TU, TV>
238 return XYZpUV<TX, TY, TZ, TU, TV>(ABC.
A, ABC.
B, ABC.
C, DE.
A, DE.
B, ABC.
tA, ABC.
tB, ABC.
tC, DE.
tA, DE.
tB);
245 template<
typename TX,
typename TY>
249 XpY(
const TX& AA,
const TY& BB)
256 template<
typename TX,
typename TY>
265 template<
typename TX,
typename TY>
269 XmY(
const TX& AA,
const TY& BB)
276 template<
typename TX,
typename TY>
295 inline M2<MAT> square(
const MAT&
A) {
299 template<
class SCAL,
class MAT>
303 SM2(
const MAT& AA,
const SCAL a = 1)
306 SM2(
const M2<MAT>& m2)
311 template<
class SCAL,
class MAT>
312 inline SM2<SCAL, MAT>
313 operator*(
const SCAL s,
const M2<MAT>& m2) {
314 return SM2<SCAL, MAT>(m2.A, s);
324 MT(
const MAT& AA,
const bool tAA =
false)
331 return MT<MAT>(
A,
true);
334 inline MT<MAT>
transpose(
const MT<MAT>& mt) {
335 return MT<MAT>(mt.A, !mt.tA);
339 template<
class SCAL,
class MAT>
344 SM(
const MAT& AA,
const SCAL scalar = 1,
const bool tAA =
false)
345 :
A(AA),alpha(scalar), tA(tAA)
349 template<
class SCAL,
class MAT>
350 inline SM<SCAL, MAT>
operator*(
const SCAL scalar,
const MT<MAT>& mta) {
351 return SM<SCAL, MAT>(mta.A,scalar, mta.tA);
354 template<
class SCAL,
class MAT>
355 inline SM<SCAL, MAT>
operator*(
const SCAL scalar,
const MAT& AA) {
356 return SM<SCAL, MAT>(AA, scalar,
false);
361 template<
class MAT,
class MATB = MAT>
367 MM(
const MAT& AA,
const MATB& BB,
const bool tAA,
const bool tBB)
368 :
A(AA),
B(BB), tA(tAA), tB(tBB)
372 template<
class MAT,
class MATB = MAT>
376 MpM(
const MAT& AA,
const MATB& BB)
381 template<
class MAT,
class MATB>
382 inline MpM<MAT, MATB>
operator+(
const MAT& AA,
const MATB& BB) {
383 return MpM<MAT, MATB>(AA, BB);
407 template<
class SCAL,
class MAT,
class MATB = MAT>
414 SMM(
const MM<MAT, MATB>& mm)
415 :
A(mm.
A),
B(mm.
B),alpha(1), tA(mm.tA), tB(mm.tB)
417 SMM(
const MAT& AA,
const MATB& BB,
418 const bool tAA,
const bool tBB,
420 :
A(AA),
B(BB), tA(tAA), tB(tBB), alpha(a)
424 template<
class SCAL,
class MAT,
class MATB>
425 inline SMM<SCAL, MAT, MATB>
426 operator*(
const SM<SCAL, MAT>& sm,
const MT<MATB>& mtb) {
427 return SMM<SCAL, MAT, MATB>(sm.A, mtb.A, sm.tA, mtb.tA, sm.alpha);
430 template<
class SCAL,
class MAT,
class MATB>
431 inline SMM<SCAL, MAT, MATB>
432 operator*(
const SM<SCAL, MAT>& sm,
const MATB& BB) {
433 return SMM<SCAL, MAT, MATB>(sm.A, BB, sm.tA,
false, sm.alpha);
436 template<
class SCAL,
class MATC,
class MATA = MATC,
class MATB = MATC>
445 SMMpSM(
const MATA& AA,
const MATB& BB,
const MATC& CC,
446 const bool tAA,
const bool tBB,
447 const SCAL a=1,
const SCAL b=1)
448 :
A(AA),
B(BB), C(CC), alpha(a), beta(b), tA(tAA), tB(tBB)
452 template<
class SCAL,
class MATC,
class MATA,
class MATB>
453 inline SMMpSM<SCAL, MATC, MATA, MATB>
454 operator+(
const SMM<SCAL, MATA, MATB>& smm,
const SM<SCAL, MATC>& sm) {
455 return SMMpSM<SCAL, MATC, MATA, MATB>
456 (smm.A, smm.B, sm.A, smm.tA, smm.tB, smm.alpha, sm.alpha);
460 template<
class SCAL,
class MATC,
class MATA,
class MATB>
461 inline SMMpSM<SCAL, MATC, MATA, MATB>
462 operator+(
const SMM<SCAL, MATA, MATB>& smm, MATC& CC) {
463 return SMMpSM<SCAL, MATC, MATA, MATB>
464 (smm.A, smm.B, CC, smm.tA, smm.tB, smm.alpha, 1);
466 template<
class SCAL,
class MATC,
class MATA,
class MATB>
467 inline SMMpSM<SCAL, MATC, MATA, MATB>
468 operator+(
const MM<MATA, MATB>& mm,
const SM<SCAL, MATC>& sm) {
469 return SMMpSM<SCAL, MATC, MATA, MATB>
470 (mm.A, mm.B, sm.A, mm.tA, mm.tB, 1, sm.alpha);
475 template<
class SCAL,
class MAT>
481 SM2pSM(
const MAT& AA,
const MAT& CC,
const SCAL a = 1,
const SCAL b = 0)
482 :
A(AA), alpha(a), C(CC), beta(b)
486 template<
class SCAL,
class MAT>
487 inline SM2pSM<SCAL, MAT>
488 operator+(
const SM2<SCAL, MAT>& sm2,
const SM<SCAL, MAT> sm) {
489 return SM2pSM<SCAL, MAT>(sm2.A, sm.A, sm2.alpha, sm.alpha);
501 MMpM(
const MAT& AA,
const MAT& BB,
const MAT& CC)
507 template<
class SCAL,
class MAT>
509 const SCAL alpha, beta;
511 SMpSM(
const MAT& AA,
const MAT& BB,
512 const SCAL scalar_a=1,
const SCAL scalar_b=1)
513 :
A(AA),
B(BB), alpha(scalar_a), beta(scalar_b)
517 template<
class SCAL,
class MAT>
518 inline SMpSM<SCAL, MAT>
519 operator+(
const SM<SCAL, MAT> sm1,
const SM<SCAL, MAT> sm2 ) {
520 return SMpSM<SCAL, MAT>(sm1.A, sm2.A, sm1.alpha, sm2.alpha);
542 MmM(
const MAT& AA,
const MAT& BB)
548 inline MmM<MAT>
operator-(
const MAT&
A,
const MAT&
B) {
549 return MmM<MAT>(
A,
B);
XpY(const TX &AA, const TY &BB)
Definition: matrix_proxy.h:249
bool const tA
Definition: matrix_proxy.h:71
bool const tB
Definition: matrix_proxy.h:55
const TY & B
Definition: matrix_proxy.h:248
bool const tB
Definition: matrix_proxy.h:95
bool const tC
Definition: matrix_proxy.h:96
bool const tA
Definition: matrix_proxy.h:54
bool const tE
Definition: matrix_proxy.h:98
TZ const & C
Definition: matrix_proxy.h:91
TV const & E
Definition: matrix_proxy.h:93
This proxy expresses the result of addition of two objects, of possibly different types...
Definition: matrix_proxy.h:246
TZ const & C
Definition: matrix_proxy.h:70
TY const & B
Definition: matrix_proxy.h:69
const TX & A
Definition: matrix_proxy.h:247
Definition: allocate.cc:39
XY< TX, TY > operator*(Xtrans< TX > const &trAA, Xtrans< TY > const &trBB)
Multiplication of two transposition proxys holding objects of type TX and TY respectively.
Definition: matrix_proxy.h:157
TX const & A
Definition: matrix_proxy.h:119
TX const & A
Definition: matrix_proxy.h:68
TU const & D
Definition: matrix_proxy.h:92
XYZpUV< TX, TY, TZ, TU, TV > operator+(XYZ< TX, TY, TZ > const &ABC, XY< TU, TV > const &DE)
Addition of two multiplication proxys XYZ and XY.
Definition: matrix_proxy.h:237
bool const tA
Definition: matrix_proxy.h:94
XYZpUV(TX const &AA, TY const &BB, TZ const &CC, TU const &DD, TV const &EE, bool const tAA=false, bool const tBB=false, bool const tCC=false, bool const tDD=false, bool const tEE=false)
Definition: matrix_proxy.h:99
bool const tA
Definition: matrix_proxy.h:120
This proxy expresses the result of multiplication of three objects, of possibly different types...
Definition: matrix_proxy.h:67
This proxy expresses the result of transposition of an object of type TX.
Definition: matrix_proxy.h:118
XY(TX const &AA, TY const &BB, bool const tAA=false, bool const tBB=false)
Definition: matrix_proxy.h:56
bool const tB
Definition: matrix_proxy.h:72
bool const tC
Definition: matrix_proxy.h:73
TX const & A
Definition: matrix_proxy.h:89
TX const & A
Definition: matrix_proxy.h:52
Xtrans(TX const &AA, bool const tAA=false)
Definition: matrix_proxy.h:121
const TX & A
Definition: matrix_proxy.h:267
bool const tD
Definition: matrix_proxy.h:97
XmY(const TX &AA, const TY &BB)
Definition: matrix_proxy.h:269
This proxy expresses the result of substraction of two objects, of possibly different types...
Definition: matrix_proxy.h:266
This proxy expresses the result of multiplication of two objects, of possibly different types...
Definition: matrix_proxy.h:51
XYZ(TX const &AA, TY const &BB, TZ const &CC, bool const tAA=false, bool const tBB=false, bool const tCC=false)
Definition: matrix_proxy.h:74
XmY< TX, TY > operator-(TX const &AA, TY const &BB)
Substraction of two objects of type TX and TY.
Definition: matrix_proxy.h:277
TY const & B
Definition: matrix_proxy.h:90
TY const & B
Definition: matrix_proxy.h:53
Xtrans< TX > transpose(TX const &A)
Transposition.
Definition: matrix_proxy.h:131
This proxy expresses the result of multiplication of three objects added to two other multiplied obje...
Definition: matrix_proxy.h:88
const TY & B
Definition: matrix_proxy.h:268