45template<
class Element>
50 fRowInd = row-
matrix.GetRowLwb();
51 if (fRowInd >=
matrix.GetNrows() || fRowInd < 0) {
52 Error(
"TMatrixTRow_const(const TMatrixT<Element> &,Int_t)",
"row index out of bounds");
60 fPtr =
matrix.GetMatrixArray()+fRowInd*
matrix.GetNcols();
67template<
class Element>
72 fRowInd = row-
matrix.GetRowLwb();
73 if (fRowInd >=
matrix.GetNrows() || fRowInd < 0) {
74 Error(
"TMatrixTRow_const(const TMatrixTSym &,Int_t)",
"row index out of bounds");
82 fPtr =
matrix.GetMatrixArray()+fRowInd*
matrix.GetNcols();
89template<
class Element>
98template<
class Element>
107template<
class Element>
116template<
class Element>
120 Element *
rp =
const_cast<Element *
>(this->fPtr);
121 for ( ;
rp < this->fPtr+this->fMatrix->GetNcols();
rp += this->fInc)
125template<
class Element>
129 Element *
rp =
const_cast<Element *
>(this->fPtr);
130 auto litr =
l.begin();
131 for ( ;
rp < this->fPtr+this->fMatrix->GetNcols() &&
litr !=
l.end();
rp += this->fInc)
138template<
class Element>
142 Element *
rp =
const_cast<Element *
>(this->fPtr);
143 for ( ;
rp < this->fPtr+this->fMatrix->GetNcols();
rp += this->fInc)
150template<
class Element>
154 Element *
rp =
const_cast<Element *
>(this->fPtr);
155 for ( ;
rp < this->fPtr + this->fMatrix->GetNcols();
rp += this->fInc)
162template<
class Element>
166 if (this->fMatrix->GetMatrixArray() == mt->GetMatrixArray() &&
this->fRowInd ==
mr.GetRowIndex())
return;
171 if (this->fMatrix->GetNcols() != mt->GetNcols() ||
this->fMatrix->GetColLwb() != mt->GetColLwb()) {
172 Error(
"operator=(const TMatrixTRow_const &)",
"matrix rows not compatible");
176 Element *
rp1 =
const_cast<Element *
>(this->fPtr);
177 const Element *
rp2 =
mr.GetPtr();
178 for ( ;
rp1 < this->fPtr+this->fMatrix->GetNcols();
rp1 += this->fInc,
rp2 +=
mr.GetInc())
186template<
class Element>
192 if (this->fMatrix->GetColLwb() !=
vec.GetLwb() ||
this->fMatrix->GetNcols() !=
vec.GetNrows()) {
193 Error(
"operator=(const TVectorT &)",
"vector length != matrix-row length");
197 Element *
rp =
const_cast<Element *
>(this->fPtr);
198 const Element *
vp =
vec.GetMatrixArray();
199 for ( ;
rp < this->fPtr+this->fMatrix->GetNcols();
rp += this->fInc)
206template<
class Element>
214 if (this->fMatrix->GetColLwb() != mt->GetColLwb() ||
this->fMatrix->GetNcols() != mt->GetNcols()) {
215 Error(
"operator+=(const TMatrixTRow_const &)",
"different row lengths");
219 Element *
rp1 =
const_cast<Element *
>(this->fPtr);
220 const Element *
rp2 =
r.GetPtr();
221 for ( ;
rp1 < this->fPtr+this->fMatrix->GetNcols();
rp1 += this->fInc,
rp2 +=
r.GetInc())
229template<
class Element>
237 if (this->fMatrix->GetColLwb() != mt->GetColLwb() ||
this->fMatrix->GetNcols() != mt->GetNcols()) {
238 Error(
"operator*=(const TMatrixTRow_const &)",
"different row lengths");
242 Element *
rp1 =
const_cast<Element *
>(this->fPtr);
243 const Element *
rp2 =
r.GetPtr();
244 for ( ;
rp1 < this->fPtr+this->fMatrix->GetNcols();
rp1 += this->fInc,
rp2 +=
r.GetInc())
251template<
class Element>
256 this->fColInd = col-
matrix.GetColLwb();
257 if (this->fColInd >=
matrix.GetNcols() ||
this->fColInd < 0) {
258 Error(
"TMatrixTColumn_const(const TMatrixT &,Int_t)",
"column index out of bounds");
266 fPtr =
matrix.GetMatrixArray()+fColInd;
273template<
class Element>
278 fColInd = col-
matrix.GetColLwb();
279 if (fColInd >=
matrix.GetNcols() || fColInd < 0) {
280 Error(
"TMatrixTColumn_const(const TMatrixTSym &,Int_t)",
"column index out of bounds");
288 fPtr =
matrix.GetMatrixArray()+fColInd;
295template<
class Element>
304template<
class Element>
313template<
class Element>
322template<
class Element>
326 Element *
cp =
const_cast<Element *
>(this->fPtr);
327 for ( ;
cp < this->fPtr+this->fMatrix->GetNoElements();
cp += this->fInc)
334template<
class Element>
338 Element *
rp =
const_cast<Element *
>(this->fPtr);
339 auto litr =
l.begin();
340 for ( ;
rp < this->fPtr+this->fMatrix->GetNoElements() &&
litr !=
l.end();
rp += this->fInc)
347template<
class Element>
351 Element *
cp =
const_cast<Element *
>(this->fPtr);
352 for ( ;
cp < this->fPtr+this->fMatrix->GetNoElements();
cp += this->fInc)
359template<
class Element>
363 Element *
cp =
const_cast<Element *
>(this->fPtr);
364 for ( ;
cp < this->fPtr+this->fMatrix->GetNoElements();
cp += this->fInc)
371template<
class Element>
375 if (this->fMatrix->GetMatrixArray() == mt->GetMatrixArray() &&
this->fColInd ==
mc.GetColIndex())
return;
380 if (this->fMatrix->GetNrows() != mt->GetNrows() ||
this->fMatrix->GetRowLwb() != mt->GetRowLwb()) {
381 Error(
"operator=(const TMatrixTColumn_const &)",
"matrix columns not compatible");
385 Element *
cp1 =
const_cast<Element *
>(this->fPtr);
386 const Element *
cp2 =
mc.GetPtr();
387 for ( ;
cp1 < this->fPtr+this->fMatrix->GetNoElements();
cp1 += this->fInc,
cp2 +=
mc.GetInc())
394template<
class Element>
400 if (this->fMatrix->GetRowLwb() !=
vec.GetLwb() ||
this->fMatrix->GetNrows() !=
vec.GetNrows()) {
401 Error(
"operator=(const TVectorT &)",
"vector length != matrix-column length");
405 Element *
cp =
const_cast<Element *
>(this->fPtr);
406 const Element *
vp =
vec.GetMatrixArray();
407 for ( ;
cp < this->fPtr+this->fMatrix->GetNoElements();
cp += this->fInc)
416template<
class Element>
424 if (this->fMatrix->GetRowLwb() != mt->GetRowLwb() ||
this->fMatrix->GetNrows() != mt->GetNrows()) {
425 Error(
"operator+=(const TMatrixTColumn_const &)",
"different row lengths");
429 Element *
cp1 =
const_cast<Element *
>(this->fPtr);
430 const Element *
cp2 =
mc.GetPtr();
431 for ( ;
cp1 < this->fPtr+this->fMatrix->GetNoElements();
cp1 += this->fInc,
cp2 +=
mc.GetInc())
439template<
class Element>
447 if (this->fMatrix->GetRowLwb() != mt->GetRowLwb() ||
this->fMatrix->GetNrows() != mt->GetNrows()) {
448 Error(
"operator*=(const TMatrixTColumn_const &)",
"different row lengths");
452 Element *
cp1 =
const_cast<Element *
>(this->fPtr);
453 const Element *
cp2 =
mc.GetPtr();
454 for ( ;
cp1 < this->fPtr+this->fMatrix->GetNoElements();
cp1 += this->fInc,
cp2 +=
mc.GetInc())
461template<
class Element>
468 fPtr =
matrix.GetMatrixArray();
469 fInc =
matrix.GetNcols()+1;
475template<
class Element>
482 fPtr =
matrix.GetMatrixArray();
483 fInc =
matrix.GetNcols()+1;
489template<
class Element>
498template<
class Element>
507template<
class Element>
516template<
class Element>
520 Element *
dp =
const_cast<Element *
>(this->fPtr);
521 for (
Int_t i = 0; i < this->fNdiag; i++,
dp += this->fInc)
528template<
class Element>
532 Element *
dp =
const_cast<Element *
>(this->fPtr);
533 for (
Int_t i = 0; i < this->fNdiag; i++,
dp += this->fInc)
540template<
class Element>
544 Element *
dp =
const_cast<Element *
>(this->fPtr);
545 for (
Int_t i = 0; i < this->fNdiag; i++,
dp += this->fInc)
552template<
class Element>
556 if (this->fMatrix == mt)
return;
561 if (this->GetNdiags() !=
md.GetNdiags()) {
562 Error(
"operator=(const TMatrixTDiag_const &)",
"diagonals not compatible");
566 Element *
dp1 =
const_cast<Element *
>(this->fPtr);
567 const Element *
dp2 =
md.GetPtr();
568 for (
Int_t i = 0; i < this->fNdiag; i++,
dp1 += this->fInc,
dp2 +=
md.GetInc())
575template<
class Element>
581 if (this->fNdiag !=
vec.GetNrows()) {
582 Error(
"operator=(const TVectorT &)",
"vector length != matrix-diagonal length");
586 Element *
dp =
const_cast<Element *
>(this->fPtr);
587 const Element *
vp =
vec.GetMatrixArray();
588 for ( ;
vp <
vec.GetMatrixArray()+
vec.GetNrows();
dp += this->fInc)
596template<
class Element>
603 if (this->fNdiag !=
md.GetNdiags()) {
604 Error(
"operator=(const TMatrixTDiag_const &)",
"matrix-diagonal's different length");
608 Element *
dp1 =
const_cast<Element *
>(this->fPtr);
609 const Element *
dp2 =
md.GetPtr();
610 for (
Int_t i = 0; i < this->fNdiag; i++,
dp1 += this->fInc,
dp2 +=
md.GetInc())
618template<
class Element>
625 if (this->fNdiag !=
md.GetNdiags()) {
626 Error(
"operator*=(const TMatrixTDiag_const &)",
"matrix-diagonal's different length");
630 Element *
dp1 =
const_cast<Element *
>(this->fPtr);
631 const Element *
dp2 =
md.GetPtr();
632 for (
Int_t i = 0; i < this->fNdiag; i++,
dp1 += this->fInc,
dp2 +=
md.GetInc())
639template<
class Element>
645 fPtr =
matrix.GetMatrixArray();
646 fNelems =
matrix.GetNoElements();
652template<
class Element>
658 fPtr =
matrix.GetMatrixArray();
659 fNelems =
matrix.GetNoElements();
665template<
class Element>
674template<
class Element>
683template<
class Element>
692template<
class Element>
696 Element *fp =
const_cast<Element *
>(this->fPtr);
697 while (
fp < this->fPtr+this->fMatrix->GetNoElements())
704template<
class Element>
708 Element *fp =
const_cast<Element *
>(this->fPtr);
709 while (
fp < this->fPtr+this->fMatrix->GetNoElements())
716template<
class Element>
720 Element *fp =
const_cast<Element *
>(this->fPtr);
721 while (
fp < this->fPtr+this->fMatrix->GetNoElements())
728template<
class Element>
732 if (this->fMatrix->GetMatrixArray() == mt->GetMatrixArray())
return;
736 if (this->fMatrix->GetNoElements() != mt->GetNoElements()) {
737 Error(
"operator=(const TMatrixTFlat_const &)",
"matrix lengths different");
741 Element *
fp1 =
const_cast<Element *
>(this->fPtr);
742 const Element *
fp2 =
mf.GetPtr();
750template<
class Element>
755 if (this->fMatrix->GetNoElements() !=
vec.GetNrows()) {
756 Error(
"operator=(const TVectorT &)",
"vector length != # matrix-elements");
760 Element *fp =
const_cast<Element *
>(this->fPtr);
761 const Element *
vp =
vec.GetMatrixArray();
762 while (
fp < this->fPtr+this->fMatrix->GetNoElements())
769template<
class Element>
776 if (this->fMatrix->GetNoElements() != mt->GetNoElements()) {
777 Error(
"operator+=(const TMatrixTFlat_const &)",
"matrices lengths different");
781 Element *
fp1 =
const_cast<Element *
>(this->fPtr);
782 const Element *
fp2 =
mf.GetPtr();
783 while (
fp1 < this->fPtr + this->fMatrix->GetNoElements())
790template<
class Element>
797 if (this->fMatrix->GetNoElements() != mt->GetNoElements()) {
798 Error(
"operator*=(const TMatrixTFlat_const &)",
"matrices lengths different");
802 Element *
fp1 =
const_cast<Element *
>(this->fPtr);
803 const Element *
fp2 =
mf.GetPtr();
804 while (
fp1 < this->fPtr + this->fMatrix->GetNoElements())
813template<
class Element>
867template<
class Element>
919template<
class Element>
929template<
class Element>
939template<
class Element>
949template<
class Element>
956 Error(
"Rank1Update",
"vector too short");
960 const Element *
const pv =
v.GetMatrixArray();
963 const Int_t ncols = this->fMatrix->GetNcols();
966 const Element tmp = alpha*
pv[
irow];
975template<
class Element>
981 const Int_t ncols = this->fMatrix->GetNcols();
992template<
class Element>
998 const Int_t ncols = this->fMatrix->GetNcols();
1009template<
class Element>
1015 const Int_t ncols = this->fMatrix->GetNcols();
1026template<
class Element>
1034 if (this->fMatrix == mt &&
1035 (this->GetNrows() == ms.GetNrows () &&
this->GetNcols() == ms.GetNcols () &&
1036 this->GetRowOff() == ms.GetRowOff() &&
this->GetColOff() == ms.GetColOff()) )
1039 if (this->GetNrows() != ms.GetNrows() ||
this->GetNcols() != ms.GetNcols()) {
1040 Error(
"operator=(const TMatrixTSub_const &)",
"sub matrices have different size");
1049 (
colOff2 >= this->fColOff &&
colOff2 < this->fColOff+this->fNcolsSub) );
1051 Element *
p1 =
const_cast<Element *
>(this->fMatrix->GetMatrixArray());
1053 const Element *
p2 = mt->GetMatrixArray();
1069 const Element *
p2 = tmp.GetMatrixArray();
1085template<
class Element>
1091 if (this->fMatrix->GetMatrixArray() ==
m.GetMatrixArray())
return;
1093 if (this->fNrowsSub !=
m.GetNrows() ||
this->fNcolsSub !=
m.GetNcols()) {
1094 Error(
"operator=(const TMatrixTBase<Element> &)",
"sub matrices and matrix have different size");
1097 const Int_t row_lwbs = this->fRowOff+this->fMatrix->GetRowLwb();
1098 const Int_t col_lwbs = this->fColOff+this->fMatrix->GetColLwb();
1105template<
class Element>
1113 if (this->GetNrows() != ms.GetNrows() ||
this->GetNcols() != ms.GetNcols()) {
1114 Error(
"operator+=(const TMatrixTSub_const &)",
"sub matrices have different size");
1123 (
colOff2 >= this->fColOff &&
colOff2 < this->fColOff+this->fNcolsSub) );
1125 Element *
p1 =
const_cast<Element *
>(this->fMatrix->GetMatrixArray());
1127 const Element *
p2 = mt->GetMatrixArray();
1143 const Element *
p2 = tmp.GetMatrixArray();
1159template<
class Element>
1162 if (this->fNcolsSub != ms.GetNrows() ||
this->fNcolsSub != ms.GetNcols()) {
1163 Error(
"operator*=(const TMatrixTSub_const &)",
"source sub matrix has wrong shape");
1179 const Int_t ncols = this->fMatrix->GetNcols();
1182 Element
work[kWorkMax];
1185 if (this->fNcolsSub > kWorkMax) {
1187 trp =
new Element[this->fNcolsSub];
1190 Element *
cp =
const_cast<Element *
>(this->fMatrix->GetMatrixArray())+this->fRowOff*
ncols+this->fColOff;
1191 const Element *
trp0 =
cp;
1195 for (
const Element *
scp =
sp;
scp <
sp+this->fNcolsSub; ) {
1198 for (
Int_t j = 0;
j < this->fNcolsSub;
j++) {
1200 scp += this->fNcolsSub;
1218template<
class Element>
1224 if (this->GetNrows() != mt.GetNrows() ||
this->GetNcols() != mt.GetNcols()) {
1225 Error(
"operator+=(const TMatrixTBase<Element> &)",
"sub matrix and matrix have different size");
1229 Element *
p1 =
const_cast<Element *
>(this->fMatrix->GetMatrixArray());
1230 const Element *
p2 = mt.GetMatrixArray();
1245template<
class Element>
1248 if (this->fNcolsSub !=
source.GetNrows() ||
this->fNcolsSub !=
source.GetNcols()) {
1249 Error(
"operator*=(const TMatrixT<Element> &)",
"source matrix has wrong shape");
1256 if (this->fMatrix->GetMatrixArray() ==
source.GetMatrixArray()) {
1259 sp = tmp.GetMatrixArray();
1264 const Int_t ncols = this->fMatrix->GetNcols();
1267 Element
work[kWorkMax];
1270 if (this->fNcolsSub > kWorkMax) {
1272 trp =
new Element[this->fNcolsSub];
1275 Element *
cp =
const_cast<Element *
>(this->fMatrix->GetMatrixArray())+this->fRowOff*
ncols+this->fColOff;
1276 const Element *
trp0 =
cp;
1280 for (
const Element *
scp =
sp;
scp <
sp+this->fNcolsSub; ) {
1283 for (
Int_t j = 0;
j < this->fNcolsSub;
j++) {
1285 scp += this->fNcolsSub;
1303template<
class Element>
1306 if (this->fNcolsSub !=
source.GetNrows() ||
this->fNcolsSub !=
source.GetNcols()) {
1307 Error(
"operator*=(const TMatrixTSym<Element> &)",
"source matrix has wrong shape");
1314 if (this->fMatrix->GetMatrixArray() ==
source.GetMatrixArray()) {
1317 sp = tmp.GetMatrixArray();
1322 const Int_t ncols = this->fMatrix->GetNcols();
1325 Element
work[kWorkMax];
1328 if (this->fNcolsSub > kWorkMax) {
1330 trp =
new Element[this->fNcolsSub];
1333 Element *
cp =
const_cast<Element *
>(this->fMatrix->GetMatrixArray())+this->fRowOff*
ncols+this->fColOff;
1334 const Element *
trp0 =
cp;
1338 for (
const Element *
scp =
sp;
scp <
sp+this->fNcolsSub; ) {
1341 for (
Int_t j = 0;
j < this->fNcolsSub;
j++) {
1343 scp += this->fNcolsSub;
1361template<
class Element>
1366 fRowInd = row-
matrix.GetRowLwb();
1367 if (fRowInd >=
matrix.GetNrows() || fRowInd < 0) {
1368 Error(
"TMatrixTSparseRow_const(const TMatrixTSparse &,Int_t)",
"row index out of bounds");
1386template<
class Element>
1397 Error(
"operator()",
"Request col(%d) outside matrix range of %d - %d",
1398 i,fMatrix->GetColLwb(),fMatrix->GetColLwb()+fMatrix->GetNcols());
1406template<
class Element>
1415template<
class Element>
1424template<
class Element>
1429 const Int_t acoln = i-this->fMatrix->GetColLwb();
1435 Error(
"operator()",
"Request col(%d) outside matrix range of %d - %d",
1436 i,this->fMatrix->GetColLwb(),
this->fMatrix->GetColLwb()+
this->fMatrix->GetNcols());
1444template<
class Element>
1450 const Int_t acoln = i-this->fMatrix->GetColLwb();
1451 if (
acoln >= this->fMatrix->GetNcols() ||
acoln < 0) {
1452 Error(
"operator()(Int_t",
"Requested element %d outside range : %d - %d",i,
1453 this->fMatrix->GetColLwb(),
this->fMatrix->GetColLwb()+
this->fMatrix->GetNcols());
1459 return (
const_cast<Element*
>(this->fDataPtr))[
index];
1462 const Int_t row = this->fRowInd+mt->GetRowLwb();
1464 mt->InsertRow(row,i,&val,1);
1465 const Int_t sIndex = mt->GetRowIndexArray()[this->fRowInd];
1466 const Int_t eIndex = mt->GetRowIndexArray()[this->fRowInd+1];
1468 this->fColPtr = mt->GetColIndexArray()+
sIndex;
1469 this->fDataPtr = mt->GetMatrixArray()+
sIndex;
1472 return (
const_cast<Element*
>(this->fDataPtr))[
index];
1474 Error(
"operator()(Int_t",
"Insert row failed");
1483template<
class Element>
1487 Element *
rp =
const_cast<Element *
>(this->fDataPtr);
1488 for ( ;
rp < this->fDataPtr+this->fNindex;
rp++)
1495template<
class Element>
1499 Element *
rp =
const_cast<Element *
>(this->fDataPtr);
1500 for ( ;
rp < this->fDataPtr+this->fNindex;
rp++)
1507template<
class Element>
1511 Element *
rp =
const_cast<Element *
>(this->fDataPtr);
1512 for ( ;
rp < this->fDataPtr+this->fNindex;
rp++)
1519template<
class Element>
1523 if (this->fMatrix == mt)
return;
1527 if (this->fMatrix->GetColLwb() != mt->GetColLwb() ||
this->fMatrix->GetNcols() != mt->GetNcols()) {
1528 Error(
"operator=(const TMatrixTSparseRow_const &)",
"matrix rows not compatible");
1532 const Int_t ncols = this->fMatrix->GetNcols();
1533 const Int_t row1 = this->fRowInd+this->fMatrix->GetRowLwb();
1534 const Int_t row2 =
mr.GetRowIndex()+mt->GetRowLwb();
1535 const Int_t col = this->fMatrix->GetColLwb();
1538 mt->ExtractRow(
row2,col,
v.GetMatrixArray());
1541 const Int_t sIndex = this->fMatrix->GetRowIndexArray()[this->fRowInd];
1542 const Int_t eIndex = this->fMatrix->GetRowIndexArray()[this->fRowInd+1];
1544 this->fColPtr = this->fMatrix->GetColIndexArray()+
sIndex;
1545 this->fDataPtr = this->fMatrix->GetMatrixArray()+
sIndex;
1552template<
class Element>
1558 if (this->fMatrix->GetColLwb() !=
vec.GetLwb() ||
this->fMatrix->GetNcols() !=
vec.GetNrows()) {
1559 Error(
"operator=(const TVectorT &)",
"vector length != matrix-row length");
1563 const Element *
vp =
vec.GetMatrixArray();
1564 const Int_t row = this->fRowInd+this->fMatrix->GetRowLwb();
1565 const Int_t col = this->fMatrix->GetColLwb();
1568 const Int_t sIndex = this->fMatrix->GetRowIndexArray()[this->fRowInd];
1569 const Int_t eIndex = this->fMatrix->GetRowIndexArray()[this->fRowInd+1];
1571 this->fColPtr = this->fMatrix->GetColIndexArray()+
sIndex;
1572 this->fDataPtr = this->fMatrix->GetMatrixArray()+
sIndex;
1578template<
class Element>
1585 if (this->fMatrix->GetColLwb() != mt->GetColLwb() ||
this->fMatrix->GetNcols() != mt->GetNcols()) {
1586 Error(
"operator+=(const TMatrixTRow_const &)",
"different row lengths");
1590 const Int_t ncols = this->fMatrix->GetNcols();
1591 const Int_t row1 = this->fRowInd+this->fMatrix->GetRowLwb();
1592 const Int_t row2 =
r.GetRowIndex()+mt->GetRowLwb();
1593 const Int_t col = this->fMatrix->GetColLwb();
1597 this->fMatrix->ExtractRow(
row1,col,
v1.GetMatrixArray());
1598 mt ->ExtractRow(
row2,col,
v2.GetMatrixArray());
1602 const Int_t sIndex = this->fMatrix->GetRowIndexArray()[this->fRowInd];
1603 const Int_t eIndex = this->fMatrix->GetRowIndexArray()[this->fRowInd+1];
1605 this->fColPtr = this->fMatrix->GetColIndexArray()+
sIndex;
1606 this->fDataPtr = this->fMatrix->GetMatrixArray()+
sIndex;
1613template<
class Element>
1620 if (this->fMatrix->GetColLwb() != mt->GetColLwb() ||
this->fMatrix->GetNcols() != mt->GetNcols()) {
1621 Error(
"operator+=(const TMatrixTRow_const &)",
"different row lengths");
1625 const Int_t ncols = this->fMatrix->GetNcols();
1626 const Int_t row1 =
r.GetRowIndex()+mt->GetRowLwb();
1627 const Int_t row2 =
r.GetRowIndex()+mt->GetRowLwb();
1628 const Int_t col = this->fMatrix->GetColLwb();
1632 this->fMatrix->ExtractRow(
row1,col,
v1.GetMatrixArray());
1633 mt ->ExtractRow(
row2,col,
v2.GetMatrixArray());
1638 const Int_t sIndex = this->fMatrix->GetRowIndexArray()[this->fRowInd];
1639 const Int_t eIndex = this->fMatrix->GetRowIndexArray()[this->fRowInd+1];
1641 this->fColPtr = this->fMatrix->GetColIndexArray()+
sIndex;
1642 this->fDataPtr = this->fMatrix->GetMatrixArray()+
sIndex;
1648template<
class Element>
1655 fDataPtr =
matrix.GetMatrixArray();
1660template<
class Element>
1665 const Int_t *
const pR = fMatrix->GetRowIndexArray();
1666 const Int_t *
const pC = fMatrix->GetColIndexArray();
1667 const Element *
const pD = fMatrix->GetMatrixArray();
1674 Error(
"operator()",
"Request diagonal(%d) outside matrix range of 0 - %d",i,fNdiag);
1683template<
class Element>
1692template<
class Element>
1701template<
class Element>
1706 const Int_t *
const pR = this->fMatrix->GetRowIndexArray();
1707 const Int_t *
const pC = this->fMatrix->GetColIndexArray();
1708 const Element *
const pD = this->fMatrix->GetMatrixArray();
1715 Error(
"operator()",
"Request diagonal(%d) outside matrix range of 0 - %d",i,this->fNdiag);
1724template<
class Element>
1730 Error(
"operator()(Int_t",
"Requested element %d outside range : 0 - %d",i,this->fNdiag);
1731 return (
const_cast<Element*
>(this->fDataPtr))[0];
1735 const Int_t *
pR = mt->GetRowIndexArray();
1736 const Int_t *
pC = mt->GetColIndexArray();
1741 return (
const_cast<Element*
>(this->fDataPtr))[
index];
1743 const Int_t row = i+mt->GetRowLwb();
1744 const Int_t col = i+mt->GetColLwb();
1746 mt->InsertRow(row,col,&val,1);
1747 this->fDataPtr = mt->GetMatrixArray();
1748 pR = mt->GetRowIndexArray();
1749 pC = mt->GetColIndexArray();
1754 return (
const_cast<Element*
>(this->fDataPtr))[
index];
1756 Error(
"operator()(Int_t",
"Insert row failed");
1757 return (
const_cast<Element*
>(this->fDataPtr))[0];
1765template<
class Element>
1769 for (
Int_t i = 0; i < this->fNdiag; i++)
1776template<
class Element>
1780 for (
Int_t i = 0; i < this->fNdiag; i++)
1787template<
class Element>
1791 for (
Int_t i = 0; i < this->fNdiag; i++)
1798template<
class Element>
1802 if (this->fMatrix == mt)
return;
1806 if (this->fNdiag !=
md.GetNdiags()) {
1807 Error(
"operator=(const TMatrixTSparseDiag_const &)",
"matrix-diagonal's different length");
1811 for (
Int_t i = 0; i < this->fNdiag; i++)
1818template<
class Element>
1824 if (this->fNdiag !=
vec.GetNrows()) {
1825 Error(
"operator=(const TVectorT &)",
"vector length != matrix-diagonal length");
1829 const Element *
vp =
vec.GetMatrixArray();
1830 for (
Int_t i = 0; i < this->fNdiag; i++)
1838template<
class Element>
1845 if (this->fNdiag !=
md.GetNdiags()) {
1846 Error(
"operator+=(const TMatrixTSparseDiag_const &)",
"matrix-diagonal's different length");
1850 for (
Int_t i = 0; i < this->fNdiag; i++)
1851 (*
this)(i) +=
md(i);
1858template<
class Element>
1865 if (this->fNdiag !=
md.GetNdiags()) {
1866 Error(
"operator*=(const TMatrixTSparseDiag_const &)",
"matrix-diagonal's different length");
1870 for (
Int_t i = 0; i < this->fNdiag; i++)
1871 (*
this)(i) *=
md(i);
1898 return (
ix*4.656612875e-10);
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
winID h TVirtualViewer3D TVirtualGLPainter p
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 r
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
Double_t Drand(Double_t &ix)
Random number generator [0....1] with seed ix.
static Element & NaNValue()
void operator+=(Element val)
Add val to every element of the matrix column.
void operator=(Element val)
void Assign(Element val)
Assign val to every element of the matrix column.
void operator*=(Element val)
Multiply every element of the matrix column with val.
void operator+=(Element val)
Assign val to every element of the matrix diagonal.
void operator=(Element val)
Assign val to every element of the matrix diagonal.
void operator*=(Element val)
Assign val to every element of the matrix diagonal.
void operator+=(Element val)
Add val to every element of the matrix.
void operator*=(Element val)
Multiply every element of the matrix with val.
void operator=(Element val)
Assign val to every element of the matrix.
void Assign(Element val)
Assign val to every element of the matrix row.
void operator*=(Element val)
Multiply every element of the matrix row with val.
void operator+=(Element val)
Add val to every element of the matrix row.
void operator=(std::initializer_list< Element > l)
TMatrixTSparseDiag_const()
Element operator()(Int_t i) const
Element operator()(Int_t i) const
void operator=(Element val)
Assign val to every element of the matrix diagonal.
void operator*=(Element val)
Multiply every element of the matrix diagonal by val.
void operator+=(Element val)
Add val to every element of the matrix diagonal.
TMatrixTSparseRow_const()
Element operator()(Int_t i) const
void operator+=(Element val)
Add val to every non-zero (!) element of the matrix row.
void operator=(Element val)
Assign val to every non-zero (!) element of the matrix row.
void operator*=(Element val)
Multiply every element of the matrix row by val.
Element operator()(Int_t i) const
void Rank1Update(const TVectorT< Element > &vec, Element alpha=1.0)
Perform a rank 1 operation on the matrix: A += alpha * v * v^T.
void operator*=(Element val)
Multiply every element of the sub matrix by val .
void operator+=(Element val)
Add val to every element of the sub matrix.
void operator=(Element val)
Assign val to every element of the sub matrix.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Binary search in an array of n values to locate value.
TMatrixT< Element > & ElementMult(TMatrixT< Element > &target, const TMatrixT< Element > &source)
Multiply target by the source, element-by-element.