38template <
class Element>
47template <
class Element>
61template <
class Element>
71template <
class Element>
82template <
class Element>
93template <
class Element>
104template <
class Element>
117template <
class Element>
142 const Element
oldTol = this->SetTol(std::numeric_limits<Element>::min());
153 default:
Error(
"TMatrixT(EMatrixCreatorOp1)",
"operation %d not yet implemented",
op);
163template <
class Element>
171 Allocate(
a.GetNrows(),
b.GetNcols(),
a.GetRowLwb(),
b.GetColLwb(), 1);
176 Allocate(
a.GetNcols(),
b.GetNcols(),
a.GetColLwb(),
b.GetColLwb(), 1);
181 Allocate(
a.GetNrows(),
b.GetNrows(),
a.GetRowLwb(),
b.GetRowLwb(), 1);
186 Allocate(
a.GetNrows(),
b.GetNcols(),
a.GetRowLwb(),
b.GetColLwb(), 1);
188 if (
a.GetNrows() ==
b.GetNcols()) {
190 const Element
oldTol = this->SetTol(std::numeric_limits<Element>::min());
196 const Element
oldTol =
ainv.SetTol(std::numeric_limits<Element>::min());
205 Allocate(
a.GetNrows(),
a.GetNcols(),
a.GetRowLwb(),
a.GetColLwb(), 1);
211 Allocate(
a.GetNrows(),
a.GetNcols(),
a.GetRowLwb(),
a.GetColLwb(), 1);
216 default:
Error(
"TMatrixT(EMatrixCreatorOp2)",
"operation %d not yet implemented",
op);
225template <
class Element>
233 Allocate(
a.GetNrows(),
b.GetNcols(),
a.GetRowLwb(),
b.GetColLwb(), 1);
238 Allocate(
a.GetNcols(),
b.GetNcols(),
a.GetColLwb(),
b.GetColLwb(), 1);
243 Allocate(
a.GetNrows(),
b.GetNrows(),
a.GetRowLwb(),
b.GetRowLwb(), 1);
248 Allocate(
a.GetNrows(),
a.GetNcols(),
a.GetRowLwb(),
a.GetColLwb(), 1);
250 const Element
oldTol = this->SetTol(std::numeric_limits<Element>::min());
258 Allocate(
a.GetNrows(),
a.GetNcols(),
a.GetRowLwb(),
a.GetColLwb(), 1);
264 Allocate(
a.GetNrows(),
a.GetNcols(),
a.GetRowLwb(),
a.GetColLwb(), 1);
269 default:
Error(
"TMatrixT(EMatrixCreatorOp2)",
"operation %d not yet implemented",
op);
279template <
class Element>
287 Allocate(
a.GetNrows(),
b.GetNcols(),
a.GetRowLwb(),
b.GetColLwb(), 1);
292 Allocate(
a.GetNcols(),
b.GetNcols(),
a.GetColLwb(),
b.GetColLwb(), 1);
297 Allocate(
a.GetNrows(),
b.GetNrows(),
a.GetRowLwb(),
b.GetRowLwb(), 1);
302 Allocate(
a.GetNrows(),
b.GetNcols(),
a.GetRowLwb(),
b.GetColLwb(), 1);
304 if (
a.GetNrows() ==
b.GetNcols()) {
306 const Element
oldTol = this->SetTol(std::numeric_limits<Element>::min());
312 const Element
oldTol =
ainv.SetTol(std::numeric_limits<Element>::min());
321 Allocate(
a.GetNrows(),
a.GetNcols(),
a.GetRowLwb(),
a.GetColLwb(), 1);
327 Allocate(
a.GetNrows(),
a.GetNcols(),
a.GetRowLwb(),
a.GetColLwb(), 1);
332 default:
Error(
"TMatrixT(EMatrixCreatorOp2)",
"operation %d not yet implemented",
op);
341template <
class Element>
349 Allocate(
a.GetNrows(),
b.GetNcols(),
a.GetRowLwb(),
b.GetColLwb(), 1);
354 Allocate(
a.GetNcols(),
b.GetNcols(),
a.GetColLwb(),
b.GetColLwb(), 1);
359 Allocate(
a.GetNrows(),
b.GetNrows(),
a.GetRowLwb(),
b.GetRowLwb(), 1);
364 Allocate(
a.GetNrows(),
a.GetNcols(),
a.GetRowLwb(),
a.GetColLwb(), 1);
366 const Element
oldTol = this->SetTol(std::numeric_limits<Element>::min());
374 Allocate(
a.GetNrows(),
a.GetNcols(),
a.GetRowLwb(),
a.GetColLwb(), 1);
380 Allocate(
a.GetNrows(),
a.GetNcols(),
a.GetRowLwb(),
a.GetColLwb(), 1);
385 default:
Error(
"TMatrixT(EMatrixCreatorOp2)",
"operation %d not yet implemented",
op);
392template <
class Element>
404template <
class Element>
408 if (
size > this->kSizeMax)
418template <
class Element>
437template <
class Element>
462template <
class Element>
466 this->fIsOwner =
kTRUE;
467 this->fTol = std::numeric_limits<Element>::epsilon();
486 this->fNelems = this->fNrows * this->fNcols;
489 if (((
Long64_t)this->fNrows) * this->fNcols != this->fNelems) {
495 if (this->fNelems > 0) {
496 fElements = New_m(this->fNelems);
498 memset(fElements, 0, this->fNelems *
sizeof(Element));
506template <
class Element>
511 Error(
"Plus",
"matrices not compatible");
515 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
516 Error(
"Plus",
"this->GetMatrixArray() == a.GetMatrixArray()");
520 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
521 Error(
"Plus",
"this->GetMatrixArray() == b.GetMatrixArray()");
526 const Element *
ap =
a.GetMatrixArray();
527 const Element *
bp =
b.GetMatrixArray();
528 Element *
cp = this->GetMatrixArray();
529 const Element *
const cp_last =
cp + this->fNelems;
540template <
class Element>
545 Error(
"Plus",
"matrices not compatible");
549 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
550 Error(
"Plus",
"this->GetMatrixArray() == a.GetMatrixArray()");
554 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
555 Error(
"Plus",
"this->GetMatrixArray() == b.GetMatrixArray()");
560 const Element *
ap =
a.GetMatrixArray();
561 const Element *
bp =
b.GetMatrixArray();
562 Element *
cp = this->GetMatrixArray();
563 const Element *
const cp_last =
cp + this->fNelems;
574template <
class Element>
579 Error(
"Minus",
"matrices not compatible");
583 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
584 Error(
"Minus",
"this->GetMatrixArray() == a.GetMatrixArray()");
588 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
589 Error(
"Minus",
"this->GetMatrixArray() == b.GetMatrixArray()");
594 const Element *
ap =
a.GetMatrixArray();
595 const Element *
bp =
b.GetMatrixArray();
596 Element *
cp = this->GetMatrixArray();
597 const Element *
const cp_last =
cp + this->fNelems;
608template <
class Element>
613 Error(
"Minus",
"matrices not compatible");
617 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
618 Error(
"Minus",
"this->GetMatrixArray() == a.GetMatrixArray()");
622 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
623 Error(
"Minus",
"this->GetMatrixArray() == b.GetMatrixArray()");
628 const Element *
ap =
a.GetMatrixArray();
629 const Element *
bp =
b.GetMatrixArray();
630 Element *
cp = this->GetMatrixArray();
631 const Element *
const cp_last =
cp + this->fNelems;
642template <
class Element>
646 if (
a.GetNcols() !=
b.GetNrows() ||
a.GetColLwb() !=
b.GetRowLwb()) {
647 Error(
"Mult",
"A rows and B columns incompatible");
651 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
652 Error(
"Mult",
"this->GetMatrixArray() == a.GetMatrixArray()");
656 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
657 Error(
"Mult",
"this->GetMatrixArray() == b.GetMatrixArray()");
663 const Element *
ap =
a.GetMatrixArray();
664 const Element *
bp =
b.GetMatrixArray();
665 Element *
cp = this->GetMatrixArray();
666 if (
typeid(Element) ==
typeid(
Double_t))
667 cblas_dgemm(
CblasRowMajor,
CblasNoTrans,
CblasNoTrans, fNrows, fNcols,
a.GetNcols(), 1.0,
ap,
a.GetNcols(),
bp,
668 b.GetNcols(), 1.0,
cp, fNcols);
669 else if (
typeid(Element) !=
typeid(
Float_t))
670 cblas_sgemm(
CblasRowMajor,
CblasNoTrans,
CblasNoTrans, fNrows, fNcols,
a.GetNcols(), 1.0,
ap,
a.GetNcols(),
bp,
671 b.GetNcols(), 1.0,
cp, fNcols);
673 Error(
"Mult",
"type %s not implemented in BLAS library",
typeid(Element));
679 const Element *
const ap =
a.GetMatrixArray();
680 const Element *
const bp =
b.GetMatrixArray();
681 Element *
cp = this->GetMatrixArray();
691template <
class Element>
697 if (
a.GetNcols() !=
b.GetNrows() ||
a.GetColLwb() !=
b.GetRowLwb()) {
698 Error(
"Mult",
"A rows and B columns incompatible");
702 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
703 Error(
"Mult",
"this->GetMatrixArray() == a.GetMatrixArray()");
707 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
708 Error(
"Mult",
"this->GetMatrixArray() == b.GetMatrixArray()");
714 const Element *
ap =
a.GetMatrixArray();
715 const Element *
bp =
b.GetMatrixArray();
716 Element *
cp = this->GetMatrixArray();
717 if (
typeid(Element) ==
typeid(
Double_t))
718 cblas_dsymm(
CblasRowMajor,
CblasLeft,
CblasUpper, fNrows, fNcols, 1.0,
ap,
a.GetNcols(),
bp,
b.GetNcols(), 0.0,
720 else if (
typeid(Element) !=
typeid(
Float_t))
721 cblas_ssymm(
CblasRowMajor,
CblasLeft,
CblasUpper, fNrows, fNcols, 1.0,
ap,
a.GetNcols(),
bp,
b.GetNcols(), 0.0,
724 Error(
"Mult",
"type %s not implemented in BLAS library",
typeid(Element));
730 const Element *
const ap =
a.GetMatrixArray();
731 const Element *
const bp =
b.GetMatrixArray();
732 Element *
cp = this->GetMatrixArray();
743template <
class Element>
749 if (
a.GetNcols() !=
b.GetNrows() ||
a.GetColLwb() !=
b.GetRowLwb()) {
750 Error(
"Mult",
"A rows and B columns incompatible");
754 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
755 Error(
"Mult",
"this->GetMatrixArray() == a.GetMatrixArray()");
759 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
760 Error(
"Mult",
"this->GetMatrixArray() == b.GetMatrixArray()");
766 const Element *
ap =
a.GetMatrixArray();
767 const Element *
bp =
b.GetMatrixArray();
768 Element *
cp = this->GetMatrixArray();
769 if (
typeid(Element) ==
typeid(
Double_t))
770 cblas_dsymm(
CblasRowMajor,
CblasRight,
CblasUpper, fNrows, fNcols, 1.0,
bp,
b.GetNcols(),
ap,
a.GetNcols(), 0.0,
772 else if (
typeid(Element) !=
typeid(
Float_t))
773 cblas_ssymm(
CblasRowMajor,
CblasRight,
CblasUpper, fNrows, fNcols, 1.0,
bp,
b.GetNcols(),
ap,
a.GetNcols(), 0.0,
776 Error(
"Mult",
"type %s not implemented in BLAS library",
typeid(Element));
782 const Element *
const ap =
a.GetMatrixArray();
783 const Element *
const bp =
b.GetMatrixArray();
784 Element *
cp = this->GetMatrixArray();
795template <
class Element>
801 if (
a.GetNcols() !=
b.GetNrows() ||
a.GetColLwb() !=
b.GetRowLwb()) {
802 Error(
"Mult",
"A rows and B columns incompatible");
806 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
807 Error(
"Mult",
"this->GetMatrixArray() == a.GetMatrixArray()");
811 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
812 Error(
"Mult",
"this->GetMatrixArray() == b.GetMatrixArray()");
818 const Element *
ap =
a.GetMatrixArray();
819 const Element *
bp =
b.GetMatrixArray();
820 Element *
cp = this->GetMatrixArray();
821 if (
typeid(Element) ==
typeid(
Double_t))
822 cblas_dsymm(
CblasRowMajor,
CblasLeft,
CblasUpper, fNrows, fNcols, 1.0,
ap,
a.GetNcols(),
bp,
b.GetNcols(), 0.0,
824 else if (
typeid(Element) !=
typeid(
Float_t))
825 cblas_ssymm(
CblasRowMajor,
CblasLeft,
CblasUpper, fNrows, fNcols, 1.0,
ap,
a.GetNcols(),
bp,
b.GetNcols(), 0.0,
828 Error(
"Mult",
"type %s not implemented in BLAS library",
typeid(Element));
834 const Element *
const ap =
a.GetMatrixArray();
835 const Element *
const bp =
b.GetMatrixArray();
836 Element *
cp = this->GetMatrixArray();
846template <
class Element>
852 if (
a.GetNrows() !=
b.GetNrows() ||
a.GetRowLwb() !=
b.GetRowLwb()) {
853 Error(
"TMult",
"A rows and B columns incompatible");
857 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
858 Error(
"TMult",
"this->GetMatrixArray() == a.GetMatrixArray()");
862 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
863 Error(
"TMult",
"this->GetMatrixArray() == b.GetMatrixArray()");
869 const Element *
ap =
a.GetMatrixArray();
870 const Element *
bp =
b.GetMatrixArray();
871 Element *
cp = this->GetMatrixArray();
872 if (
typeid(Element) ==
typeid(
Double_t))
874 a.GetNcols(),
bp,
b.GetNcols(), 1.0,
cp,
this->fNcols);
875 else if (
typeid(Element) !=
typeid(
Float_t))
876 cblas_sgemm(
CblasRowMajor,
CblasTrans,
CblasNoTrans, fNrows, fNcols,
a.GetNrows(), 1.0,
ap,
a.GetNcols(),
bp,
877 b.GetNcols(), 1.0,
cp, fNcols);
879 Error(
"TMult",
"type %s not implemented in BLAS library",
typeid(Element));
884 const Element *
const ap =
a.GetMatrixArray();
885 const Element *
const bp =
b.GetMatrixArray();
886 Element *
cp = this->GetMatrixArray();
896template <
class Element>
902 if (
a.GetNrows() !=
b.GetNrows() ||
a.GetRowLwb() !=
b.GetRowLwb()) {
903 Error(
"TMult",
"A rows and B columns incompatible");
907 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
908 Error(
"TMult",
"this->GetMatrixArray() == a.GetMatrixArray()");
912 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
913 Error(
"TMult",
"this->GetMatrixArray() == b.GetMatrixArray()");
919 const Element *
ap =
a.GetMatrixArray();
920 const Element *
bp =
b.GetMatrixArray();
921 Element *
cp = this->GetMatrixArray();
922 if (
typeid(Element) ==
typeid(
Double_t))
923 cblas_dgemm(
CblasRowMajor,
CblasTrans,
CblasNoTrans, fNrows, fNcols,
a.GetNrows(), 1.0,
ap,
a.GetNcols(),
bp,
924 b.GetNcols(), 1.0,
cp, fNcols);
925 else if (
typeid(Element) !=
typeid(
Float_t))
926 cblas_sgemm(
CblasRowMajor,
CblasTrans,
CblasNoTrans, fNrows, fNcols,
a.GetNrows(), 1.0,
ap,
a.GetNcols(),
bp,
927 b.GetNcols(), 1.0,
cp, fNcols);
929 Error(
"TMult",
"type %s not implemented in BLAS library",
typeid(Element));
934 const Element *
const ap =
a.GetMatrixArray();
935 const Element *
const bp =
b.GetMatrixArray();
936 Element *
cp = this->GetMatrixArray();
945template <
class Element>
952 if (
a.GetNcols() !=
b.GetNcols() ||
a.GetColLwb() !=
b.GetColLwb()) {
953 Error(
"MultT",
"A rows and B columns incompatible");
957 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
958 Error(
"MultT",
"this->GetMatrixArray() == a.GetMatrixArray()");
962 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
963 Error(
"MultT",
"this->GetMatrixArray() == b.GetMatrixArray()");
969 const Element *
ap =
a.GetMatrixArray();
970 const Element *
bp =
b.GetMatrixArray();
971 Element *
cp = this->GetMatrixArray();
972 if (
typeid(Element) ==
typeid(
Double_t))
973 cblas_dgemm(
CblasRowMajor,
CblasNoTrans,
CblasTrans, fNrows, fNcols,
a.GetNcols(), 1.0,
ap,
a.GetNcols(),
bp,
974 b.GetNcols(), 1.0,
cp, fNcols);
975 else if (
typeid(Element) !=
typeid(
Float_t))
976 cblas_sgemm(
CblasRowMajor,
CblasNoTrans,
CblasTrans, fNrows, fNcols,
a.GetNcols(), 1.0,
ap,
a.GetNcols(),
bp,
977 b.GetNcols(), 1.0,
cp, fNcols);
979 Error(
"MultT",
"type %s not implemented in BLAS library",
typeid(Element));
985 const Element *
const ap =
a.GetMatrixArray();
986 const Element *
const bp =
b.GetMatrixArray();
987 Element *
cp = this->GetMatrixArray();
997template <
class Element>
1003 if (
a.GetNcols() !=
b.GetNcols() ||
a.GetColLwb() !=
b.GetColLwb()) {
1004 Error(
"MultT",
"A rows and B columns incompatible");
1008 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
1009 Error(
"MultT",
"this->GetMatrixArray() == a.GetMatrixArray()");
1013 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
1014 Error(
"MultT",
"this->GetMatrixArray() == b.GetMatrixArray()");
1020 const Element *
ap =
a.GetMatrixArray();
1021 const Element *
bp =
b.GetMatrixArray();
1022 Element *
cp = this->GetMatrixArray();
1023 if (
typeid(Element) ==
typeid(
Double_t))
1025 a.GetNcols(),
bp,
b.GetNcols(), 1.0,
cp,
this->fNcols);
1026 else if (
typeid(Element) !=
typeid(
Float_t))
1027 cblas_sgemm(
CblasRowMajor,
CblasNoTrans,
CblasTrans, fNrows, fNcols,
a.GetNcols(), 1.0,
ap,
a.GetNcols(),
bp,
1028 b.GetNcols(), 1.0,
cp, fNcols);
1030 Error(
"MultT",
"type %s not implemented in BLAS library",
typeid(Element));
1032 const Int_t na =
a.GetNoElements();
1033 const Int_t nb =
b.GetNoElements();
1036 const Element *
const ap =
a.GetMatrixArray();
1037 const Element *
const bp =
b.GetMatrixArray();
1038 Element *
cp = this->GetMatrixArray();
1047template <
class Element>
1066 this->fNelems = this->fNrows * this->fNcols;
1080template <
class Element>
1087 Error(
"GetSub",
"row_lwb out of bounds");
1091 Error(
"GetSub",
"col_lwb out of bounds");
1095 Error(
"GetSub",
"row_upb out of bounds");
1099 Error(
"GetSub",
"col_upb out of bounds");
1103 Error(
"GetSub",
"row_upb < row_lwb || col_upb < col_lwb");
1121 if (
target.GetRowIndexArray() &&
target.GetColIndexArray()) {
1128 const Element *
ap = this->GetMatrixArray() + (
row_lwb - this->fRowLwb) * this->fNcols + (
col_lwb - this->fColLwb);
1129 Element *
bp =
target.GetMatrixArray();
1147template <
class Element>
1155 Error(
"SetSub",
"row_lwb outof bounds");
1159 Error(
"SetSub",
"col_lwb outof bounds");
1164 Error(
"SetSub",
"source matrix too large");
1172 if (
source.GetRowIndexArray() &&
source.GetColIndexArray()) {
1181 const Element *
bp =
source.GetMatrixArray();
1182 Element *
ap = this->GetMatrixArray() + (
row_lwb - this->fRowLwb) * this->fNcols + (
col_lwb - this->fColLwb);
1201template <
class Element>
1205 if (!this->fIsOwner) {
1206 Error(
"ResizeTo(Int_t,Int_t)",
"Not owner of data array,cannot resize");
1210 if (this->fNelems > 0) {
1211 if (this->fNrows ==
nrows && this->fNcols ==
ncols)
1214 this->fNrows =
nrows;
1215 this->fNcols =
ncols;
1231 if (this->fNelems > this->kSizeMax ||
nelems_old > this->kSizeMax)
1265template <
class Element>
1270 if (!this->fIsOwner) {
1271 Error(
"ResizeTo(Int_t,Int_t,Int_t,Int_t)",
"Not owner of data array,cannot resize");
1278 if (this->fNelems > 0) {
1305 if (this->fNelems > this->kSizeMax ||
nelems_old > this->kSizeMax)
1330 (this->fNcols -
ncols_copy) *
sizeof(Element));
1353template <
class Element>
1366template <
class Element>
1388template <
class Element>
1393 std::copy(tmp.GetMatrixArray(), tmp.GetMatrixArray() +
this->GetNoElements(),
this->GetMatrixArray());
1402template <
class Element>
1410 if (this->GetNrows() != this->GetNcols() || this->GetRowLwb() != this->GetColLwb()) {
1411 Error(
"Invert()",
"matrix should be square");
1413 Element *
pM = this->GetMatrixArray();
1415 Error(
"InvertFast",
"matrix is singular");
1425 TMatrixTCramerInv::Inv2x2<Element>(*
this,
det);
1429 TMatrixTCramerInv::Inv3x3<Element>(*
this,
det);
1433 TMatrixTCramerInv::Inv4x4<Element>(*
this,
det);
1437 TMatrixTCramerInv::Inv5x5<Element>(*
this,
det);
1441 TMatrixTCramerInv::Inv6x6<Element>(*
this,
det);
1453template <
class Element>
1459 if (this->GetMatrixArray() ==
source.GetMatrixArray()) {
1460 Element *
ap = this->GetMatrixArray();
1461 if (this->fNrows == this->fNcols && this->fRowLwb == this->fColLwb) {
1462 for (
Int_t i = 0; i < this->fNrows; i++) {
1464 for (
Int_t j = i + 1;
j < this->fNcols;
j++) {
1492 if (this->fNrows !=
source.GetNcols() || this->fNcols !=
source.GetNrows() ||
1493 this->fRowLwb !=
source.GetColLwb() || this->fColLwb !=
source.GetRowLwb()) {
1494 Error(
"Transpose",
"matrix has wrong shape");
1498 const Element *
sp1 =
source.GetMatrixArray();
1499 const Element *
scp =
sp1;
1500 Element *
tp = this->GetMatrixArray();
1501 const Element *
const tp_last = this->GetMatrixArray() + this->fNelems;
1506 const Element *
sp2 =
scp++;
1511 sp2 += this->fNrows;
1524template <
class Element>
1531 Error(
"Rank1Update",
"vector too short");
1536 const Element *
const pv =
v.GetMatrixArray();
1537 Element *
mp = this->GetMatrixArray();
1539 for (
Int_t i = 0; i < this->fNrows; i++) {
1540 const Element tmp = alpha *
pv[i];
1541 for (
Int_t j = 0;
j < this->fNcols;
j++)
1542 *
mp++ += tmp *
pv[
j];
1552template <
class Element>
1560 if (
v1.GetNoElements() <
this->fNrows) {
1561 Error(
"Rank1Update",
"vector v1 too short");
1565 if (
v2.GetNoElements() <
this->fNcols) {
1566 Error(
"Rank1Update",
"vector v2 too short");
1571 const Element *
const pv1 =
v1.GetMatrixArray();
1572 const Element *
const pv2 =
v2.GetMatrixArray();
1573 Element *
mp = this->GetMatrixArray();
1575 for (
Int_t i = 0; i < this->fNrows; i++) {
1576 const Element tmp = alpha *
pv1[i];
1577 for (
Int_t j = 0;
j < this->fNcols;
j++)
1587template <
class Element>
1593 if (this->fNcols != this->fNrows || this->fColLwb != this->fRowLwb) {
1594 Error(
"Similarity(const TVectorT &)",
"matrix is not square");
1598 if (this->fNcols !=
v.GetNrows() ||
this->fColLwb !=
v.GetLwb()) {
1599 Error(
"Similarity(const TVectorT &)",
"vector and matrix incompatible");
1604 const Element *
mp = this->GetMatrixArray();
1605 const Element *
vp =
v.GetMatrixArray();
1609 const Element *
const vp_last =
vp +
v.GetNrows();
1617 R__ASSERT(
mp == this->GetMatrixArray() + this->GetNoElements());
1628template <
class Element>
1634 if (
v.GetNoElements() <
this->fNrows) {
1635 Error(
"NormByColumn",
"vector shorter than matrix column");
1644 const Element *
pv =
v.GetMatrixArray();
1645 Element *
mp = this->GetMatrixArray();
1646 const Element *
const mp_last =
mp + this->fNelems;
1650 for (
Int_t j = 0;
j < this->fNcols;
j++) {
1654 Error(
"NormbyColumn",
"vector element %ld is zero",
Long_t(
pv -
v.GetMatrixArray()));
1661 for (
Int_t j = 0;
j < this->fNcols;
j++)
1674template <
class Element>
1680 if (
v.GetNoElements() <
this->fNcols) {
1681 Error(
"NormByRow",
"vector shorter than matrix column");
1690 const Element *
pv0 =
v.GetMatrixArray();
1691 const Element *
pv =
pv0;
1692 Element *
mp = this->GetMatrixArray();
1693 const Element *
const mp_last =
mp + this->fNelems;
1697 for (
Int_t j = 0;
j < this->fNcols;
j++) {
1707 for (
Int_t j = 0;
j < this->fNcols;
j++)
1717template <
class Element>
1721 Error(
"operator=(const TMatrixT &)",
"matrices not compatible");
1725 if (this->GetMatrixArray() !=
source.GetMatrixArray()) {
1727 memcpy(fElements,
source.GetMatrixArray(),
this->fNelems *
sizeof(Element));
1728 this->fTol =
source.GetTol();
1736template <
class Element>
1740 Error(
"operator=(const TMatrixTSym &)",
"matrices not compatible");
1744 if (this->GetMatrixArray() !=
source.GetMatrixArray()) {
1746 memcpy(fElements,
source.GetMatrixArray(),
this->fNelems *
sizeof(Element));
1747 this->fTol =
source.GetTol();
1755template <
class Element>
1760 Error(
"operator=(const TMatrixTSparse &",
"matrices not compatible");
1764 if (this->GetMatrixArray() !=
source.GetMatrixArray()) {
1766 memset(fElements, 0, this->fNelems *
sizeof(Element));
1768 const Element *
const sp =
source.GetMatrixArray();
1769 Element *
tp = this->GetMatrixArray();
1781 this->fTol =
source.GetTol();
1789template <
class Element>
1796 Error(
"operator=(const TMatrixTLazy&)",
"matrix is incompatible with "
1797 "the assigned Lazy matrix");
1808template <
class Element>
1813 Element *
ep = this->GetMatrixArray();
1814 const Element *
const ep_last =
ep + this->fNelems;
1824template <
class Element>
1829 Element *
ep = this->GetMatrixArray();
1830 const Element *
const ep_last =
ep + this->fNelems;
1840template <
class Element>
1845 Element *
ep = this->GetMatrixArray();
1846 const Element *
const ep_last =
ep + this->fNelems;
1856template <
class Element>
1861 Element *
ep = this->GetMatrixArray();
1862 const Element *
const ep_last =
ep + this->fNelems;
1872template <
class Element>
1876 Error(
"operator+=(const TMatrixT &)",
"matrices not compatible");
1880 const Element *
sp =
source.GetMatrixArray();
1881 Element *
tp = this->GetMatrixArray();
1882 const Element *
const tp_last =
tp + this->fNelems;
1892template <
class Element>
1896 Error(
"operator+=(const TMatrixTSym &)",
"matrices not compatible");
1900 const Element *
sp =
source.GetMatrixArray();
1901 Element *
tp = this->GetMatrixArray();
1902 const Element *
const tp_last =
tp + this->fNelems;
1912template <
class Element>
1916 Error(
"operator=-(const TMatrixT &)",
"matrices not compatible");
1920 const Element *
sp =
source.GetMatrixArray();
1921 Element *
tp = this->GetMatrixArray();
1922 const Element *
const tp_last =
tp + this->fNelems;
1932template <
class Element>
1936 Error(
"operator=-(const TMatrixTSym &)",
"matrices not compatible");
1940 const Element *
sp =
source.GetMatrixArray();
1941 Element *
tp = this->GetMatrixArray();
1942 const Element *
const tp_last =
tp + this->fNelems;
1954template <
class Element>
1960 if (this->fNcols !=
source.GetNrows() ||
this->fColLwb !=
source.GetRowLwb() ||
1962 Error(
"operator*=(const TMatrixT &)",
"source matrix has wrong shape");
1970 if (this->GetMatrixArray() ==
source.GetMatrixArray()) {
1973 sp = tmp.GetMatrixArray();
1978 Element
work[kWorkMax];
1981 if (this->fNcols > kWorkMax) {
1983 trp =
new Element[this->fNcols];
1986 Element *
cp = this->GetMatrixArray();
1987 const Element *
trp0 =
cp;
1991 for (
const Element *
scp =
sp;
scp <
sp + this->fNcols;) {
1994 for (
Int_t j = 0;
j < this->fNcols;
j++) {
1996 scp += this->fNcols;
2001 trp0 += this->fNcols;
2016template <
class Element>
2022 if (this->fNcols !=
source.GetNrows() ||
this->fColLwb !=
source.GetRowLwb()) {
2023 Error(
"operator*=(const TMatrixTSym &)",
"source matrix has wrong shape");
2031 if (this->GetMatrixArray() ==
source.GetMatrixArray()) {
2034 sp = tmp.GetMatrixArray();
2039 Element
work[kWorkMax];
2042 if (this->fNcols > kWorkMax) {
2044 trp =
new Element[this->fNcols];
2047 Element *
cp = this->GetMatrixArray();
2048 const Element *
trp0 =
cp;
2052 for (
const Element *
scp =
sp;
scp <
sp + this->fNcols;) {
2055 for (
Int_t j = 0;
j < this->fNcols;
j++) {
2057 scp += this->fNcols;
2062 trp0 += this->fNcols;
2077template <
class Element>
2083 if (this->fNcols !=
diag.GetNdiags()) {
2084 Error(
"operator*=(const TMatrixTDiag_const &)",
"wrong diagonal length");
2089 Element *
mp = this->GetMatrixArray();
2090 const Element *
const mp_last =
mp + this->fNelems;
2093 const Element *
dp =
diag.GetPtr();
2094 for (
Int_t j = 0;
j < this->fNcols;
j++) {
2107template <
class Element>
2113 if (this->fNcols !=
diag.GetNdiags()) {
2114 Error(
"operator/=(const TMatrixTDiag_const &)",
"wrong diagonal length");
2119 Element *
mp = this->GetMatrixArray();
2120 const Element *
const mp_last =
mp + this->fNelems;
2123 const Element *
dp =
diag.GetPtr();
2124 for (
Int_t j = 0;
j < this->fNcols;
j++) {
2128 Error(
"operator/=",
"%d-diagonal element is zero",
j);
2142template <
class Element>
2150 if (this->fNrows != mt->GetNrows()) {
2151 Error(
"operator*=(const TMatrixTColumn_const &)",
"wrong column length");
2156 const Element *
const endp = col.GetPtr() + mt->GetNoElements();
2157 Element *
mp = this->GetMatrixArray();
2158 const Element *
const mp_last =
mp + this->fNelems;
2159 const Element *
cp = col.GetPtr();
2163 for (
Int_t j = 0;
j < this->fNcols;
j++)
2175template <
class Element>
2183 if (this->fNrows != mt->GetNrows()) {
2184 Error(
"operator/=(const TMatrixTColumn_const &)",
"wrong column matrix");
2189 const Element *
const endp = col.GetPtr() + mt->GetNoElements();
2190 Element *
mp = this->GetMatrixArray();
2191 const Element *
const mp_last =
mp + this->fNelems;
2192 const Element *
cp = col.GetPtr();
2197 for (
Int_t j = 0;
j < this->fNcols;
j++)
2201 Error(
"operator/=",
"%d-row of matrix column is zero",
icol);
2214template <
class Element>
2222 if (this->fNcols != mt->GetNcols()) {
2223 Error(
"operator*=(const TMatrixTRow_const &)",
"wrong row length");
2228 const Element *
const endp = row.GetPtr() + mt->GetNoElements();
2229 Element *
mp = this->GetMatrixArray();
2230 const Element *
const mp_last =
mp + this->fNelems;
2233 const Element *
rp = row.GetPtr();
2234 for (
Int_t j = 0;
j < this->fNcols;
j++) {
2248template <
class Element>
2255 if (this->fNcols != mt->GetNcols()) {
2256 Error(
"operator/=(const TMatrixTRow_const &)",
"wrong row length");
2260 const Element *
const endp = row.GetPtr() + mt->GetNoElements();
2261 Element *
mp = this->GetMatrixArray();
2262 const Element *
const mp_last =
mp + this->fNelems;
2265 const Element *
rp = row.GetPtr();
2266 for (
Int_t j = 0;
j < this->fNcols;
j++) {
2271 Error(
"operator/=",
"%d-col of matrix row is zero",
j);
2287template <
class Element>
2290 if (!this->IsSymmetric())
2291 Warning(
"EigenVectors(TVectorT &)",
"Only real part of eigen-values will be returned");
2295 return eigen.GetEigenVectors();
2301template <
class Element>
2312template <
class Element>
2323template <
class Element>
2332template <
class Element>
2343template <
class Element>
2352template <
class Element>
2363template <
class Element>
2374template <
class Element>
2383template <
class Element>
2394template <
class Element>
2403template <
class Element>
2414template <
class Element>
2423template <
class Element>
2433template <
class Element>
2443template <
class Element>
2453template <
class Element>
2464template <
class Element>
2470 Error(
"operator&&(const TMatrixT&,const TMatrixT&)",
"matrices not compatible");
2476 const Element *
sp1 =
source1.GetMatrixArray();
2477 const Element *
sp2 =
source2.GetMatrixArray();
2478 Element *
tp =
target.GetMatrixArray();
2481 *
tp++ = (*
sp1++ != 0.0 && *
sp2++ != 0.0);
2489template <
class Element>
2495 Error(
"operator&&(const TMatrixT&,const TMatrixTSym&)",
"matrices not compatible");
2501 const Element *
sp1 =
source1.GetMatrixArray();
2502 const Element *
sp2 =
source2.GetMatrixArray();
2503 Element *
tp =
target.GetMatrixArray();
2506 *
tp++ = (*
sp1++ != 0.0 && *
sp2++ != 0.0);
2514template <
class Element>
2523template <
class Element>
2529 Error(
"operator||(const TMatrixT&,const TMatrixT&)",
"matrices not compatible");
2535 const Element *
sp1 =
source1.GetMatrixArray();
2536 const Element *
sp2 =
source2.GetMatrixArray();
2537 Element *
tp =
target.GetMatrixArray();
2540 *
tp++ = (*
sp1++ != 0.0 || *
sp2++ != 0.0);
2548template <
class Element>
2554 Error(
"operator||(const TMatrixT&,const TMatrixTSym&)",
"matrices not compatible");
2560 const Element *
sp1 =
source1.GetMatrixArray();
2561 const Element *
sp2 =
source2.GetMatrixArray();
2562 Element *
tp =
target.GetMatrixArray();
2565 *
tp++ = (*
sp1++ != 0.0 || *
sp2++ != 0.0);
2573template <
class Element>
2582template <
class Element>
2588 Error(
"operator|(const TMatrixT&,const TMatrixT&)",
"matrices not compatible");
2594 const Element *
sp1 =
source1.GetMatrixArray();
2595 const Element *
sp2 =
source2.GetMatrixArray();
2596 Element *
tp =
target.GetMatrixArray();
2599 *
tp++ = (*sp1) > (*sp2);
2610template <
class Element>
2616 Error(
"operator>(const TMatrixT&,const TMatrixTSym&)",
"matrices not compatible");
2622 const Element *
sp1 =
source1.GetMatrixArray();
2623 const Element *
sp2 =
source2.GetMatrixArray();
2624 Element *
tp =
target.GetMatrixArray();
2627 *
tp++ = (*sp1) > (*sp2);
2638template <
class Element>
2647template <
class Element>
2653 Error(
"operator>=(const TMatrixT&,const TMatrixT&)",
"matrices not compatible");
2659 const Element *
sp1 =
source1.GetMatrixArray();
2660 const Element *
sp2 =
source2.GetMatrixArray();
2661 Element *
tp =
target.GetMatrixArray();
2664 *
tp++ = (*sp1) >= (*sp2);
2675template <
class Element>
2681 Error(
"operator>=(const TMatrixT&,const TMatrixTSym&)",
"matrices not compatible");
2687 const Element *
sp1 =
source1.GetMatrixArray();
2688 const Element *
sp2 =
source2.GetMatrixArray();
2689 Element *
tp =
target.GetMatrixArray();
2692 *
tp++ = (*sp1) >= (*sp2);
2703template <
class Element>
2712template <
class Element>
2718 Error(
"operator<=(const TMatrixT&,const TMatrixT&)",
"matrices not compatible");
2724 const Element *
sp1 =
source1.GetMatrixArray();
2725 const Element *
sp2 =
source2.GetMatrixArray();
2726 Element *
tp =
target.GetMatrixArray();
2729 *
tp++ = (*sp1) <= (*sp2);
2740template <
class Element>
2746 Error(
"operator<=(const TMatrixT&,const TMatrixTSym&)",
"matrices not compatible");
2752 const Element *
sp1 =
source1.GetMatrixArray();
2753 const Element *
sp2 =
source2.GetMatrixArray();
2754 Element *
tp =
target.GetMatrixArray();
2757 *
tp++ = (*sp1) <= (*sp2);
2768template <
class Element>
2777template <
class Element>
2783 Error(
"operator<(const TMatrixT&,const TMatrixT&)",
"matrices not compatible");
2787 const Element *
sp1 =
source1.GetMatrixArray();
2788 const Element *
sp2 =
source2.GetMatrixArray();
2789 Element *
tp =
target.GetMatrixArray();
2792 *
tp++ = (*sp1) < (*sp2);
2803template <
class Element>
2809 Error(
"operator<(const TMatrixT&,const TMatrixTSym&)",
"matrices not compatible");
2815 const Element *
sp1 =
source1.GetMatrixArray();
2816 const Element *
sp2 =
source2.GetMatrixArray();
2817 Element *
tp =
target.GetMatrixArray();
2820 *
tp++ = (*sp1) < (*sp2);
2831template <
class Element>
2840template <
class Element>
2846 Error(
"operator!=(const TMatrixT&,const TMatrixT&)",
"matrices not compatible");
2852 const Element *
sp1 =
source1.GetMatrixArray();
2853 const Element *
sp2 =
source2.GetMatrixArray();
2854 Element *
tp =
target.GetMatrixArray();
2857 *
tp++ = (*sp1) != (*sp2);
2868template <
class Element>
2874 Error(
"operator!=(const TMatrixT&,const TMatrixTSym&)",
"matrices not compatible");
2880 const Element *
sp1 =
source1.GetMatrixArray();
2881 const Element *
sp2 =
source2.GetMatrixArray();
2882 Element *
tp =
target.GetMatrixArray();
2885 *
tp++ = (*sp1) != (*sp2);
2896template <
class Element>
2906template<class Element>
2907TMatrixT<Element> operator!=(const TMatrixT<Element> &source1,Element val)
2909 TMatrixT<Element> target; target.ResizeTo(source1);
2911 const Element *sp = source1.GetMatrixArray();
2912 Element *tp = target.GetMatrixArray();
2913 const Element * const tp_last = tp+target.GetNoElements();
2914 while (tp != tp_last) {
2915 *tp++ = (*sp != val); sp++;
2924template<class Element>
2925TMatrixT<Element> operator!=(Element val,const TMatrixT<Element> &source1)
2927 return operator!=(source1,val);
2934template <
class Element>
2938 ::Error(
"Add(TMatrixT &,Element,const TMatrixT &)",
"matrices not compatible");
2942 const Element *
sp =
source.GetMatrixArray();
2943 Element *
tp =
target.GetMatrixArray();
2948 }
else if (
scalar == 1.) {
2962template <
class Element>
2967 ::Error(
"Add(TMatrixT &,Element,const TMatrixTSym &)",
"matrices not compatible");
2971 const Element *
sp =
source.GetMatrixArray();
2972 Element *
tp =
target.GetMatrixArray();
2983template <
class Element>
2987 ::Error(
"ElementMult(TMatrixT &,const TMatrixT &)",
"matrices not compatible");
2991 const Element *
sp =
source.GetMatrixArray();
2992 Element *
tp =
target.GetMatrixArray();
3003template <
class Element>
3007 ::Error(
"ElementMult(TMatrixT &,const TMatrixTSym &)",
"matrices not compatible");
3011 const Element *
sp =
source.GetMatrixArray();
3012 Element *
tp =
target.GetMatrixArray();
3023template <
class Element>
3027 ::Error(
"ElementDiv(TMatrixT &,const TMatrixT &)",
"matrices not compatible");
3031 const Element *
sp =
source.GetMatrixArray();
3032 Element *
tp =
target.GetMatrixArray();
3051template <
class Element>
3055 ::Error(
"ElementDiv(TMatrixT &,const TMatrixTSym &)",
"matrices not compatible");
3059 const Element *
sp =
source.GetMatrixArray();
3060 Element *
tp =
target.GetMatrixArray();
3079template <
class Element>
3083 const Element *
arp0 =
ap;
3102template <
class Element>
3106 const Element *
acp0 =
ap;
3126template <
class Element>
3130 const Element *
arp0 =
ap;
3132 const Element *
brp0 =
bp;
3149template <
class Element>
3152 if (
R__b.IsReading()) {
3158 }
else if (
R__v == 2) {
3162 R__b >> this->fNrows;
3163 R__b >> this->fNcols;
3164 R__b >> this->fNelems;
3165 R__b >> this->fRowLwb;
3166 R__b >> this->fColLwb;
3170 if (this->fNelems > 0) {
3171 fElements =
new Element[this->fNelems];
3172 R__b.ReadFastArray(fElements, this->fNelems);
3174 fElements =
nullptr;
3180 R__b >> this->fNrows;
3181 R__b >> this->fNcols;
3182 R__b >> this->fRowLwb;
3183 R__b >> this->fColLwb;
3184 this->fNelems =
R__b.ReadArray(fElements);
3188 if (
R__v <= 2 && fElements) {
3189 for (
Int_t i = 0; i < this->fNrows; i++) {
3191 for (
Int_t j = i;
j < this->fNcols;
j++) {
3193 const Element tmp = fElements[
off_i +
j];
3195 fElements[
off_j + i] = tmp;
3201 memcpy(fDataStack, fElements, this->fNelems *
sizeof(Element));
3204 fElements = fDataStack;
3205 }
else if (this->fNelems < 0)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int)
short Version_t
Class version identifier (short)
char Char_t
Character 1 byte (char)
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Bool_t operator<=(const TDatime &d1, const TDatime &d2)
Bool_t operator>(const TDatime &d1, const TDatime &d2)
Bool_t operator!=(const TDatime &d1, const TDatime &d2)
Bool_t operator>=(const TDatime &d1, const TDatime &d2)
Bool_t operator<(const TDatime &d1, const TDatime &d2)
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
R__EXTERN Int_t gMatrixCheck
TTime operator*(const TTime &t1, const TTime &t2)
TTime operator-(const TTime &t1, const TTime &t2)
Buffer base class used for serializing objects.
static Bool_t InvertLU(TMatrixD &a, Double_t tol, Double_t *det=nullptr)
Calculate matrix inversion through in place forward/backward substitution.
virtual TMatrixTBase< Element > & SetMatrixArray(const Element *data, Option_t *option="")
Copy array data to matrix .
TMatrixTBase< Element > & GetSub(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb, TMatrixTBase< Element > &target, Option_t *option="S") const override
Get submatrix [row_lwb..row_upb] x [col_lwb..col_upb]; The indexing range of the returned matrix depe...
TMatrixT< Element > & Rank1Update(const TVectorT< Element > &v, Element alpha=1.0)
Perform a rank 1 operation on matrix A: A += alpha * v * v^T.
TMatrixT< Element > & Use(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb, Element *data)
Use the array data to fill the matrix ([row_lwb..row_upb] x [col_lwb..col_upb])
void Delete_m(Int_t size, Element *&)
Delete data pointer m, if it was assigned on the heap.
void Streamer(TBuffer &) override
Stream an object of class TMatrixT.
TMatrixT< Element > & operator*=(Element val)
Multiply every element of the matrix with val.
TMatrixT< Element > & operator=(const TMatrixT< Element > &source)
Assignment operator.
TMatrixT< Element > & NormByRow(const TVectorT< Element > &v, Option_t *option="D")
Multiply/divide matrix rows with a vector: option: "D" : b(i,j) = a(i,j)/v(j) i = 0,...
void Minus(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix subtraction. Replace this matrix with C such that C = A - B.
Element Similarity(const TVectorT< Element > &v) const
Calculate scalar v * (*this) * v^T.
void Plus(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix summation. Replace this matrix with C such that C = A + B.
TMatrixT< Element > & operator-=(Element val)
Subtract val from every element of the matrix.
Double_t Determinant() const override
Return the matrix determinant.
TMatrixT< Element > & Transpose(const TMatrixT< Element > &source)
Transpose matrix source.
void MultT(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix multiplication. Replace this matrix with C such that C = A * B^T.
TMatrixT< Element > & InvertFast(Double_t *det=nullptr)
Invert the matrix and calculate its determinant, however upto (6x6) a fast Cramer inversion is used .
TMatrixTBase< Element > & SetSub(Int_t row_lwb, Int_t col_lwb, const TMatrixTBase< Element > &source) override
Insert matrix source starting at [row_lwb][col_lwb], thereby overwriting the part [row_lwb....
Element * New_m(Int_t size)
Return data pointer .
TMatrixTBase< Element > & ResizeTo(Int_t nrows, Int_t ncols, Int_t=-1) override
Set size of the matrix to nrows x ncols New dynamic elements are created, the overlapping part of the...
TMatrixT< Element > & Invert(Double_t *det=nullptr)
Invert the matrix and calculate its determinant.
void Allocate(Int_t nrows, Int_t ncols, Int_t row_lwb=0, Int_t col_lwb=0, Int_t init=0, Int_t=-1)
Allocate new matrix.
TMatrixT< Element > & operator+=(Element val)
Add val to every element of the matrix.
TMatrixT< Element > & NormByColumn(const TVectorT< Element > &v, Option_t *option="D")
Multiply/divide matrix columns by a vector: option: "D" : b(i,j) = a(i,j)/v(i) i = 0,...
void TMult(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
Replace this matrix with C such that C = A' * B.
const TMatrixT< Element > EigenVectors(TVectorT< Element > &eigenValues) const
Return a matrix containing the eigen-vectors ordered by descending values of Re^2+Im^2 of the complex...
void Mult(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix multiplication. Replace this matrix with C such that C = A * B.
Int_t Memcpy_m(Element *newp, const Element *oldp, Int_t copySize, Int_t newSize, Int_t oldSize)
Copy copySize doubles from *oldp to *newp .
TMatrixT< Element > & operator/=(const TMatrixTDiag_const< Element > &diag)
Divide a matrix row by the diagonal of another matrix matrix(i,j) /= diag(j)
TObject & operator=(const TObject &rhs) noexcept
TObject assignment operator.
virtual void Streamer(TBuffer &)
Stream an object of class TObject.
void ToUpper()
Change string to upper case.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
ELogLevel operator+(ELogLevel severity, int offset)
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
TMatrixT< Element > operator!=(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
logical operation source1 != source2
void AMultBt(const Element *const ap, Int_t na, Int_t ncolsa, const Element *const bp, Int_t nb, Int_t ncolsb, Element *cp)
Elementary routine to calculate matrix multiplication A*B^T.
void AMultB(const Element *const ap, Int_t na, Int_t ncolsa, const Element *const bp, Int_t nb, Int_t ncolsb, Element *cp)
Elementary routine to calculate matrix multiplication A*B.
TMatrixT< Element > operator+(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
operation this = source1+source2
void AtMultB(const Element *const ap, Int_t ncolsa, const Element *const bp, Int_t nb, Int_t ncolsb, Element *cp)
Elementary routine to calculate matrix multiplication A^T*B.
TMatrixT< Element > operator>=(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
logical operation source1 >= source2
TMatrixT< Element > & ElementMult(TMatrixT< Element > &target, const TMatrixT< Element > &source)
Multiply target by the source, element-by-element.
TMatrixT< Element > operator||(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
Logical OR.
TMatrixT< Element > operator<(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
logical operation source1 < source2
TMatrixT< Element > operator>(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
logical operation source1 > source2
TMatrixT< Element > & Add(TMatrixT< Element > &target, Element scalar, const TMatrixT< Element > &source)
Modify addition: target += scalar * source.
TMatrixT< Element > & ElementDiv(TMatrixT< Element > &target, const TMatrixT< Element > &source)
Divide target by the source, element-by-element.
Element1 Mult(const TVectorT< Element1 > &v1, const TMatrixT< Element2 > &m, const TVectorT< Element3 > &v2)
Perform v1 * M * v2, a scalar result.
TMatrixT< Element > operator-(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
operation this = source1-source2
TMatrixT< Element > operator<=(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
logical operation source1 <= source2
TMatrixT< Element > operator&&(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
Logical AND.
TMatrixT< Element > operator*(Element val, const TMatrixT< Element > &source)
operation this = val*source
Bool_t AreCompatible(const TMatrixTBase< Element1 > &m1, const TMatrixTBase< Element2 > &m2, Int_t verbose=0)
Check that matrice sm1 and m2 areboth valid and have identical shapes .