39 #ifndef MAT_MATRIX_PROXY
40 #define MAT_MATRIX_PROXY
48 template<
typename TX,
typename TY>
54 XY(TX
const & AA, TY
const & BB,
55 bool const tAA =
false,
bool const tBB =
false)
56 :A(AA), B(BB), tA(tAA), tB(tBB)
64 template<
typename TX,
typename TY,
typename TZ>
72 XYZ(TX
const & AA, TY
const & BB, TZ
const & CC,
73 bool const tAA =
false,
74 bool const tBB =
false,
75 bool const tCC =
false)
76 :A(AA), B(BB), C(CC), tA(tAA), tB(tBB), tC(tCC)
85 template<
typename TX,
typename TY,
typename TZ,
typename TU,
typename TV>
97 XYZpUV(TX
const & AA, TY
const & BB, TZ
const & CC,
98 TU
const & DD, TV
const & EE,
99 bool const tAA =
false,
100 bool const tBB =
false,
101 bool const tCC =
false,
102 bool const tDD =
false,
103 bool const tEE =
false)
104 :A(AA), B(BB), C(CC), D(DD), E(EE),
105 tA(tAA), tB(tBB), tC(tCC), tD(tDD), tE(tEE)
115 template<
typename TX>
119 explicit Xtrans(TX
const & AA,
bool const tAA =
false)
128 template<
typename TX>
139 template<
typename TX>
154 template<
typename TX,
typename TY>
169 template<
typename TX,
typename TY>
184 template<
typename TX,
typename TY>
197 template<
typename TX,
typename TY>
210 template<
typename TX,
typename TY,
typename TZ>
211 inline XYZ<TX, TY, TZ>
221 template<
typename TX,
typename TY,
typename TZ>
222 inline XYZ<TX, TY, TZ>
233 template<
typename TX,
typename TY,
typename TZ,
typename TU,
typename TV>
234 inline XYZpUV<TX, TY, TZ, TU, TV>
236 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);
243 template<
typename TX,
typename TY>
247 XpY(
const TX& AA,
const TY& BB)
254 template<
typename TX,
typename TY>
263 template<
typename TX,
typename TY>
267 XmY(
const TX& AA,
const TY& BB)
274 template<
typename TX,
typename TY>
293 inline M2<MAT> square(
const MAT&
A) {
297 template<
class SCAL,
class MAT>
301 SM2(
const MAT& AA,
const SCAL a = 1)
304 SM2(
const M2<MAT>& m2)
309 template<
class SCAL,
class MAT>
310 inline SM2<SCAL, MAT>
311 operator*(
const SCAL s,
const M2<MAT>& m2) {
312 return SM2<SCAL, MAT>(m2.A, s);
322 MT(
const MAT& AA,
const bool tAA =
false)
329 return MT<MAT>(
A,
true);
332 inline MT<MAT>
transpose(
const MT<MAT>& mt) {
333 return MT<MAT>(mt.A, !mt.tA);
337 template<
class SCAL,
class MAT>
342 SM(
const MAT& AA,
const SCAL scalar = 1,
const bool tAA =
false)
343 :A(AA),alpha(scalar), tA(tAA)
347 template<
class SCAL,
class MAT>
348 inline SM<SCAL, MAT>
operator*(
const SCAL scalar,
const MT<MAT>& mta) {
349 return SM<SCAL, MAT>(mta.A,scalar, mta.tA);
352 template<
class SCAL,
class MAT>
353 inline SM<SCAL, MAT>
operator*(
const SCAL scalar,
const MAT& AA) {
354 return SM<SCAL, MAT>(AA, scalar,
false);
359 template<
class MAT,
class MATB = MAT>
365 MM(
const MAT& AA,
const MATB& BB,
const bool tAA,
const bool tBB)
366 :A(AA),B(BB), tA(tAA), tB(tBB)
370 template<
class MAT,
class MATB = MAT>
374 MpM(
const MAT& AA,
const MATB& BB)
379 template<
class MAT,
class MATB>
380 inline MpM<MAT, MATB>
operator+(
const MAT& AA,
const MATB& BB) {
381 return MpM<MAT, MATB>(AA, BB);
405 template<
class SCAL,
class MAT,
class MATB = MAT>
412 SMM(
const MM<MAT, MATB>& mm)
413 :A(mm.A),B(mm.B),alpha(1), tA(mm.tA), tB(mm.tB)
415 SMM(
const MAT& AA,
const MATB& BB,
416 const bool tAA,
const bool tBB,
418 :A(AA), B(BB), tA(tAA), tB(tBB), alpha(a)
422 template<
class SCAL,
class MAT,
class MATB>
423 inline SMM<SCAL, MAT, MATB>
424 operator*(
const SM<SCAL, MAT>& sm,
const MT<MATB>& mtb) {
425 return SMM<SCAL, MAT, MATB>(sm.A, mtb.A, sm.tA, mtb.tA, sm.alpha);
428 template<
class SCAL,
class MAT,
class MATB>
429 inline SMM<SCAL, MAT, MATB>
430 operator*(
const SM<SCAL, MAT>& sm,
const MATB& BB) {
431 return SMM<SCAL, MAT, MATB>(sm.A, BB, sm.tA,
false, sm.alpha);
434 template<
class SCAL,
class MATC,
class MATA = MATC,
class MATB = MATC>
443 SMMpSM(
const MATA& AA,
const MATB& BB,
const MATC& CC,
444 const bool tAA,
const bool tBB,
445 const SCAL a=1,
const SCAL b=1)
446 :A(AA), B(BB), C(CC), alpha(a), beta(b), tA(tAA), tB(tBB)
450 template<
class SCAL,
class MATC,
class MATA,
class MATB>
451 inline SMMpSM<SCAL, MATC, MATA, MATB>
452 operator+(
const SMM<SCAL, MATA, MATB>& smm,
const SM<SCAL, MATC>& sm) {
453 return SMMpSM<SCAL, MATC, MATA, MATB>
454 (smm.A, smm.B, sm.A, smm.tA, smm.tB, smm.alpha, sm.alpha);
458 template<
class SCAL,
class MATC,
class MATA,
class MATB>
459 inline SMMpSM<SCAL, MATC, MATA, MATB>
460 operator+(
const SMM<SCAL, MATA, MATB>& smm, MATC& CC) {
461 return SMMpSM<SCAL, MATC, MATA, MATB>
462 (smm.A, smm.B, CC, smm.tA, smm.tB, smm.alpha, 1);
464 template<
class SCAL,
class MATC,
class MATA,
class MATB>
465 inline SMMpSM<SCAL, MATC, MATA, MATB>
466 operator+(
const MM<MATA, MATB>& mm,
const SM<SCAL, MATC>& sm) {
467 return SMMpSM<SCAL, MATC, MATA, MATB>
468 (mm.A, mm.B, sm.A, mm.tA, mm.tB, 1, sm.alpha);
473 template<
class SCAL,
class MAT>
479 SM2pSM(
const MAT& AA,
const MAT& CC,
const SCAL a = 1,
const SCAL b = 0)
480 : A(AA), alpha(a), C(CC), beta(b)
484 template<
class SCAL,
class MAT>
485 inline SM2pSM<SCAL, MAT>
486 operator+(
const SM2<SCAL, MAT>& sm2,
const SM<SCAL, MAT> sm) {
487 return SM2pSM<SCAL, MAT>(sm2.A, sm.A, sm2.alpha, sm.alpha);
499 MMpM(
const MAT& AA,
const MAT& BB,
const MAT& CC)
505 template<
class SCAL,
class MAT>
507 const SCAL alpha, beta;
509 SMpSM(
const MAT& AA,
const MAT& BB,
510 const SCAL scalar_a=1,
const SCAL scalar_b=1)
511 :A(AA), B(BB), alpha(scalar_a), beta(scalar_b)
515 template<
class SCAL,
class MAT>
516 inline SMpSM<SCAL, MAT>
517 operator+(
const SM<SCAL, MAT> sm1,
const SM<SCAL, MAT> sm2 ) {
518 return SMpSM<SCAL, MAT>(sm1.A, sm2.A, sm1.alpha, sm2.alpha);
540 MmM(
const MAT& AA,
const MAT& BB)
546 inline MmM<MAT>
operator-(
const MAT&
A,
const MAT&
B) {
547 return MmM<MAT>(
A,
B);
XpY(const TX &AA, const TY &BB)
Definition: matrix_proxy.h:247
bool const tA
Definition: matrix_proxy.h:69
bool const tB
Definition: matrix_proxy.h:53
const TY & B
Definition: matrix_proxy.h:246
bool const tB
Definition: matrix_proxy.h:93
bool const tC
Definition: matrix_proxy.h:94
bool const tA
Definition: matrix_proxy.h:52
bool const tE
Definition: matrix_proxy.h:96
TZ const & C
Definition: matrix_proxy.h:89
TV const & E
Definition: matrix_proxy.h:91
This proxy expresses the result of addition of two objects, of possibly different types...
Definition: matrix_proxy.h:244
TZ const & C
Definition: matrix_proxy.h:68
TY const & B
Definition: matrix_proxy.h:67
const TX & A
Definition: matrix_proxy.h:245
Definition: allocate.cc:30
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:155
TX const & A
Definition: matrix_proxy.h:117
TX const & A
Definition: matrix_proxy.h:66
TU const & D
Definition: matrix_proxy.h:90
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:235
bool const tA
Definition: matrix_proxy.h:92
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:97
bool const tA
Definition: matrix_proxy.h:118
This proxy expresses the result of multiplication of three objects, of possibly different types...
Definition: matrix_proxy.h:65
This proxy expresses the result of transposition of an object of type TX.
Definition: matrix_proxy.h:116
XY(TX const &AA, TY const &BB, bool const tAA=false, bool const tBB=false)
Definition: matrix_proxy.h:54
bool const tB
Definition: matrix_proxy.h:70
bool const tC
Definition: matrix_proxy.h:71
TX const & A
Definition: matrix_proxy.h:87
TX const & A
Definition: matrix_proxy.h:50
Xtrans(TX const &AA, bool const tAA=false)
Definition: matrix_proxy.h:119
const TX & A
Definition: matrix_proxy.h:265
bool const tD
Definition: matrix_proxy.h:95
XmY(const TX &AA, const TY &BB)
Definition: matrix_proxy.h:267
This proxy expresses the result of substraction of two objects, of possibly different types...
Definition: matrix_proxy.h:264
This proxy expresses the result of multiplication of two objects, of possibly different types...
Definition: matrix_proxy.h:49
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:72
XmY< TX, TY > operator-(TX const &AA, TY const &BB)
Substraction of two objects of type TX and TY.
Definition: matrix_proxy.h:275
TY const & B
Definition: matrix_proxy.h:88
TY const & B
Definition: matrix_proxy.h:51
Xtrans< TX > transpose(TX const &A)
Transposition.
Definition: matrix_proxy.h:129
This proxy expresses the result of multiplication of three objects added to two other multiplied obje...
Definition: matrix_proxy.h:86
const TY & B
Definition: matrix_proxy.h:266