40template<
class Element>
48template<
class Element>
64template<
class Element>
68 SetMatrixArray(elements,option);
69 if (!this->IsSymmetric()) {
70 Error(
"TMatrixTSym(Int_t,Element*,Option_t*)",
"matrix not symmetric");
77template<
class Element>
82 SetMatrixArray(elements,option);
83 if (!this->IsSymmetric()) {
84 Error(
"TMatrixTSym(Int_t,Int_t,Element*,Option_t*)",
"matrix not symmetric");
90template<
class Element>
103template<
class Element>
133 const Element
oldTol = this->SetTol(std::numeric_limits<Element>::min());
145 Error(
"TMatrixTSym(EMatrixCreatorOp1,const TMatrixTSym)",
146 "operation %d not yet implemented",
op);
152template<
class Element>
164 Error(
"TMatrixTSym(EMatrixCreatorOp1,const TMatrixT)",
165 "operation %d not yet implemented",
op);
171template<
class Element>
180 Allocate(
a.GetNcols(),
a.GetNcols(),
a.GetColLwb(),
a.GetColLwb(),1);
187 Allocate(
a.GetNcols(),
a.GetNcols(),
a.GetColLwb(),
a.GetColLwb(),1);
193 Error(
"TMatrixTSym(EMatrixCreatorOp2)",
"operation %d not yet implemented",
op);
199template<
class Element>
206 if (!this->IsSymmetric()) {
207 Error(
"TMatrixTSym(TMatrixTSymLazy)",
"matrix not symmetric");
214template<
class Element>
218 if (
size > this->kSizeMax)
228template<
class Element>
231 if (
size == 0)
return nullptr;
236 Element *heap =
new Element[
size];
246template<
class Element>
273template<
class Element>
277 this->fIsOwner =
kTRUE;
278 this->fTol = std::numeric_limits<Element>::epsilon();
298 this->fNelems = this->fNrows*this->fNcols;
300 if (this->fNelems > 0) {
301 fElements = New_m(this->fNelems);
303 memset(fElements,0,this->fNelems*
sizeof(Element));
311template<
class Element>
316 Error(
"Plus",
"matrices not compatible");
320 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
321 Error(
"Plus",
"this->GetMatrixArray() == a.GetMatrixArray()");
325 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
326 Error(
"Plus",
"this->GetMatrixArray() == b.GetMatrixArray()");
331 const Element *
ap =
a.GetMatrixArray();
332 const Element *
bp =
b.GetMatrixArray();
333 Element *
cp = this->GetMatrixArray();
334 const Element *
const cp_last =
cp+this->fNelems;
345template<
class Element>
350 Error(
"Minus",
"matrices not compatible");
354 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
355 Error(
"Minus",
"this->GetMatrixArray() == a.GetMatrixArray()");
359 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
360 Error(
"Minus",
"this->GetMatrixArray() == b.GetMatrixArray()");
365 const Element *
ap =
a.GetMatrixArray();
366 const Element *
bp =
b.GetMatrixArray();
367 Element *
cp = this->GetMatrixArray();
368 const Element *
const cp_last =
cp+this->fNelems;
380template<
class Element>
386 const Element *
ap =
a.GetMatrixArray();
387 Element *
cp = this->GetMatrixArray();
388 if (
typeid(Element) ==
typeid(
Double_t))
390 1.0,
ap,
a.GetNcols(),
ap,
a.GetNcols(),1.0,
cp,
this->fNcols);
391 else if (
typeid(Element) !=
typeid(
Float_t))
393 1.0,
ap,
a.GetNcols(),
ap,
a.GetNcols(),1.0,
cp,fNcols);
395 Error(
"TMult",
"type %s not implemented in BLAS library",
typeid(Element));
400 const Element *
const ap =
a.GetMatrixArray();
401 const Element *
const bp =
ap;
402 Element *
cp = this->GetMatrixArray();
405 while (
acp0 <
ap+
a.GetNcols()) {
428template<
class Element>
434 const Element *
ap =
a.GetMatrixArray();
435 Element *
cp = this->GetMatrixArray();
436 if (
typeid(Element) ==
typeid(
Double_t))
439 else if (
typeid(Element) !=
typeid(
Float_t))
441 ap1,
a.GetNcols(),
ap,
a.GetNcols(),0.0,
cp,fNcols);
443 Error(
"TMult",
"type %s not implemented in BLAS library",
typeid(Element));
448 const Element *
const ap =
a.GetMatrixArray();
449 const Element *
const bp =
ap;
450 Element *
cp = this->GetMatrixArray();
453 while (
acp0 <
ap+
a.GetNcols()) {
474template<
class Element>
485 this->fNcols = this->fNrows;
488 this->fNelems = this->fNrows*this->fNcols;
502template<
class Element>
509 Error(
"GetSub",
"row_lwb out of bounds");
513 Error(
"GetSub",
"row_upb out of bounds");
517 Error(
"GetSub",
"row_upb < row_lwb");
539 if (
target.GetRowIndexArray() &&
target.GetColIndexArray()) {
546 const Element *
ap = this->GetMatrixArray()+(
row_lwb-this->fRowLwb)*this->fNrows+(
row_lwb-this->fRowLwb);
547 Element *
bp =
target.GetMatrixArray();
568template<
class Element>
575 Error(
"GetSub",
"row_lwb out of bounds");
579 Error(
"GetSub",
"col_lwb out of bounds");
583 Error(
"GetSub",
"row_upb out of bounds");
587 Error(
"GetSub",
"col_upb out of bounds");
591 Error(
"GetSub",
"row_upb < row_lwb || col_upb < col_lwb");
609 if (
target.GetRowIndexArray() &&
target.GetColIndexArray()) {
616 const Element *
ap = this->GetMatrixArray()+(
row_lwb-this->fRowLwb)*this->fNcols+(
col_lwb-this->fColLwb);
617 Element *
bp =
target.GetMatrixArray();
635template<
class Element>
642 if (!
source.IsSymmetric()) {
643 Error(
"SetSub",
"source matrix is not symmetric");
647 Error(
"SetSub",
"row_lwb outof bounds");
651 Error(
"SetSub",
"source matrix too large");
658 if (
source.GetRowIndexArray() &&
source.GetColIndexArray()) {
666 const Element *
bp =
source.GetMatrixArray();
667 Element *
ap = this->GetMatrixArray()+(
row_lwb-this->fRowLwb)*this->fNrows+(
row_lwb-this->fRowLwb);
685template<
class Element>
693 Error(
"SetSub",
"row_lwb out of bounds");
697 Error(
"SetSub",
"col_lwb out of bounds");
702 Error(
"SetSub",
"source matrix too large");
706 Error(
"SetSub",
"source matrix too large");
742template<
class Element>
746 if (!this->IsSymmetric()) {
747 Error(
"SetMatrixArray",
"Matrix is not symmetric after Set");
755template<
class Element>
759 Error(
"Shift",
"row_shift != col_shift");
770template<
class Element>
774 if (!this->fIsOwner) {
775 Error(
"ResizeTo(Int_t,Int_t)",
"Not owner of data array,cannot resize");
780 Error(
"ResizeTo(Int_t,Int_t)",
"nrows != ncols");
784 if (this->fNelems > 0) {
785 if (this->fNrows ==
nrows && this->fNcols ==
ncols)
804 if (this->fNelems > this->kSizeMax ||
nelems_old > this->kSizeMax)
840template<
class Element>
845 if (!this->fIsOwner) {
846 Error(
"ResizeTo(Int_t,Int_t,Int_t,Int_t)",
"Not owner of data array,cannot resize");
851 Error(
"ResizeTo(Int_t,Int_t,Int_t,Int_t)",
"row_lwb != col_lwb");
855 Error(
"ResizeTo(Int_t,Int_t,Int_t,Int_t)",
"row_upb != col_upb");
862 if (this->fNelems > 0) {
887 if (this->fNelems > this->kSizeMax ||
nelems_old > this->kSizeMax)
934template<
class Element>
946template<
class Element>
960template<
class Element>
967 Element *
p2 = this->GetMatrixArray();
968 for (
Int_t i = 0; i < this->GetNoElements(); i++)
978template<
class Element>
987 Element *
pM = this->GetMatrixArray();
989 Error(
"InvertFast",
"matrix is singular");
999 TMatrixTSymCramerInv::Inv2x2<Element>(*
this,
det);
1004 TMatrixTSymCramerInv::Inv3x3<Element>(*
this,
det);
1009 TMatrixTSymCramerInv::Inv4x4<Element>(*
this,
det);
1014 TMatrixTSymCramerInv::Inv5x5<Element>(*
this,
det);
1019 TMatrixTSymCramerInv::Inv6x6<Element>(*
this,
det);
1028 Element *
p2 = this->GetMatrixArray();
1029 for (
Int_t i = 0; i < this->GetNoElements(); i++)
1040template<
class Element>
1047 if (this->fNrows !=
source.GetNcols() ||
this->fRowLwb !=
source.GetColLwb())
1049 Error(
"Transpose",
"matrix has wrong shape");
1062template<
class Element>
1068 if (
v.GetNoElements() <
this->fNrows) {
1069 Error(
"Rank1Update",
"vector too short");
1074 const Element *
const pv =
v.GetMatrixArray();
1075 Element *
trp = this->GetMatrixArray();
1077 for (
Int_t i = 0; i < this->fNrows; i++) {
1079 tcp += i*this->fNcols;
1080 const Element tmp = alpha*
pv[i];
1081 for (
Int_t j = i;
j < this->fNcols;
j++) {
1084 tcp += this->fNcols;
1086 tcp -= this->fNelems-1;
1098template<
class Element>
1104 if (this->fNcols !=
b.GetNcols() ||
this->fColLwb !=
b.GetColLwb()) {
1105 Error(
"Similarity(const TMatrixT &)",
"matrices incompatible");
1111 const Int_t nb =
b.GetNoElements();
1115 const Element *
const bp =
b.GetMatrixArray();
1117 Element
work[kWorkMax];
1127 if (
nrowsb != this->fNrows)
1131 Element *
cp = this->GetMatrixArray();
1132 if (
typeid(Element) ==
typeid(
Double_t))
1135 else if (
typeid(Element) !=
typeid(
Float_t))
1139 Error(
"Similarity",
"type %s not implemented in BLAS library",
typeid(Element));
1143 const Element *
bi1p =
bp;
1144 Element *
cp = this->GetMatrixArray();
1145 Element *
const cp0 =
cp;
1189template<
class Element>
1195 if (this->fNcols !=
b.GetNcols() ||
this->fColLwb !=
b.GetColLwb()) {
1196 Error(
"Similarity(const TMatrixTSym &)",
"matrices incompatible");
1205 Element
work[kWorkMax];
1208 if (this->fNcols > kWorkMax) {
1210 abtp =
new Element[this->fNcols];
1215 const Element *
bp =
b.GetMatrixArray();
1216 Element *
cp = this->GetMatrixArray();
1217 if (
typeid(Element) ==
typeid(
Double_t))
1220 else if (
typeid(Element) !=
typeid(
Float_t))
1224 Error(
"Similarity",
"type %s not implemented in BLAS library",
typeid(Element));
1230 const Int_t nb =
b.GetNoElements();
1234 const Element *
const bp =
b.GetMatrixArray();
1236 Element
work[kWorkMax];
1248 const Element *
bi1p =
bp;
1249 Element *
cp = this->GetMatrixArray();
1250 Element *
const cp0 =
cp;
1291template<
class Element>
1297 if (this->fNcols !=
v.GetNrows() ||
this->fColLwb !=
v.GetLwb()) {
1298 Error(
"Similarity(const TVectorT &)",
"vector and matrix incompatible");
1303 const Element *
mp = this->GetMatrixArray();
1304 const Element *
vp =
v.GetMatrixArray();
1308 const Element *
const vp_last =
vp+
v.GetNrows();
1316 R__ASSERT(
mp == this->GetMatrixArray()+this->GetNoElements());
1326template<
class Element>
1332 if (this->fNrows !=
b.GetNrows() ||
this->fRowLwb !=
b.GetRowLwb()) {
1333 Error(
"SimilarityT(const TMatrixT &)",
"matrices incompatible");
1341 Element
work[kWorkMax];
1352 if (
ncolsb != this->fNcols)
1356 const Element *
bp =
b.GetMatrixArray();
1357 Element *
cp = this->GetMatrixArray();
1358 if (
typeid(Element) ==
typeid(
Double_t))
1361 else if (
typeid(Element) !=
typeid(
Float_t))
1365 Error(
"similarityT",
"type %s not implemented in BLAS library",
typeid(Element));
1368 const Int_t nb =
b.GetNoElements();
1370 const Element *
const bp =
b.GetMatrixArray();
1371 Element *
cp = this->GetMatrixArray();
1372 Element *
const cp0 =
cp;
1376 const Element *
bcp0 =
bp;
1413template<
class Element>
1417 Error(
"operator=",
"matrices not compatible");
1421 if (this->GetMatrixArray() !=
source.GetMatrixArray()) {
1423 memcpy(this->GetMatrixArray(),
source.fElements,
this->fNelems*
sizeof(Element));
1430template<
class Element>
1437 Error(
"operator=(const TMatrixTSymLazy&)",
"matrix is incompatible with "
1438 "the assigned Lazy matrix");
1449template<
class Element>
1454 Element *
ep = fElements;
1455 const Element *
const ep_last =
ep+this->fNelems;
1465template<
class Element>
1470 Element *
ep = fElements;
1471 const Element *
const ep_last =
ep+this->fNelems;
1481template<
class Element>
1486 Element *
ep = fElements;
1487 const Element *
const ep_last =
ep+this->fNelems;
1497template<
class Element>
1502 Element *
ep = fElements;
1503 const Element *
const ep_last =
ep+this->fNelems;
1513template<
class Element>
1517 Error(
"operator+=",
"matrices not compatible");
1521 const Element *
sp =
source.GetMatrixArray();
1522 Element *
tp = this->GetMatrixArray();
1523 const Element *
const tp_last =
tp+this->fNelems;
1533template<
class Element>
1537 Error(
"operator-=",
"matrices not compatible");
1541 const Element *
sp =
source.GetMatrixArray();
1542 Element *
tp = this->GetMatrixArray();
1543 const Element *
const tp_last =
tp+this->fNelems;
1552template<
class Element>
1558 Element *
trp = this->GetMatrixArray();
1560 for (
Int_t i = 0; i < this->fNrows; i++) {
1562 tcp += i*this->fNcols;
1563 for (
Int_t j = i;
j < this->fNcols;
j++) {
1565 if (
j > i) *
tcp = val;
1567 tcp += this->fNcols;
1569 tcp -= this->fNelems-1;
1579template<
class Element>
1585 Element *
trp = this->GetMatrixArray();
1587 for (
Int_t i = 0; i < this->fNrows; i++) {
1588 action.fI = i+this->fRowLwb;
1590 tcp += i*this->fNcols;
1591 for (
Int_t j = i;
j < this->fNcols;
j++) {
1594 if (
j > i) *
tcp = val;
1596 tcp += this->fNcols;
1598 tcp -= this->fNelems-1;
1607template<
class Element>
1612 if (this->fNrows != this->fNcols || this->fRowLwb != this->fColLwb) {
1613 Error(
"Randomize(Element,Element,Element &",
"matrix should be square");
1618 const Element
scale = beta-alpha;
1619 const Element shift = alpha/
scale;
1621 Element *
ep = GetMatrixArray();
1622 for (
Int_t i = 0; i < this->fNrows; i++) {
1623 const Int_t off = i*this->fNcols;
1627 ep[
j*this->fNcols+i] =
ep[off+
j];
1638template<
class Element>
1643 if (this->fNrows != this->fNcols || this->fRowLwb != this->fColLwb) {
1644 Error(
"RandomizeSym(Element,Element,Element &",
"matrix should be square");
1649 const Element
scale = beta-alpha;
1650 const Element shift = alpha/
scale;
1652 Element *
ep = GetMatrixArray();
1654 for (i = 0; i < this->fNrows; i++) {
1655 const Int_t off = i*this->fNcols;
1660 for (i = this->fNrows-1; i >= 0; i--) {
1661 const Int_t off1 = i*this->fNcols;
1663 const Int_t off2 =
j*this->fNcols;
1664 ep[off1+
j] *=
ep[off2+
j];
1665 for (
Int_t k =
j-1; k >= 0; k--) {
1666 ep[off1+
j] +=
ep[off1+k]*
ep[off2+k];
1669 ep[off2+i] =
ep[off1+
j];
1680template<
class Element>
1687 return eigen.GetEigenVectors();
1693template<
class Element>
1697 return (
memcmp(m1.GetMatrixArray(),m2.GetMatrixArray(),
1698 m1.GetNoElements()*
sizeof(Element)) == 0);
1703template<
class Element>
1713template<
class Element>
1723template<
class Element>
1731template<
class Element>
1741template<
class Element>
1751template<
class Element>
1759template<
class Element>
1769template<
class Element>
1778template<
class Element>
1784 Error(
"operator&&(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1790 const Element *
sp1 =
source1.GetMatrixArray();
1791 const Element *
sp2 =
source2.GetMatrixArray();
1792 Element *
tp =
target.GetMatrixArray();
1795 *
tp++ = (*
sp1++ != 0.0 && *
sp2++ != 0.0);
1803template<
class Element>
1809 Error(
"operator||(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1815 const Element *
sp1 =
source1.GetMatrixArray();
1816 const Element *
sp2 =
source2.GetMatrixArray();
1817 Element *
tp =
target.GetMatrixArray();
1820 *
tp++ = (*
sp1++ != 0.0 || *
sp2++ != 0.0);
1828template<
class Element>
1834 Error(
"operator>(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1840 const Element *
sp1 =
source1.GetMatrixArray();
1841 const Element *
sp2 =
source2.GetMatrixArray();
1842 Element *
tp =
target.GetMatrixArray();
1845 *
tp++ = (*sp1) > (*sp2);
sp1++;
sp2++;
1854template<
class Element>
1860 Error(
"operator>=(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1866 const Element *
sp1 =
source1.GetMatrixArray();
1867 const Element *
sp2 =
source2.GetMatrixArray();
1868 Element *
tp =
target.GetMatrixArray();
1871 *
tp++ = (*sp1) >= (*sp2);
sp1++;
sp2++;
1880template<
class Element>
1886 Error(
"operator<=(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1892 const Element *
sp1 =
source1.GetMatrixArray();
1893 const Element *
sp2 =
source2.GetMatrixArray();
1894 Element *
tp =
target.GetMatrixArray();
1897 *
tp++ = (*sp1) <= (*sp2);
sp1++;
sp2++;
1906template<
class Element>
1912 Error(
"operator<(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1918 const Element *
sp1 =
source1.GetMatrixArray();
1919 const Element *
sp2 =
source2.GetMatrixArray();
1920 Element *
tp =
target.GetMatrixArray();
1923 *
tp++ = (*sp1) < (*sp2);
sp1++;
sp2++;
1932template<
class Element>
1936 ::Error(
"Add",
"matrices not compatible");
1943 const Element *
sp =
source.GetMatrixArray();
1951 const Element tmp =
scalar * *
sp++;
1952 if (
j > i) *
tcp += tmp;
1965template<
class Element>
1969 ::Error(
"ElementMult",
"matrices not compatible");
1976 const Element *
sp =
source.GetMatrixArray();
1997template<
class Element>
2001 ::Error(
"ElementDiv",
"matrices not compatible");
2008 const Element *
sp =
source.GetMatrixArray();
2036template<
class Element>
2039 if (
R__b.IsReading()) {
2044 fElements =
new Element[this->fNelems];
2046 for (i = 0; i < this->fNrows; i++) {
2047 R__b.ReadFastArray(fElements+i*this->fNcols+i,this->fNcols-i);
2050 for (i = 0; i < this->fNrows; i++) {
2052 fElements[i*this->fNcols+
j] = fElements[
j*this->fNrows+i];
2056 memcpy(fDataStack,fElements,this->fNelems*
sizeof(Element));
2057 delete [] fElements;
2058 fElements = fDataStack;
2063 for (
Int_t i = 0; i < this->fNrows; i++) {
2064 R__b.WriteFastArray(fElements+i*this->fNcols+i,this->fNcols-i);
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define templateClassImp(name)
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)
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
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 data
R__EXTERN Int_t gMatrixCheck
template TMatrixFSparse & ElementDiv< Float_t >(TMatrixFSparse &target, const TMatrixFSparse &source)
template TMatrixDSparse & Add< Double_t >(TMatrixDSparse &target, Double_t scalar, const TMatrixDSparse &source)
template TMatrixDSparse & ElementDiv< Double_t >(TMatrixDSparse &target, const TMatrixDSparse &source)
template TMatrixFSparse & ElementMult< Float_t >(TMatrixFSparse &target, const TMatrixFSparse &source)
template TMatrixDSparse & ElementMult< Double_t >(TMatrixDSparse &target, const TMatrixDSparse &source)
template TMatrixFSparse & Add< Float_t >(TMatrixFSparse &target, Float_t scalar, const TMatrixFSparse &source)
template TMatrixFSym operator<=< Float_t >(const TMatrixFSym &source1, const TMatrixFSym &source2)
template TMatrixFSym operator<<Float_t >(const TMatrixFSym &source1, const TMatrixFSym &source2)
template TMatrixDSym operator<<Double_t >(const TMatrixDSym &source1, const TMatrixDSym &source2)
template TMatrixDSym operator<=< Double_t >(const TMatrixDSym &source1, const TMatrixDSym &source2)
Double_t Drand(Double_t &ix)
Random number generator [0....1] with seed ix.
TString operator+(const TString &s1, const TString &s2)
Use the special concatenation constructor.
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 > & Shift(Int_t row_shift, Int_t col_shift)
Shift the row index by adding row_shift and the column index by adding col_shift, respectively.
virtual TMatrixTBase< Element > & SetMatrixArray(const Element *data, Option_t *option="")
Copy array data to matrix .
TMatrixTSym< Element > & operator*=(Element val)
Multiply every element of the matrix with val.
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...
TMatrixTSym< Element > & operator+=(Element val)
Add val to every element of the matrix.
virtual TMatrixTSym< Element > & RandomizePD(Element alpha, Element beta, Double_t &seed)
randomize matrix element values but keep matrix symmetric positive definite
TMatrixTBase< Element > & Randomize(Element alpha, Element beta, Double_t &seed) override
randomize matrix element values but keep matrix symmetric
TMatrixTSym< Element > & Transpose(const TMatrixTSym< Element > &source)
Transpose a matrix.
Element * New_m(Int_t size)
return data pointer .
TMatrixTSym< Element > & Use(Int_t row_lwb, Int_t row_upb, Element *data)
TMatrixTSym< Element > & Rank1Update(const TVectorT< Element > &v, Element alpha=1.0)
Perform a rank 1 operation on the matrix: A += alpha * v * v^T.
void Minus(const TMatrixTSym< Element > &a, const TMatrixTSym< Element > &b)
Symmetric matrix subtraction. Replace this matrix with C such that C = A - B.
void TMult(const TMatrixT< Element > &a)
Replace this matrix with C such that C = A' * A.
void Delete_m(Int_t size, Element *&)
delete data pointer m, if it was assigned on the heap
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.
TMatrixTSym< Element > & GetSub(Int_t row_lwb, Int_t row_upb, TMatrixTSym< Element > &target, Option_t *option="S") const
Get submatrix [row_lwb..row_upb][row_lwb..row_upb]; The indexing range of the returned matrix depends...
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 .
const TMatrixT< Element > EigenVectors(TVectorT< Element > &eigenValues) const
Return a matrix containing the eigen-vectors ordered by descending eigen-values.
TMatrixTSym< Element > & operator-=(Element val)
Subtract val from every element of the matrix.
void Plus(const TMatrixTSym< Element > &a, const TMatrixTSym< Element > &b)
Symmetric matrix summation. Replace this matrix with C such that C = A + B.
TMatrixTSym< Element > & InvertFast(Double_t *det=nullptr)
Invert the matrix and calculate its determinant.
TMatrixTSym< Element > & SimilarityT(const TMatrixT< Element > &n)
Calculate B^T * (*this) * B , final matrix will be (ncolsb x ncolsb) It is more efficient than applyi...
TMatrixTSym< Element > & Similarity(const TMatrixT< Element > &n)
Calculate B * (*this) * B^T , final matrix will be (nrowsb x nrowsb) This is a similarity transform w...
TMatrixTSym< Element > & operator=(const TMatrixTSym< Element > &source)
TMatrixTSym< Element > & SetSub(Int_t row_lwb, const TMatrixTBase< Element > &source)
Insert matrix source starting at [row_lwb][row_lwb], thereby overwriting the part [row_lwb....
TMatrixTBase< Element > & SetMatrixArray(const Element *data, Option_t *option="") override
Copy array data to matrix .
TMatrixTBase< Element > & Shift(Int_t row_shift, Int_t col_shift) override
Shift the row index by adding row_shift and the column index by adding col_shift, respectively.
TMatrixTBase< Element > & Apply(const TElementActionT< Element > &action) override
Apply action to each matrix element.
Double_t Determinant() const override
TMatrixTSym< Element > & Invert(Double_t *det=nullptr)
Invert the matrix and calculate its determinant Notice that the LU decomposition is used instead of B...
void Streamer(TBuffer &) override
Stream an object of class TMatrixTSym.
TObject & operator=(const TObject &rhs)
TObject assignment operator.
void ToUpper()
Change string to upper case.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
bool operator==(const RConcurrentHashColl::HashValue &lhs, const RConcurrentHashColl::HashValue &rhs)
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.
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 > & 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 > & 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.
TMatrixT< Element > operator&&(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
Logical AND.
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 .