40template<
class Element>
48template<
class Element>
64template<
class Element>
68 SetMatrixArray(elements,
option);
74template<
class Element>
79 SetMatrixArray(elements,option);
84template<
class Element>
97template<
class Element>
127 const Element
oldTol = this->SetTol(std::numeric_limits<Element>::min());
139 Error(
"TMatrixTSym(EMatrixCreatorOp1,const TMatrixTSym)",
140 "operation %d not yet implemented",
op);
146template<
class Element>
158 Error(
"TMatrixTSym(EMatrixCreatorOp1,const TMatrixT)",
159 "operation %d not yet implemented",
op);
165template<
class Element>
174 Allocate(
a.GetNcols(),
a.GetNcols(),
a.GetColLwb(),
a.GetColLwb(),1);
181 Allocate(
a.GetNcols(),
a.GetNcols(),
a.GetColLwb(),
a.GetColLwb(),1);
187 Error(
"TMatrixTSym(EMatrixCreatorOp2)",
"operation %d not yet implemented",
op);
193template<
class Element>
201 Error(
"TMatrixTSym(TMatrixTSymLazy)",
"matrix not symmetric");
208template<
class Element>
212 if (
size > this->kSizeMax)
222template<
class Element>
225 if (
size == 0)
return nullptr;
240template<
class Element>
267template<
class Element>
271 this->fIsOwner =
kTRUE;
272 this->fTol = std::numeric_limits<Element>::epsilon();
292 this->fNelems = this->fNrows*this->fNcols;
294 if (this->fNelems > 0) {
295 fElements = New_m(this->fNelems);
297 memset(fElements,0,this->fNelems*
sizeof(Element));
305template<
class Element>
310 Error(
"Plus",
"matrices not compatible");
314 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
315 Error(
"Plus",
"this->GetMatrixArray() == a.GetMatrixArray()");
319 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
320 Error(
"Plus",
"this->GetMatrixArray() == b.GetMatrixArray()");
325 const Element *
ap =
a.GetMatrixArray();
326 const Element *
bp =
b.GetMatrixArray();
327 Element *
cp = this->GetMatrixArray();
328 const Element *
const cp_last =
cp+this->fNelems;
339template<
class Element>
344 Error(
"Minus",
"matrices not compatible");
348 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
349 Error(
"Minus",
"this->GetMatrixArray() == a.GetMatrixArray()");
353 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
354 Error(
"Minus",
"this->GetMatrixArray() == b.GetMatrixArray()");
359 const Element *
ap =
a.GetMatrixArray();
360 const Element *
bp =
b.GetMatrixArray();
361 Element *
cp = this->GetMatrixArray();
362 const Element *
const cp_last =
cp+this->fNelems;
374template<
class Element>
380 const Element *
ap =
a.GetMatrixArray();
381 Element *
cp = this->GetMatrixArray();
382 if (
typeid(Element) ==
typeid(
Double_t))
384 1.0,
ap,
a.GetNcols(),
ap,
a.GetNcols(),1.0,
cp,
this->fNcols);
385 else if (
typeid(Element) !=
typeid(
Float_t))
387 1.0,
ap,
a.GetNcols(),
ap,
a.GetNcols(),1.0,
cp,fNcols);
389 Error(
"TMult",
"type %s not implemented in BLAS library",
typeid(Element));
394 const Element *
const ap =
a.GetMatrixArray();
395 const Element *
const bp =
ap;
396 Element *
cp = this->GetMatrixArray();
399 while (
acp0 <
ap+
a.GetNcols()) {
422template<
class Element>
428 const Element *
ap =
a.GetMatrixArray();
429 Element *
cp = this->GetMatrixArray();
430 if (
typeid(Element) ==
typeid(
Double_t))
433 else if (
typeid(Element) !=
typeid(
Float_t))
435 ap1,
a.GetNcols(),
ap,
a.GetNcols(),0.0,
cp,fNcols);
437 Error(
"TMult",
"type %s not implemented in BLAS library",
typeid(Element));
442 const Element *
const ap =
a.GetMatrixArray();
443 const Element *
const bp =
ap;
444 Element *
cp = this->GetMatrixArray();
447 while (
acp0 <
ap+
a.GetNcols()) {
468template<
class Element>
479 this->fNcols = this->fNrows;
482 this->fNelems = this->fNrows*this->fNcols;
496template<
class Element>
503 Error(
"GetSub",
"row_lwb out of bounds");
507 Error(
"GetSub",
"row_upb out of bounds");
511 Error(
"GetSub",
"row_upb < row_lwb");
533 if (
target.GetRowIndexArray() &&
target.GetColIndexArray()) {
540 const Element *
ap = this->GetMatrixArray()+(
row_lwb-this->fRowLwb)*this->fNrows+(
row_lwb-this->fRowLwb);
541 Element *
bp =
target.GetMatrixArray();
562template<
class Element>
569 Error(
"GetSub",
"row_lwb out of bounds");
573 Error(
"GetSub",
"col_lwb out of bounds");
577 Error(
"GetSub",
"row_upb out of bounds");
581 Error(
"GetSub",
"col_upb out of bounds");
585 Error(
"GetSub",
"row_upb < row_lwb || col_upb < col_lwb");
603 if (
target.GetRowIndexArray() &&
target.GetColIndexArray()) {
610 const Element *
ap = this->GetMatrixArray()+(
row_lwb-this->fRowLwb)*this->fNcols+(
col_lwb-this->fColLwb);
611 Element *
bp =
target.GetMatrixArray();
629template<
class Element>
636 if (!
source.IsSymmetric()) {
637 Error(
"SetSub",
"source matrix is not symmetric");
641 Error(
"SetSub",
"row_lwb outof bounds");
645 Error(
"SetSub",
"source matrix too large");
652 if (
source.GetRowIndexArray() &&
source.GetColIndexArray()) {
660 const Element *
bp =
source.GetMatrixArray();
661 Element *
ap = this->GetMatrixArray()+(
row_lwb-this->fRowLwb)*this->fNrows+(
row_lwb-this->fRowLwb);
679template<
class Element>
687 Error(
"SetSub",
"row_lwb out of bounds");
691 Error(
"SetSub",
"col_lwb out of bounds");
696 Error(
"SetSub",
"source matrix too large");
700 Error(
"SetSub",
"source matrix too large");
736template<
class Element>
741 Error(
"SetMatrixArray",
"Matrix is not symmetric after Set");
749template<
class Element>
753 Error(
"Shift",
"row_shift != col_shift");
764template<
class Element>
768 if (!this->fIsOwner) {
769 Error(
"ResizeTo(Int_t,Int_t)",
"Not owner of data array,cannot resize");
774 Error(
"ResizeTo(Int_t,Int_t)",
"nrows != ncols");
778 if (this->fNelems > 0) {
779 if (this->fNrows ==
nrows && this->fNcols ==
ncols)
798 if (this->fNelems > this->kSizeMax ||
nelems_old > this->kSizeMax)
834template<
class Element>
839 if (!this->fIsOwner) {
840 Error(
"ResizeTo(Int_t,Int_t,Int_t,Int_t)",
"Not owner of data array,cannot resize");
845 Error(
"ResizeTo(Int_t,Int_t,Int_t,Int_t)",
"row_lwb != col_lwb");
849 Error(
"ResizeTo(Int_t,Int_t,Int_t,Int_t)",
"row_upb != col_upb");
856 if (this->fNelems > 0) {
881 if (this->fNelems > this->kSizeMax ||
nelems_old > this->kSizeMax)
928template<
class Element>
940template<
class Element>
954template<
class Element>
961 Element *
p2 = this->GetMatrixArray();
962 for (
Int_t i = 0; i < this->GetNoElements(); i++)
972template<
class Element>
981 Element *
pM = this->GetMatrixArray();
983 Error(
"InvertFast",
"matrix is singular");
993 TMatrixTSymCramerInv::Inv2x2<Element>(*
this,
det);
998 TMatrixTSymCramerInv::Inv3x3<Element>(*
this,
det);
1003 TMatrixTSymCramerInv::Inv4x4<Element>(*
this,
det);
1008 TMatrixTSymCramerInv::Inv5x5<Element>(*
this,
det);
1013 TMatrixTSymCramerInv::Inv6x6<Element>(*
this,
det);
1022 Element *
p2 = this->GetMatrixArray();
1023 for (
Int_t i = 0; i < this->GetNoElements(); i++)
1034template<
class Element>
1041 if (this->fNrows !=
source.GetNcols() ||
this->fRowLwb !=
source.GetColLwb())
1043 Error(
"Transpose",
"matrix has wrong shape");
1056template<
class Element>
1062 if (
v.GetNoElements() <
this->fNrows) {
1063 Error(
"Rank1Update",
"vector too short");
1068 const Element *
const pv =
v.GetMatrixArray();
1069 Element *
trp = this->GetMatrixArray();
1071 for (
Int_t i = 0; i < this->fNrows; i++) {
1073 tcp += i*this->fNcols;
1074 const Element tmp = alpha*
pv[i];
1075 for (
Int_t j = i;
j < this->fNcols;
j++) {
1078 tcp += this->fNcols;
1080 tcp -= this->fNelems-1;
1092template<
class Element>
1098 if (this->fNcols !=
b.GetNcols() ||
this->fColLwb !=
b.GetColLwb()) {
1099 Error(
"Similarity(const TMatrixT &)",
"matrices incompatible");
1105 const Int_t nb =
b.GetNoElements();
1109 const Element *
const bp =
b.GetMatrixArray();
1111 Element
work[kWorkMax];
1121 if (
nrowsb != this->fNrows)
1125 Element *
cp = this->GetMatrixArray();
1126 if (
typeid(Element) ==
typeid(
Double_t))
1129 else if (
typeid(Element) !=
typeid(
Float_t))
1133 Error(
"Similarity",
"type %s not implemented in BLAS library",
typeid(Element));
1137 const Element *
bi1p =
bp;
1138 Element *
cp = this->GetMatrixArray();
1139 Element *
const cp0 =
cp;
1183template<
class Element>
1189 if (this->fNcols !=
b.GetNcols() ||
this->fColLwb !=
b.GetColLwb()) {
1190 Error(
"Similarity(const TMatrixTSym &)",
"matrices incompatible");
1199 Element
work[kWorkMax];
1202 if (this->fNcols > kWorkMax) {
1204 abtp =
new Element[this->fNcols];
1209 const Element *
bp =
b.GetMatrixArray();
1210 Element *
cp = this->GetMatrixArray();
1211 if (
typeid(Element) ==
typeid(
Double_t))
1214 else if (
typeid(Element) !=
typeid(
Float_t))
1218 Error(
"Similarity",
"type %s not implemented in BLAS library",
typeid(Element));
1224 const Int_t nb =
b.GetNoElements();
1228 const Element *
const bp =
b.GetMatrixArray();
1230 Element
work[kWorkMax];
1242 const Element *
bi1p =
bp;
1243 Element *
cp = this->GetMatrixArray();
1244 Element *
const cp0 =
cp;
1285template<
class Element>
1291 if (this->fNcols !=
v.GetNrows() ||
this->fColLwb !=
v.GetLwb()) {
1292 Error(
"Similarity(const TVectorT &)",
"vector and matrix incompatible");
1297 const Element *
mp = this->GetMatrixArray();
1298 const Element *
vp =
v.GetMatrixArray();
1302 const Element *
const vp_last =
vp+
v.GetNrows();
1310 R__ASSERT(
mp == this->GetMatrixArray()+this->GetNoElements());
1320template<
class Element>
1326 if (this->fNrows !=
b.GetNrows() ||
this->fRowLwb !=
b.GetRowLwb()) {
1327 Error(
"SimilarityT(const TMatrixT &)",
"matrices incompatible");
1335 Element
work[kWorkMax];
1346 if (
ncolsb != this->fNcols)
1350 const Element *
bp =
b.GetMatrixArray();
1351 Element *
cp = this->GetMatrixArray();
1352 if (
typeid(Element) ==
typeid(
Double_t))
1355 else if (
typeid(Element) !=
typeid(
Float_t))
1359 Error(
"similarityT",
"type %s not implemented in BLAS library",
typeid(Element));
1362 const Int_t nb =
b.GetNoElements();
1364 const Element *
const bp =
b.GetMatrixArray();
1365 Element *
cp = this->GetMatrixArray();
1366 Element *
const cp0 =
cp;
1370 const Element *
bcp0 =
bp;
1407template<
class Element>
1411 Error(
"operator=",
"matrices not compatible");
1415 if (this->GetMatrixArray() !=
source.GetMatrixArray()) {
1417 memcpy(this->GetMatrixArray(),
source.fElements,
this->fNelems*
sizeof(Element));
1424template<
class Element>
1431 Error(
"operator=(const TMatrixTSymLazy&)",
"matrix is incompatible with "
1432 "the assigned Lazy matrix");
1443template<
class Element>
1448 Element *
ep = fElements;
1449 const Element *
const ep_last =
ep+this->fNelems;
1459template<
class Element>
1464 Element *
ep = fElements;
1465 const Element *
const ep_last =
ep+this->fNelems;
1475template<
class Element>
1480 Element *
ep = fElements;
1481 const Element *
const ep_last =
ep+this->fNelems;
1491template<
class Element>
1496 Element *
ep = fElements;
1497 const Element *
const ep_last =
ep+this->fNelems;
1507template<
class Element>
1511 Error(
"operator+=",
"matrices not compatible");
1515 const Element *
sp =
source.GetMatrixArray();
1516 Element *
tp = this->GetMatrixArray();
1517 const Element *
const tp_last =
tp+this->fNelems;
1527template<
class Element>
1531 Error(
"operator-=",
"matrices not compatible");
1535 const Element *
sp =
source.GetMatrixArray();
1536 Element *
tp = this->GetMatrixArray();
1537 const Element *
const tp_last =
tp+this->fNelems;
1546template<
class Element>
1552 Element *
trp = this->GetMatrixArray();
1554 for (
Int_t i = 0; i < this->fNrows; i++) {
1556 tcp += i*this->fNcols;
1557 for (
Int_t j = i;
j < this->fNcols;
j++) {
1559 if (
j > i) *
tcp = val;
1561 tcp += this->fNcols;
1563 tcp -= this->fNelems-1;
1573template<
class Element>
1579 Element *
trp = this->GetMatrixArray();
1581 for (
Int_t i = 0; i < this->fNrows; i++) {
1582 action.fI = i+this->fRowLwb;
1584 tcp += i*this->fNcols;
1585 for (
Int_t j = i;
j < this->fNcols;
j++) {
1588 if (
j > i) *
tcp = val;
1590 tcp += this->fNcols;
1592 tcp -= this->fNelems-1;
1601template<
class Element>
1606 if (this->fNrows != this->fNcols || this->fRowLwb != this->fColLwb) {
1607 Error(
"Randomize(Element,Element,Element &",
"matrix should be square");
1612 const Element
scale = beta-alpha;
1613 const Element shift = alpha/
scale;
1615 Element *
ep = GetMatrixArray();
1616 for (
Int_t i = 0; i < this->fNrows; i++) {
1617 const Int_t off = i*this->fNcols;
1621 ep[
j*this->fNcols+i] =
ep[off+
j];
1632template<
class Element>
1637 if (this->fNrows != this->fNcols || this->fRowLwb != this->fColLwb) {
1638 Error(
"RandomizeSym(Element,Element,Element &",
"matrix should be square");
1643 const Element
scale = beta-alpha;
1644 const Element shift = alpha/
scale;
1646 Element *
ep = GetMatrixArray();
1648 for (i = 0; i < this->fNrows; i++) {
1649 const Int_t off = i*this->fNcols;
1654 for (i = this->fNrows-1; i >= 0; i--) {
1655 const Int_t off1 = i*this->fNcols;
1657 const Int_t off2 =
j*this->fNcols;
1658 ep[off1+
j] *=
ep[off2+
j];
1659 for (
Int_t k =
j-1; k >= 0; k--) {
1660 ep[off1+
j] +=
ep[off1+k]*
ep[off2+k];
1663 ep[off2+i] =
ep[off1+
j];
1674template<
class Element>
1681 return eigen.GetEigenVectors();
1687template<
class Element>
1691 return (
memcmp(m1.GetMatrixArray(),m2.GetMatrixArray(),
1692 m1.GetNoElements()*
sizeof(Element)) == 0);
1697template<
class Element>
1707template<
class Element>
1717template<
class Element>
1725template<
class Element>
1735template<
class Element>
1745template<
class Element>
1753template<
class Element>
1763template<
class Element>
1772template<
class Element>
1778 Error(
"operator&&(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1784 const Element *
sp1 =
source1.GetMatrixArray();
1785 const Element *
sp2 =
source2.GetMatrixArray();
1786 Element *
tp =
target.GetMatrixArray();
1789 *
tp++ = (*
sp1++ != 0.0 && *
sp2++ != 0.0);
1797template<
class Element>
1803 Error(
"operator||(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1809 const Element *
sp1 =
source1.GetMatrixArray();
1810 const Element *
sp2 =
source2.GetMatrixArray();
1811 Element *
tp =
target.GetMatrixArray();
1814 *
tp++ = (*
sp1++ != 0.0 || *
sp2++ != 0.0);
1822template<
class Element>
1828 Error(
"operator>(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1834 const Element *
sp1 =
source1.GetMatrixArray();
1835 const Element *
sp2 =
source2.GetMatrixArray();
1836 Element *
tp =
target.GetMatrixArray();
1839 *
tp++ = (*sp1) > (*sp2);
sp1++;
sp2++;
1848template<
class Element>
1854 Error(
"operator>=(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1860 const Element *
sp1 =
source1.GetMatrixArray();
1861 const Element *
sp2 =
source2.GetMatrixArray();
1862 Element *
tp =
target.GetMatrixArray();
1865 *
tp++ = (*sp1) >= (*sp2);
sp1++;
sp2++;
1874template<
class Element>
1880 Error(
"operator<=(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1886 const Element *
sp1 =
source1.GetMatrixArray();
1887 const Element *
sp2 =
source2.GetMatrixArray();
1888 Element *
tp =
target.GetMatrixArray();
1891 *
tp++ = (*sp1) <= (*sp2);
sp1++;
sp2++;
1900template<
class Element>
1906 Error(
"operator<(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1912 const Element *
sp1 =
source1.GetMatrixArray();
1913 const Element *
sp2 =
source2.GetMatrixArray();
1914 Element *
tp =
target.GetMatrixArray();
1917 *
tp++ = (*sp1) < (*sp2);
sp1++;
sp2++;
1926template<
class Element>
1930 ::Error(
"Add",
"matrices not compatible");
1937 const Element *
sp =
source.GetMatrixArray();
1945 const Element tmp =
scalar * *
sp++;
1946 if (
j > i) *
tcp += tmp;
1959template<
class Element>
1963 ::Error(
"ElementMult",
"matrices not compatible");
1970 const Element *
sp =
source.GetMatrixArray();
1991template<
class Element>
1995 ::Error(
"ElementDiv",
"matrices not compatible");
2002 const Element *
sp =
source.GetMatrixArray();
2030template<
class Element>
2033 if (
R__b.IsReading()) {
2038 fElements =
new Element[this->fNelems];
2040 for (i = 0; i < this->fNrows; i++) {
2041 R__b.ReadFastArray(fElements+i*this->fNcols+i,this->fNcols-i);
2044 for (i = 0; i < this->fNrows; i++) {
2046 fElements[i*this->fNcols+
j] = fElements[
j*this->fNrows+i];
2050 memcpy(fDataStack,fElements,this->fNelems*
sizeof(Element));
2051 delete [] fElements;
2052 fElements = fDataStack;
2057 for (
Int_t i = 0; i < this->fNrows; i++) {
2058 R__b.WriteFastArray(fElements+i*this->fNcols+i,this->fNcols-i);
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
bool Bool_t
Boolean (0=false, 1=true) (bool)
int Int_t
Signed integer 4 bytes (int)
short Version_t
Class version identifier (short)
char Char_t
Character 1 byte (char)
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char)
#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)
#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.
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
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.
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) noexcept
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)
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.
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 .