39template<
class Element>
47template<
class Element>
63template<
class Element>
67 SetMatrixArray(elements,
option);
73template<
class Element>
78 SetMatrixArray(elements,option);
83template<
class Element>
96template<
class Element>
126 const Element
oldTol = this->SetTol(std::numeric_limits<Element>::min());
138 Error(
"TMatrixTSym(EMatrixCreatorOp1,const TMatrixTSym)",
139 "operation %d not yet implemented",
op);
145template<
class Element>
157 Error(
"TMatrixTSym(EMatrixCreatorOp1,const TMatrixT)",
158 "operation %d not yet implemented",
op);
164template<
class Element>
173 Allocate(
a.GetNcols(),
a.GetNcols(),
a.GetColLwb(),
a.GetColLwb(),1);
180 Allocate(
a.GetNcols(),
a.GetNcols(),
a.GetColLwb(),
a.GetColLwb(),1);
186 Error(
"TMatrixTSym(EMatrixCreatorOp2)",
"operation %d not yet implemented",
op);
192template<
class Element>
200 Error(
"TMatrixTSym(TMatrixTSymLazy)",
"matrix not symmetric");
207template<
class Element>
211 if (
size > this->kSizeMax)
221template<
class Element>
224 if (
size == 0)
return nullptr;
239template<
class Element>
266template<
class Element>
270 this->fIsOwner =
kTRUE;
271 this->fTol = std::numeric_limits<Element>::epsilon();
291 this->fNelems = this->fNrows*this->fNcols;
293 if (this->fNelems > 0) {
294 fElements = New_m(this->fNelems);
296 memset(fElements,0,this->fNelems*
sizeof(Element));
304template<
class Element>
309 Error(
"Plus",
"matrices not compatible");
313 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
314 Error(
"Plus",
"this->GetMatrixArray() == a.GetMatrixArray()");
318 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
319 Error(
"Plus",
"this->GetMatrixArray() == b.GetMatrixArray()");
324 const Element *
ap =
a.GetMatrixArray();
325 const Element *
bp =
b.GetMatrixArray();
326 Element *
cp = this->GetMatrixArray();
327 const Element *
const cp_last =
cp+this->fNelems;
338template<
class Element>
343 Error(
"Minus",
"matrices not compatible");
347 if (this->GetMatrixArray() ==
a.GetMatrixArray()) {
348 Error(
"Minus",
"this->GetMatrixArray() == a.GetMatrixArray()");
352 if (this->GetMatrixArray() ==
b.GetMatrixArray()) {
353 Error(
"Minus",
"this->GetMatrixArray() == b.GetMatrixArray()");
358 const Element *
ap =
a.GetMatrixArray();
359 const Element *
bp =
b.GetMatrixArray();
360 Element *
cp = this->GetMatrixArray();
361 const Element *
const cp_last =
cp+this->fNelems;
373template<
class Element>
379 const Element *
ap =
a.GetMatrixArray();
380 Element *
cp = this->GetMatrixArray();
381 if (
typeid(Element) ==
typeid(
Double_t))
383 1.0,
ap,
a.GetNcols(),
ap,
a.GetNcols(),1.0,
cp,
this->fNcols);
384 else if (
typeid(Element) !=
typeid(
Float_t))
386 1.0,
ap,
a.GetNcols(),
ap,
a.GetNcols(),1.0,
cp,fNcols);
388 Error(
"TMult",
"type %s not implemented in BLAS library",
typeid(Element));
393 const Element *
const ap =
a.GetMatrixArray();
394 const Element *
const bp =
ap;
395 Element *
cp = this->GetMatrixArray();
398 while (
acp0 <
ap+
a.GetNcols()) {
421template<
class Element>
427 const Element *
ap =
a.GetMatrixArray();
428 Element *
cp = this->GetMatrixArray();
429 if (
typeid(Element) ==
typeid(
Double_t))
432 else if (
typeid(Element) !=
typeid(
Float_t))
434 ap1,
a.GetNcols(),
ap,
a.GetNcols(),0.0,
cp,fNcols);
436 Error(
"TMult",
"type %s not implemented in BLAS library",
typeid(Element));
441 const Element *
const ap =
a.GetMatrixArray();
442 const Element *
const bp =
ap;
443 Element *
cp = this->GetMatrixArray();
446 while (
acp0 <
ap+
a.GetNcols()) {
467template<
class Element>
478 this->fNcols = this->fNrows;
481 this->fNelems = this->fNrows*this->fNcols;
495template<
class Element>
502 Error(
"GetSub",
"row_lwb out of bounds");
506 Error(
"GetSub",
"row_upb out of bounds");
510 Error(
"GetSub",
"row_upb < row_lwb");
532 if (
target.GetRowIndexArray() &&
target.GetColIndexArray()) {
539 const Element *
ap = this->GetMatrixArray()+(
row_lwb-this->fRowLwb)*this->fNrows+(
row_lwb-this->fRowLwb);
540 Element *
bp =
target.GetMatrixArray();
561template<
class Element>
568 Error(
"GetSub",
"row_lwb out of bounds");
572 Error(
"GetSub",
"col_lwb out of bounds");
576 Error(
"GetSub",
"row_upb out of bounds");
580 Error(
"GetSub",
"col_upb out of bounds");
584 Error(
"GetSub",
"row_upb < row_lwb || col_upb < col_lwb");
602 if (
target.GetRowIndexArray() &&
target.GetColIndexArray()) {
609 const Element *
ap = this->GetMatrixArray()+(
row_lwb-this->fRowLwb)*this->fNcols+(
col_lwb-this->fColLwb);
610 Element *
bp =
target.GetMatrixArray();
628template<
class Element>
635 if (!
source.IsSymmetric()) {
636 Error(
"SetSub",
"source matrix is not symmetric");
640 Error(
"SetSub",
"row_lwb outof bounds");
644 Error(
"SetSub",
"source matrix too large");
651 if (
source.GetRowIndexArray() &&
source.GetColIndexArray()) {
659 const Element *
bp =
source.GetMatrixArray();
660 Element *
ap = this->GetMatrixArray()+(
row_lwb-this->fRowLwb)*this->fNrows+(
row_lwb-this->fRowLwb);
678template<
class Element>
686 Error(
"SetSub",
"row_lwb out of bounds");
690 Error(
"SetSub",
"col_lwb out of bounds");
695 Error(
"SetSub",
"source matrix too large");
699 Error(
"SetSub",
"source matrix too large");
735template<
class Element>
740 Error(
"SetMatrixArray",
"Matrix is not symmetric after Set");
748template<
class Element>
752 Error(
"Shift",
"row_shift != col_shift");
763template<
class Element>
767 if (!this->fIsOwner) {
768 Error(
"ResizeTo(Int_t,Int_t)",
"Not owner of data array,cannot resize");
773 Error(
"ResizeTo(Int_t,Int_t)",
"nrows != ncols");
777 if (this->fNelems > 0) {
778 if (this->fNrows ==
nrows && this->fNcols ==
ncols)
797 if (this->fNelems > this->kSizeMax ||
nelems_old > this->kSizeMax)
833template<
class Element>
838 if (!this->fIsOwner) {
839 Error(
"ResizeTo(Int_t,Int_t,Int_t,Int_t)",
"Not owner of data array,cannot resize");
844 Error(
"ResizeTo(Int_t,Int_t,Int_t,Int_t)",
"row_lwb != col_lwb");
848 Error(
"ResizeTo(Int_t,Int_t,Int_t,Int_t)",
"row_upb != col_upb");
855 if (this->fNelems > 0) {
880 if (this->fNelems > this->kSizeMax ||
nelems_old > this->kSizeMax)
927template<
class Element>
939template<
class Element>
953template<
class Element>
960 Element *
p2 = this->GetMatrixArray();
961 for (
Int_t i = 0; i < this->GetNoElements(); i++)
971template<
class Element>
980 Element *
pM = this->GetMatrixArray();
982 Error(
"InvertFast",
"matrix is singular");
992 TMatrixTSymCramerInv::Inv2x2<Element>(*
this,
det);
997 TMatrixTSymCramerInv::Inv3x3<Element>(*
this,
det);
1002 TMatrixTSymCramerInv::Inv4x4<Element>(*
this,
det);
1007 TMatrixTSymCramerInv::Inv5x5<Element>(*
this,
det);
1012 TMatrixTSymCramerInv::Inv6x6<Element>(*
this,
det);
1021 Element *
p2 = this->GetMatrixArray();
1022 for (
Int_t i = 0; i < this->GetNoElements(); i++)
1033template<
class Element>
1040 if (this->fNrows !=
source.GetNcols() ||
this->fRowLwb !=
source.GetColLwb())
1042 Error(
"Transpose",
"matrix has wrong shape");
1055template<
class Element>
1061 if (
v.GetNoElements() <
this->fNrows) {
1062 Error(
"Rank1Update",
"vector too short");
1067 const Element *
const pv =
v.GetMatrixArray();
1068 Element *
trp = this->GetMatrixArray();
1070 for (
Int_t i = 0; i < this->fNrows; i++) {
1072 tcp += i*this->fNcols;
1073 const Element tmp = alpha*
pv[i];
1074 for (
Int_t j = i;
j < this->fNcols;
j++) {
1077 tcp += this->fNcols;
1079 tcp -= this->fNelems-1;
1091template<
class Element>
1097 if (this->fNcols !=
b.GetNcols() ||
this->fColLwb !=
b.GetColLwb()) {
1098 Error(
"Similarity(const TMatrixT &)",
"matrices incompatible");
1104 const Int_t nb =
b.GetNoElements();
1108 const Element *
const bp =
b.GetMatrixArray();
1110 Element
work[kWorkMax];
1120 if (
nrowsb != this->fNrows)
1124 Element *
cp = this->GetMatrixArray();
1125 if (
typeid(Element) ==
typeid(
Double_t))
1128 else if (
typeid(Element) !=
typeid(
Float_t))
1132 Error(
"Similarity",
"type %s not implemented in BLAS library",
typeid(Element));
1136 const Element *
bi1p =
bp;
1137 Element *
cp = this->GetMatrixArray();
1138 Element *
const cp0 =
cp;
1182template<
class Element>
1188 if (this->fNcols !=
b.GetNcols() ||
this->fColLwb !=
b.GetColLwb()) {
1189 Error(
"Similarity(const TMatrixTSym &)",
"matrices incompatible");
1198 Element
work[kWorkMax];
1201 if (this->fNcols > kWorkMax) {
1203 abtp =
new Element[this->fNcols];
1208 const Element *
bp =
b.GetMatrixArray();
1209 Element *
cp = this->GetMatrixArray();
1210 if (
typeid(Element) ==
typeid(
Double_t))
1213 else if (
typeid(Element) !=
typeid(
Float_t))
1217 Error(
"Similarity",
"type %s not implemented in BLAS library",
typeid(Element));
1223 const Int_t nb =
b.GetNoElements();
1227 const Element *
const bp =
b.GetMatrixArray();
1229 Element
work[kWorkMax];
1241 const Element *
bi1p =
bp;
1242 Element *
cp = this->GetMatrixArray();
1243 Element *
const cp0 =
cp;
1284template<
class Element>
1290 if (this->fNcols !=
v.GetNrows() ||
this->fColLwb !=
v.GetLwb()) {
1291 Error(
"Similarity(const TVectorT &)",
"vector and matrix incompatible");
1296 const Element *
mp = this->GetMatrixArray();
1297 const Element *
vp =
v.GetMatrixArray();
1301 const Element *
const vp_last =
vp+
v.GetNrows();
1309 R__ASSERT(
mp == this->GetMatrixArray()+this->GetNoElements());
1319template<
class Element>
1325 if (this->fNrows !=
b.GetNrows() ||
this->fRowLwb !=
b.GetRowLwb()) {
1326 Error(
"SimilarityT(const TMatrixT &)",
"matrices incompatible");
1334 Element
work[kWorkMax];
1345 if (
ncolsb != this->fNcols)
1349 const Element *
bp =
b.GetMatrixArray();
1350 Element *
cp = this->GetMatrixArray();
1351 if (
typeid(Element) ==
typeid(
Double_t))
1354 else if (
typeid(Element) !=
typeid(
Float_t))
1358 Error(
"similarityT",
"type %s not implemented in BLAS library",
typeid(Element));
1361 const Int_t nb =
b.GetNoElements();
1363 const Element *
const bp =
b.GetMatrixArray();
1364 Element *
cp = this->GetMatrixArray();
1365 Element *
const cp0 =
cp;
1369 const Element *
bcp0 =
bp;
1406template<
class Element>
1410 Error(
"operator=",
"matrices not compatible");
1414 if (this->GetMatrixArray() !=
source.GetMatrixArray()) {
1416 memcpy(this->GetMatrixArray(),
source.fElements,
this->fNelems*
sizeof(Element));
1423template<
class Element>
1430 Error(
"operator=(const TMatrixTSymLazy&)",
"matrix is incompatible with "
1431 "the assigned Lazy matrix");
1442template<
class Element>
1447 Element *
ep = fElements;
1448 const Element *
const ep_last =
ep+this->fNelems;
1458template<
class Element>
1463 Element *
ep = fElements;
1464 const Element *
const ep_last =
ep+this->fNelems;
1474template<
class Element>
1479 Element *
ep = fElements;
1480 const Element *
const ep_last =
ep+this->fNelems;
1490template<
class Element>
1495 Element *
ep = fElements;
1496 const Element *
const ep_last =
ep+this->fNelems;
1506template<
class Element>
1510 Error(
"operator+=",
"matrices not compatible");
1514 const Element *
sp =
source.GetMatrixArray();
1515 Element *
tp = this->GetMatrixArray();
1516 const Element *
const tp_last =
tp+this->fNelems;
1526template<
class Element>
1530 Error(
"operator-=",
"matrices not compatible");
1534 const Element *
sp =
source.GetMatrixArray();
1535 Element *
tp = this->GetMatrixArray();
1536 const Element *
const tp_last =
tp+this->fNelems;
1545template<
class Element>
1551 Element *
trp = this->GetMatrixArray();
1553 for (
Int_t i = 0; i < this->fNrows; i++) {
1555 tcp += i*this->fNcols;
1556 for (
Int_t j = i;
j < this->fNcols;
j++) {
1558 if (
j > i) *
tcp = val;
1560 tcp += this->fNcols;
1562 tcp -= this->fNelems-1;
1572template<
class Element>
1578 Element *
trp = this->GetMatrixArray();
1580 for (
Int_t i = 0; i < this->fNrows; i++) {
1581 action.fI = i+this->fRowLwb;
1583 tcp += i*this->fNcols;
1584 for (
Int_t j = i;
j < this->fNcols;
j++) {
1587 if (
j > i) *
tcp = val;
1589 tcp += this->fNcols;
1591 tcp -= this->fNelems-1;
1600template<
class Element>
1605 if (this->fNrows != this->fNcols || this->fRowLwb != this->fColLwb) {
1606 Error(
"Randomize(Element,Element,Element &",
"matrix should be square");
1611 const Element
scale = beta-alpha;
1612 const Element shift = alpha/
scale;
1614 Element *
ep = GetMatrixArray();
1615 for (
Int_t i = 0; i < this->fNrows; i++) {
1616 const Int_t off = i*this->fNcols;
1620 ep[
j*this->fNcols+i] =
ep[off+
j];
1631template<
class Element>
1636 if (this->fNrows != this->fNcols || this->fRowLwb != this->fColLwb) {
1637 Error(
"RandomizeSym(Element,Element,Element &",
"matrix should be square");
1642 const Element
scale = beta-alpha;
1643 const Element shift = alpha/
scale;
1645 Element *
ep = GetMatrixArray();
1647 for (i = 0; i < this->fNrows; i++) {
1648 const Int_t off = i*this->fNcols;
1653 for (i = this->fNrows-1; i >= 0; i--) {
1654 const Int_t off1 = i*this->fNcols;
1656 const Int_t off2 =
j*this->fNcols;
1657 ep[off1+
j] *=
ep[off2+
j];
1658 for (
Int_t k =
j-1; k >= 0; k--) {
1659 ep[off1+
j] +=
ep[off1+k]*
ep[off2+k];
1662 ep[off2+i] =
ep[off1+
j];
1673template<
class Element>
1680 return eigen.GetEigenVectors();
1686template<
class Element>
1690 return (
memcmp(m1.GetMatrixArray(),m2.GetMatrixArray(),
1691 m1.GetNoElements()*
sizeof(Element)) == 0);
1696template<
class Element>
1706template<
class Element>
1716template<
class Element>
1724template<
class Element>
1734template<
class Element>
1744template<
class Element>
1752template<
class Element>
1762template<
class Element>
1771template<
class Element>
1777 Error(
"operator&&(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1783 const Element *
sp1 =
source1.GetMatrixArray();
1784 const Element *
sp2 =
source2.GetMatrixArray();
1785 Element *
tp =
target.GetMatrixArray();
1788 *
tp++ = (*
sp1++ != 0.0 && *
sp2++ != 0.0);
1796template<
class Element>
1802 Error(
"operator||(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1808 const Element *
sp1 =
source1.GetMatrixArray();
1809 const Element *
sp2 =
source2.GetMatrixArray();
1810 Element *
tp =
target.GetMatrixArray();
1813 *
tp++ = (*
sp1++ != 0.0 || *
sp2++ != 0.0);
1821template<
class Element>
1827 Error(
"operator>(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1833 const Element *
sp1 =
source1.GetMatrixArray();
1834 const Element *
sp2 =
source2.GetMatrixArray();
1835 Element *
tp =
target.GetMatrixArray();
1838 *
tp++ = (*sp1) > (*sp2);
sp1++;
sp2++;
1847template<
class Element>
1853 Error(
"operator>=(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1859 const Element *
sp1 =
source1.GetMatrixArray();
1860 const Element *
sp2 =
source2.GetMatrixArray();
1861 Element *
tp =
target.GetMatrixArray();
1864 *
tp++ = (*sp1) >= (*sp2);
sp1++;
sp2++;
1873template<
class Element>
1879 Error(
"operator<=(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1885 const Element *
sp1 =
source1.GetMatrixArray();
1886 const Element *
sp2 =
source2.GetMatrixArray();
1887 Element *
tp =
target.GetMatrixArray();
1890 *
tp++ = (*sp1) <= (*sp2);
sp1++;
sp2++;
1899template<
class Element>
1905 Error(
"operator<(const TMatrixTSym&,const TMatrixTSym&)",
"matrices not compatible");
1911 const Element *
sp1 =
source1.GetMatrixArray();
1912 const Element *
sp2 =
source2.GetMatrixArray();
1913 Element *
tp =
target.GetMatrixArray();
1916 *
tp++ = (*sp1) < (*sp2);
sp1++;
sp2++;
1925template<
class Element>
1929 ::Error(
"Add",
"matrices not compatible");
1936 const Element *
sp =
source.GetMatrixArray();
1944 const Element tmp =
scalar * *
sp++;
1945 if (
j > i) *
tcp += tmp;
1958template<
class Element>
1962 ::Error(
"ElementMult",
"matrices not compatible");
1969 const Element *
sp =
source.GetMatrixArray();
1990template<
class Element>
1994 ::Error(
"ElementDiv",
"matrices not compatible");
2001 const Element *
sp =
source.GetMatrixArray();
2029template<
class Element>
2032 if (
R__b.IsReading()) {
2037 fElements =
new Element[this->fNelems];
2039 for (i = 0; i < this->fNrows; i++) {
2040 R__b.ReadFastArray(fElements+i*this->fNcols+i,this->fNcols-i);
2043 for (i = 0; i < this->fNrows; i++) {
2045 fElements[i*this->fNcols+
j] = fElements[
j*this->fNrows+i];
2049 memcpy(fDataStack,fElements,this->fNelems*
sizeof(Element));
2050 delete [] fElements;
2051 fElements = fDataStack;
2056 for (
Int_t i = 0; i < this->fNrows; i++) {
2057 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)
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 .