43 template<
class Element>
49 if (fRowInd >= matrix.
GetNrows() || fRowInd < 0) {
50 Error(
"TMatrixTRow_const(const TMatrixT<Element> &,Int_t)",
"row index out of bounds");
65 template<
class Element>
71 if (fRowInd >= matrix.
GetNrows() || fRowInd < 0) {
72 Error(
"TMatrixTRow_const(const TMatrixTSym &,Int_t)",
"row index out of bounds");
87 template<
class Element>
96 template<
class Element>
105 template<
class Element>
114 template<
class Element>
118 Element *rp =
const_cast<Element *
>(this->fPtr);
119 for ( ; rp < this->fPtr+this->
fMatrix->GetNcols(); rp += this->fInc)
126 template<
class Element>
130 Element *rp =
const_cast<Element *
>(this->fPtr);
131 for ( ; rp < this->fPtr+this->
fMatrix->GetNcols(); rp += this->fInc)
138 template<
class Element>
142 Element *rp =
const_cast<Element *
>(this->fPtr);
143 for ( ; rp < this->fPtr + this->
fMatrix->GetNcols(); rp += this->fInc)
150 template<
class Element>
160 Error(
"operator=(const TMatrixTRow_const &)",
"matrix rows not compatible");
164 Element *rp1 =
const_cast<Element *
>(this->fPtr);
165 const Element *rp2 = mr.
GetPtr();
166 for ( ; rp1 < this->fPtr+this->
fMatrix->GetNcols(); rp1 += this->fInc,rp2 += mr.
GetInc())
174 template<
class Element>
181 Error(
"operator=(const TVectorT &)",
"vector length != matrix-row length");
185 Element *rp =
const_cast<Element *
>(this->fPtr);
187 for ( ; rp < this->fPtr+this->
fMatrix->GetNcols(); rp += this->fInc)
194 template<
class Element>
203 Error(
"operator+=(const TMatrixTRow_const &)",
"different row lengths");
207 Element *rp1 =
const_cast<Element *
>(this->fPtr);
208 const Element *rp2 = r.
GetPtr();
209 for ( ; rp1 < this->fPtr+this->
fMatrix->GetNcols(); rp1 += this->fInc,rp2 += r.
GetInc())
217 template<
class Element>
226 Error(
"operator*=(const TMatrixTRow_const &)",
"different row lengths");
230 Element *rp1 =
const_cast<Element *
>(this->fPtr);
231 const Element *rp2 = r.
GetPtr();
232 for ( ; rp1 < this->fPtr+this->
fMatrix->GetNcols(); rp1 += this->fInc,rp2 += r.
GetInc())
239 template<
class Element>
245 if (this->fColInd >= matrix.
GetNcols() || this->fColInd < 0) {
246 Error(
"TMatrixTColumn_const(const TMatrixT &,Int_t)",
"column index out of bounds");
261 template<
class Element>
267 if (fColInd >= matrix.
GetNcols() || fColInd < 0) {
268 Error(
"TMatrixTColumn_const(const TMatrixTSym &,Int_t)",
"column index out of bounds");
283 template<
class Element>
292 template<
class Element>
301 template<
class Element>
310 template<
class Element>
314 Element *cp =
const_cast<Element *
>(this->fPtr);
315 for ( ; cp < this->fPtr+this->
fMatrix->GetNoElements(); cp += this->fInc)
322 template<
class Element>
326 Element *cp =
const_cast<Element *
>(this->fPtr);
327 for ( ; cp < this->fPtr+this->
fMatrix->GetNoElements(); cp += this->fInc)
334 template<
class Element>
338 Element *cp =
const_cast<Element *
>(this->fPtr);
339 for ( ; cp < this->fPtr+this->
fMatrix->GetNoElements(); cp += this->fInc)
346 template<
class Element>
356 Error(
"operator=(const TMatrixTColumn_const &)",
"matrix columns not compatible");
360 Element *cp1 =
const_cast<Element *
>(this->fPtr);
361 const Element *cp2 = mc.
GetPtr();
362 for ( ; cp1 < this->fPtr+this->
fMatrix->GetNoElements(); cp1 += this->fInc,cp2 += mc.
GetInc())
369 template<
class Element>
376 Error(
"operator=(const TVectorT &)",
"vector length != matrix-column length");
380 Element *cp =
const_cast<Element *
>(this->fPtr);
382 for ( ; cp < this->fPtr+this->
fMatrix->GetNoElements(); cp += this->fInc)
391 template<
class Element>
400 Error(
"operator+=(const TMatrixTColumn_const &)",
"different row lengths");
404 Element *cp1 =
const_cast<Element *
>(this->fPtr);
405 const Element *cp2 = mc.
GetPtr();
406 for ( ; cp1 < this->fPtr+this->
fMatrix->GetNoElements(); cp1 += this->fInc,cp2 += mc.
GetInc())
414 template<
class Element>
423 Error(
"operator*=(const TMatrixTColumn_const &)",
"different row lengths");
427 Element *cp1 =
const_cast<Element *
>(this->fPtr);
428 const Element *cp2 = mc.
GetPtr();
429 for ( ; cp1 < this->fPtr+this->
fMatrix->GetNoElements(); cp1 += this->fInc,cp2 += mc.
GetInc())
436 template<
class Element>
450 template<
class Element>
464 template<
class Element>
473 template<
class Element>
482 template<
class Element>
491 template<
class Element>
495 Element *dp =
const_cast<Element *
>(this->fPtr);
496 for (
Int_t i = 0; i < this->fNdiag; i++, dp += this->fInc)
503 template<
class Element>
507 Element *dp =
const_cast<Element *
>(this->fPtr);
508 for (
Int_t i = 0; i < this->fNdiag; i++, dp += this->fInc)
515 template<
class Element>
519 Element *dp =
const_cast<Element *
>(this->fPtr);
520 for (
Int_t i = 0; i < this->fNdiag; i++, dp += this->fInc)
527 template<
class Element>
531 if (this->
fMatrix == mt)
return;
536 if (this->GetNdiags() != md.
GetNdiags()) {
537 Error(
"operator=(const TMatrixTDiag_const &)",
"diagonals not compatible");
541 Element *dp1 =
const_cast<Element *
>(this->fPtr);
542 const Element *dp2 = md.
GetPtr();
543 for (
Int_t i = 0; i < this->fNdiag; i++, dp1 += this->fInc, dp2 += md.
GetInc())
550 template<
class Element>
556 if (this->fNdiag != vec.
GetNrows()) {
557 Error(
"operator=(const TVectorT &)",
"vector length != matrix-diagonal length");
561 Element *dp =
const_cast<Element *
>(this->fPtr);
571 template<
class Element>
579 Error(
"operator=(const TMatrixTDiag_const &)",
"matrix-diagonal's different length");
583 Element *dp1 =
const_cast<Element *
>(this->fPtr);
584 const Element *dp2 = md.
GetPtr();
585 for (
Int_t i = 0; i < this->fNdiag; i++, dp1 += this->fInc, dp2 += md.
GetInc())
593 template<
class Element>
601 Error(
"operator*=(const TMatrixTDiag_const &)",
"matrix-diagonal's different length");
605 Element *dp1 =
const_cast<Element *
>(this->fPtr);
606 const Element *dp2 = md.
GetPtr();
607 for (
Int_t i = 0; i < this->fNdiag; i++, dp1 += this->fInc, dp2 += md.
GetInc())
614 template<
class Element>
627 template<
class Element>
640 template<
class Element>
649 template<
class Element>
658 template<
class Element>
667 template<
class Element>
671 Element *fp =
const_cast<Element *
>(this->fPtr);
672 while (fp < this->fPtr+this->
fMatrix->GetNoElements())
679 template<
class Element>
683 Element *fp =
const_cast<Element *
>(this->fPtr);
684 while (fp < this->fPtr+this->
fMatrix->GetNoElements())
691 template<
class Element>
695 Element *fp =
const_cast<Element *
>(this->fPtr);
696 while (fp < this->fPtr+this->
fMatrix->GetNoElements())
703 template<
class Element>
712 Error(
"operator=(const TMatrixTFlat_const &)",
"matrix lengths different");
716 Element *fp1 =
const_cast<Element *
>(this->fPtr);
717 const Element *fp2 = mf.
GetPtr();
718 while (fp1 < this->fPtr+this->
fMatrix->GetNoElements())
725 template<
class Element>
731 Error(
"operator=(const TVectorT &)",
"vector length != # matrix-elements");
735 Element *fp =
const_cast<Element *
>(this->fPtr);
737 while (fp < this->fPtr+this->
fMatrix->GetNoElements())
744 template<
class Element>
752 Error(
"operator+=(const TMatrixTFlat_const &)",
"matrices lengths different");
756 Element *fp1 =
const_cast<Element *
>(this->fPtr);
757 const Element *fp2 = mf.
GetPtr();
758 while (fp1 < this->fPtr + this->
fMatrix->GetNoElements())
765 template<
class Element>
773 Error(
"operator*=(const TMatrixTFlat_const &)",
"matrices lengths different");
777 Element *fp1 =
const_cast<Element *
>(this->fPtr);
778 const Element *fp2 = mf.
GetPtr();
779 while (fp1 < this->fPtr + this->
fMatrix->GetNoElements())
788 template<
class Element>
800 if (row_upbs < row_lwbs) {
801 Error(
"TMatrixTSub_const",
"Request sub-matrix with row_upbs(%d) < row_lwbs(%d)",row_upbs,row_lwbs);
804 if (col_upbs < col_lwbs) {
805 Error(
"TMatrixTSub_const",
"Request sub-matrix with col_upbs(%d) < col_lwbs(%d)",col_upbs,col_lwbs);
814 if (row_lwbs < rowLwb || row_lwbs > rowUpb) {
815 Error(
"TMatrixTSub_const",
"Request row_lwbs sub-matrix(%d) outside matrix range of %d - %d",row_lwbs,rowLwb,rowUpb);
818 if (col_lwbs < colLwb || col_lwbs > colUpb) {
819 Error(
"TMatrixTSub_const",
"Request col_lwbs sub-matrix(%d) outside matrix range of %d - %d",col_lwbs,colLwb,colUpb);
822 if (row_upbs < rowLwb || row_upbs > rowUpb) {
823 Error(
"TMatrixTSub_const",
"Request row_upbs sub-matrix(%d) outside matrix range of %d - %d",row_upbs,rowLwb,rowUpb);
826 if (col_upbs < colLwb || col_upbs > colUpb) {
827 Error(
"TMatrixTSub_const",
"Request col_upbs sub-matrix(%d) outside matrix range of %d - %d",col_upbs,colLwb,colUpb);
831 fRowOff = row_lwbs-rowLwb;
832 fColOff = col_lwbs-colLwb;
833 fNrowsSub = row_upbs-row_lwbs+1;
834 fNcolsSub = col_upbs-col_lwbs+1;
842 template<
class Element>
854 if (row_upbs < row_lwbs) {
855 Error(
"TMatrixTSub_const",
"Request sub-matrix with row_upbs(%d) < row_lwbs(%d)",row_upbs,row_lwbs);
858 if (col_upbs < col_lwbs) {
859 Error(
"TMatrixTSub_const",
"Request sub-matrix with col_upbs(%d) < col_lwbs(%d)",col_upbs,col_lwbs);
868 if (row_lwbs < rowLwb || row_lwbs > rowUpb) {
869 Error(
"TMatrixTSub_const",
"Request row_lwbs sub-matrix(%d) outside matrix range of %d - %d",row_lwbs,rowLwb,rowUpb);
872 if (col_lwbs < colLwb || col_lwbs > colUpb) {
873 Error(
"TMatrixTSub_const",
"Request col_lwbs sub-matrix(%d) outside matrix range of %d - %d",col_lwbs,colLwb,colUpb);
876 if (row_upbs < rowLwb || row_upbs > rowUpb) {
877 Error(
"TMatrixTSub_const",
"Request row_upbs sub-matrix(%d) outside matrix range of %d - %d",row_upbs,rowLwb,rowUpb);
880 if (col_upbs < colLwb || col_upbs > colUpb) {
881 Error(
"TMatrixTSub_const",
"Request col_upbs sub-matrix(%d) outside matrix range of %d - %d",col_upbs,colLwb,colUpb);
885 fRowOff = row_lwbs-rowLwb;
886 fColOff = col_lwbs-colLwb;
887 fNrowsSub = row_upbs-row_lwbs+1;
888 fNcolsSub = col_upbs-col_lwbs+1;
894 template<
class Element>
904 template<
class Element>
914 template<
class Element>
924 template<
class Element>
931 Error(
"Rank1Update",
"vector too short");
939 for (
Int_t irow = 0; irow < this->fNrowsSub; irow++) {
940 const Int_t off = (irow+this->fRowOff)*ncols+this->fColOff;
941 const Element tmp = alpha*pv[irow];
942 for (
Int_t icol = 0; icol < this->fNcolsSub; icol++)
943 mp[off+icol] += tmp*pv[icol];
950 template<
class Element>
957 for (
Int_t irow = 0; irow < this->fNrowsSub; irow++) {
958 const Int_t off = (irow+this->fRowOff)*ncols+this->fColOff;
959 for (
Int_t icol = 0; icol < this->fNcolsSub; icol++)
967 template<
class Element>
974 for (
Int_t irow = 0; irow < this->fNrowsSub; irow++) {
975 const Int_t off = (irow+this->fRowOff)*ncols+this->fColOff;
976 for (
Int_t icol = 0; icol < this->fNcolsSub; icol++)
984 template<
class Element>
991 for (
Int_t irow = 0; irow < this->fNrowsSub; irow++) {
992 const Int_t off = (irow+this->fRowOff)*ncols+this->fColOff;
993 for (
Int_t icol = 0; icol < this->fNcolsSub; icol++)
1001 template<
class Element>
1010 (this->GetNrows() == ms.
GetNrows () && this->GetNcols() == ms.
GetNcols () &&
1014 if (this->GetNrows() != ms.
GetNrows() || this->GetNcols() != ms.
GetNcols()) {
1015 Error(
"operator=(const TMatrixTSub_const &)",
"sub matrices have different size");
1023 ( (rowOff2 >= this->fRowOff && rowOff2 < this->fRowOff+this->fNrowsSub) ||
1024 (colOff2 >= this->fColOff && colOff2 < this->fColOff+this->fNcolsSub) );
1026 Element *
p1 =
const_cast<Element *
>(this->
fMatrix->GetMatrixArray());
1032 for (
Int_t irow = 0; irow < this->fNrowsSub; irow++) {
1033 const Int_t off1 = (irow+this->fRowOff)*ncols1+this->fColOff;
1034 const Int_t off2 = (irow+rowOff2)*ncols2+colOff2;
1035 for (
Int_t icol = 0; icol < this->fNcolsSub; icol++)
1036 p1[off1+icol] = p2[off2+icol];
1040 const Int_t row_upbs = row_lwbs+this->fNrowsSub-1;
1042 const Int_t col_upbs = col_lwbs+this->fNcolsSub-1;
1048 for (
Int_t irow = 0; irow < this->fNrowsSub; irow++) {
1049 const Int_t off1 = (irow+this->fRowOff)*ncols1+this->fColOff;
1050 const Int_t off2 = irow*ncols2;
1051 for (
Int_t icol = 0; icol < this->fNcolsSub; icol++)
1052 p1[off1+icol] = p2[off2+icol];
1060 template<
class Element>
1069 Error(
"operator=(const TMatrixTBase<Element> &)",
"sub matrices and matrix have different size");
1072 const Int_t row_lwbs = this->fRowOff+this->
fMatrix->GetRowLwb();
1073 const Int_t col_lwbs = this->fColOff+this->
fMatrix->GetColLwb();
1080 template<
class Element>
1088 if (this->GetNrows() != ms.
GetNrows() || this->GetNcols() != ms.
GetNcols()) {
1089 Error(
"operator+=(const TMatrixTSub_const &)",
"sub matrices have different size");
1097 ( (rowOff2 >= this->fRowOff && rowOff2 < this->fRowOff+this->fNrowsSub) ||
1098 (colOff2 >= this->fColOff && colOff2 < this->fColOff+this->fNcolsSub) );
1100 Element *
p1 =
const_cast<Element *
>(this->
fMatrix->GetMatrixArray());
1106 for (
Int_t irow = 0; irow < this->fNrowsSub; irow++) {
1107 const Int_t off1 = (irow+this->fRowOff)*ncols1+this->fColOff;
1108 const Int_t off2 = (irow+rowOff2)*ncols2+colOff2;
1109 for (
Int_t icol = 0; icol < this->fNcolsSub; icol++)
1110 p1[off1+icol] += p2[off2+icol];
1114 const Int_t row_upbs = row_lwbs+this->fNrowsSub-1;
1116 const Int_t col_upbs = col_lwbs+this->fNcolsSub-1;
1122 for (
Int_t irow = 0; irow < this->fNrowsSub; irow++) {
1123 const Int_t off1 = (irow+this->fRowOff)*ncols1+this->fColOff;
1124 const Int_t off2 = irow*ncols2;
1125 for (
Int_t icol = 0; icol < this->fNcolsSub; icol++)
1126 p1[off1+icol] += p2[off2+icol];
1134 template<
class Element>
1137 if (this->fNcolsSub != ms.
GetNrows() || this->fNcolsSub != ms.
GetNcols()) {
1138 Error(
"operator*=(const TMatrixTSub_const &)",
"source sub matrix has wrong shape");
1147 const Int_t row_upbs = row_lwbs+this->fNrowsSub-1;
1149 const Int_t col_upbs = col_lwbs+this->fNcolsSub-1;
1150 source->
GetSub(row_lwbs,row_upbs,col_lwbs,col_upbs,source_sub);
1157 Element work[kWorkMax];
1159 Element *trp = work;
1160 if (this->fNcolsSub > kWorkMax) {
1161 isAllocated =
kTRUE;
1162 trp =
new Element[this->fNcolsSub];
1165 Element *cp =
const_cast<Element *
>(this->
fMatrix->GetMatrixArray())+this->fRowOff*ncols+this->fColOff;
1166 const Element *trp0 = cp;
1167 const Element *
const trp0_last = trp0+this->fNrowsSub*ncols;
1168 while (trp0 < trp0_last) {
1169 memcpy(trp,trp0,this->fNcolsSub*
sizeof(Element));
1170 for (
const Element *scp = sp; scp < sp+this->fNcolsSub; ) {
1173 for (
Int_t j = 0; j < this->fNcolsSub; j++) {
1174 cij += trp[j] * *scp;
1175 scp += this->fNcolsSub;
1180 cp += ncols-this->fNcolsSub;
1185 R__ASSERT(cp == trp0_last && trp0 == trp0_last);
1193 template<
class Element>
1199 if (this->GetNrows() != mt.
GetNrows() || this->GetNcols() != mt.
GetNcols()) {
1200 Error(
"operator+=(const TMatrixTBase<Element> &)",
"sub matrix and matrix have different size");
1204 Element *
p1 =
const_cast<Element *
>(this->
fMatrix->GetMatrixArray());
1209 for (
Int_t irow = 0; irow < this->fNrowsSub; irow++) {
1210 const Int_t off1 = (irow+this->fRowOff)*ncols1+this->fColOff;
1211 const Int_t off2 = irow*ncols2;
1212 for (
Int_t icol = 0; icol < this->fNcolsSub; icol++)
1213 p1[off1+icol] += p2[off2+icol];
1220 template<
class Element>
1223 if (this->fNcolsSub != source.
GetNrows() || this->fNcolsSub != source.
GetNcols()) {
1224 Error(
"operator*=(const TMatrixT<Element> &)",
"source matrix has wrong shape");
1242 Element work[kWorkMax];
1244 Element *trp = work;
1245 if (this->fNcolsSub > kWorkMax) {
1246 isAllocated =
kTRUE;
1247 trp =
new Element[this->fNcolsSub];
1250 Element *cp =
const_cast<Element *
>(this->
fMatrix->GetMatrixArray())+this->fRowOff*ncols+this->fColOff;
1251 const Element *trp0 = cp;
1252 const Element *
const trp0_last = trp0+this->fNrowsSub*ncols;
1253 while (trp0 < trp0_last) {
1254 memcpy(trp,trp0,this->fNcolsSub*
sizeof(Element));
1255 for (
const Element *scp = sp; scp < sp+this->fNcolsSub; ) {
1258 for (
Int_t j = 0; j < this->fNcolsSub; j++) {
1259 cij += trp[j] * *scp;
1260 scp += this->fNcolsSub;
1265 cp += ncols-this->fNcolsSub;
1270 R__ASSERT(cp == trp0_last && trp0 == trp0_last);
1278 template<
class Element>
1281 if (this->fNcolsSub != source.
GetNrows() || this->fNcolsSub != source.
GetNcols()) {
1282 Error(
"operator*=(const TMatrixTSym<Element> &)",
"source matrix has wrong shape");
1300 Element work[kWorkMax];
1302 Element *trp = work;
1303 if (this->fNcolsSub > kWorkMax) {
1304 isAllocated =
kTRUE;
1305 trp =
new Element[this->fNcolsSub];
1308 Element *cp =
const_cast<Element *
>(this->
fMatrix->GetMatrixArray())+this->fRowOff*ncols+this->fColOff;
1309 const Element *trp0 = cp;
1310 const Element *
const trp0_last = trp0+this->fNrowsSub*ncols;
1311 while (trp0 < trp0_last) {
1312 memcpy(trp,trp0,this->fNcolsSub*
sizeof(Element));
1313 for (
const Element *scp = sp; scp < sp+this->fNcolsSub; ) {
1316 for (
Int_t j = 0; j < this->fNcolsSub; j++) {
1317 cij += trp[j] * *scp;
1318 scp += this->fNcolsSub;
1323 cp += ncols-this->fNcolsSub;
1328 R__ASSERT(cp == trp0_last && trp0 == trp0_last);
1336 template<
class Element>
1342 if (fRowInd >= matrix.
GetNrows() || fRowInd < 0) {
1343 Error(
"TMatrixTSparseRow_const(const TMatrixTSparse &,Int_t)",
"row index out of bounds");
1354 fNindex = eIndex-sIndex;
1361 template<
class Element>
1367 if (acoln < fMatrix->GetNcols() && acoln >= 0) {
1369 if (index >= 0 && fColPtr[index] == acoln)
return fDataPtr[index];
1372 Error(
"operator()",
"Request col(%d) outside matrix range of %d - %d",
1381 template<
class Element>
1390 template<
class Element>
1399 template<
class Element>
1405 if (acoln < this->
fMatrix->GetNcols() && acoln >= 0) {
1407 if (index >= 0 && this->fColPtr[index] == acoln)
return this->fDataPtr[index];
1410 Error(
"operator()",
"Request col(%d) outside matrix range of %d - %d",
1419 template<
class Element>
1426 if (acoln >= this->
fMatrix->GetNcols() || acoln < 0) {
1427 Error(
"operator()(Int_t",
"Requested element %d outside range : %d - %d",i,
1433 if (index >= 0 && this->fColPtr[index] == acoln)
1434 return (const_cast<Element*>(this->fDataPtr))[index];
1442 this->fNindex = eIndex-sIndex;
1446 if (index >= 0 && this->fColPtr[index] == acoln)
1447 return (const_cast<Element*>(this->fDataPtr))[index];
1449 Error(
"operator()(Int_t",
"Insert row failed");
1458 template<
class Element>
1462 Element *rp =
const_cast<Element *
>(this->fDataPtr);
1463 for ( ; rp < this->fDataPtr+this->fNindex; rp++)
1470 template<
class Element>
1474 Element *rp =
const_cast<Element *
>(this->fDataPtr);
1475 for ( ; rp < this->fDataPtr+this->fNindex; rp++)
1482 template<
class Element>
1486 Element *rp =
const_cast<Element *
>(this->fDataPtr);
1487 for ( ; rp < this->fDataPtr+this->fNindex; rp++)
1494 template<
class Element>
1498 if (this->
fMatrix == mt)
return;
1503 Error(
"operator=(const TMatrixTSparseRow_const &)",
"matrix rows not compatible");
1508 const Int_t row1 = this->fRowInd+this->
fMatrix->GetRowLwb();
1516 const Int_t sIndex = this->
fMatrix->GetRowIndexArray()[this->fRowInd];
1517 const Int_t eIndex = this->
fMatrix->GetRowIndexArray()[this->fRowInd+1];
1518 this->fNindex = eIndex-sIndex;
1519 this->fColPtr = this->
fMatrix->GetColIndexArray()+sIndex;
1520 this->fDataPtr = this->
fMatrix->GetMatrixArray()+sIndex;
1527 template<
class Element>
1534 Error(
"operator=(const TVectorT &)",
"vector length != matrix-row length");
1539 const Int_t row = this->fRowInd+this->
fMatrix->GetRowLwb();
1543 const Int_t sIndex = this->
fMatrix->GetRowIndexArray()[this->fRowInd];
1544 const Int_t eIndex = this->
fMatrix->GetRowIndexArray()[this->fRowInd+1];
1545 this->fNindex = eIndex-sIndex;
1546 this->fColPtr = this->
fMatrix->GetColIndexArray()+sIndex;
1547 this->fDataPtr = this->
fMatrix->GetMatrixArray()+sIndex;
1553 template<
class Element>
1561 Error(
"operator+=(const TMatrixTRow_const &)",
"different row lengths");
1566 const Int_t row1 = this->fRowInd+this->
fMatrix->GetRowLwb();
1577 const Int_t sIndex = this->
fMatrix->GetRowIndexArray()[this->fRowInd];
1578 const Int_t eIndex = this->
fMatrix->GetRowIndexArray()[this->fRowInd+1];
1579 this->fNindex = eIndex-sIndex;
1580 this->fColPtr = this->
fMatrix->GetColIndexArray()+sIndex;
1581 this->fDataPtr = this->
fMatrix->GetMatrixArray()+sIndex;
1588 template<
class Element>
1596 Error(
"operator+=(const TMatrixTRow_const &)",
"different row lengths");
1613 const Int_t sIndex = this->
fMatrix->GetRowIndexArray()[this->fRowInd];
1614 const Int_t eIndex = this->
fMatrix->GetRowIndexArray()[this->fRowInd+1];
1615 this->fNindex = eIndex-sIndex;
1616 this->fColPtr = this->
fMatrix->GetColIndexArray()+sIndex;
1617 this->fDataPtr = this->
fMatrix->GetMatrixArray()+sIndex;
1623 template<
class Element>
1635 template<
class Element>
1639 if (i < fNdiag && i >= 0) {
1642 const Element *
const pD =
fMatrix->GetMatrixArray();
1643 const Int_t sIndex = pR[i];
1644 const Int_t eIndex = pR[i+1];
1646 if (index >= sIndex && pC[index] == i)
return pD[index];
1649 Error(
"operator()",
"Request diagonal(%d) outside matrix range of 0 - %d",i,fNdiag);
1658 template<
class Element>
1667 template<
class Element>
1676 template<
class Element>
1680 if (i < this->fNdiag && i >= 0) {
1681 const Int_t *
const pR = this->
fMatrix->GetRowIndexArray();
1682 const Int_t *
const pC = this->
fMatrix->GetColIndexArray();
1683 const Element *
const pD = this->
fMatrix->GetMatrixArray();
1684 const Int_t sIndex = pR[i];
1685 const Int_t eIndex = pR[i+1];
1687 if (index >= sIndex && pC[index] == i)
return pD[index];
1690 Error(
"operator()",
"Request diagonal(%d) outside matrix range of 0 - %d",i,this->fNdiag);
1699 template<
class Element>
1704 if (i < 0 || i >= this->fNdiag) {
1705 Error(
"operator()(Int_t",
"Requested element %d outside range : 0 - %d",i,this->fNdiag);
1706 return (const_cast<Element*>(this->fDataPtr))[0];
1712 Int_t sIndex = pR[i];
1713 Int_t eIndex = pR[i+1];
1715 if (index >= sIndex && pC[index] == i)
1716 return (const_cast<Element*>(this->fDataPtr))[index];
1728 if (index >= sIndex && pC[index] == i)
1729 return (const_cast<Element*>(this->fDataPtr))[index];
1731 Error(
"operator()(Int_t",
"Insert row failed");
1732 return (const_cast<Element*>(this->fDataPtr))[0];
1740 template<
class Element>
1744 for (
Int_t i = 0; i < this->fNdiag; i++)
1751 template<
class Element>
1755 for (
Int_t i = 0; i < this->fNdiag; i++)
1762 template<
class Element>
1766 for (
Int_t i = 0; i < this->fNdiag; i++)
1773 template<
class Element>
1777 if (this->
fMatrix == mt)
return;
1782 Error(
"operator=(const TMatrixTSparseDiag_const &)",
"matrix-diagonal's different length");
1786 for (
Int_t i = 0; i < this->fNdiag; i++)
1793 template<
class Element>
1799 if (this->fNdiag != vec.
GetNrows()) {
1800 Error(
"operator=(const TVectorT &)",
"vector length != matrix-diagonal length");
1805 for (
Int_t i = 0; i < this->fNdiag; i++)
1813 template<
class Element>
1821 Error(
"operator+=(const TMatrixTSparseDiag_const &)",
"matrix-diagonal's different length");
1825 for (
Int_t i = 0; i < this->fNdiag; i++)
1826 (*
this)(i) += md(i);
1833 template<
class Element>
1841 Error(
"operator*=(const TMatrixTSparseDiag_const &)",
"matrix-diagonal's different length");
1845 for (
Int_t i = 0; i < this->fNdiag; i++)
1846 (*
this)(i) *= md(i);
1864 Int_t leftloint = (int) leftlo;
1870 ix = (((xalo-leftlo*b16)-p)+(fhi-k*b15)*b16)+k;
1871 if (ix < 0.0) ix = ix+p;
1873 return (ix*4.656612875e-10);
void Rank1Update(const TVectorT< Element > &vec, Element alpha=1.0)
Perform a rank 1 operation on the matrix: A += alpha * v * v^T.
Element operator()(Int_t i) const
virtual const Element * GetMatrixArray() const =0
virtual TMatrixTBase< Element > & InsertRow(Int_t row, Int_t col, const Element *v, Int_t n=-1)
Insert in row rown, n elements of array v at column coln.
virtual void ExtractRow(Int_t row, Int_t col, Element *v, Int_t n=-1) const
Store in array v, n matrix elements of row rown starting at column coln.
virtual TMatrixTBase< Element > & ResizeTo(Int_t nrows, Int_t ncols, Int_t=-1)
Set size of the matrix to nrows x ncols New dynamic elements are created, the overlapping part of the...
Int_t GetRowIndex() const
void operator+=(Element val)
Add val to every element of the matrix column.
virtual const Element * GetMatrixArray() const
void operator*=(Element val)
Multiply every element of the matrix with val.
TMatrixTSparseDiag_const()
void operator+=(Element val)
Assign val to every element of the matrix diagonal.
Double_t Drand(Double_t &ix)
Random number generator [0....1] with seed ix.
void operator*=(Element val)
Multiply every element of the sub matrix by val .
Int_t GetNoElements() const
const TMatrixTBase< Element > * GetMatrix() const
Short_t Min(Short_t a, Short_t b)
void operator=(Element val)
Assign val to every element of the matrix diagonal.
void operator+=(Element val)
Add val to every non-zero (!) element of the matrix row.
void operator*=(Element val)
Multiply every element of the matrix row with val.
virtual TMatrixTBase< Element > & ResizeTo(Int_t nrows, Int_t ncols, Int_t=-1)
Set size of the matrix to nrows x ncols New dynamic elements are created, the overlapping part of the...
const TMatrixTBase< Element > * GetMatrix() const
TMatrixTSparseRow_const()
Element operator()(Int_t i) const
Element operator()(Int_t i) const
void operator*=(Element val)
Multiply every element of the matrix diagonal by val.
static double p2(double t, double a, double b, double c)
const TMatrixTBase< Element > * GetMatrix() const
void Error(const char *location, const char *msgfmt,...)
virtual const Element * GetMatrixArray() const
void operator=(Element val)
Assign val to every element of the matrix column.
Element * GetMatrixArray()
void operator=(Element val)
Assign val to every element of the matrix.
virtual const Int_t * GetRowIndexArray() const
const TMatrixTBase< Element > * GetMatrix() const
TMatrixT< Element > & ElementMult(TMatrixT< Element > &target, const TMatrixT< Element > &source)
Multiply target by the source, element-by-element.
Int_t GetColIndex() const
virtual const Element * GetMatrixArray() const
static double p1(double t, double a, double b)
const TMatrixTBase< Element > * GetMatrix() const
Int_t GetRowIndex() const
void operator+=(Element val)
Add val to every element of the sub matrix.
const TMatrixTBase< Element > * GetMatrix() const
void operator+=(Element val)
Add val to every element of the matrix.
void operator=(Element val)
Assign val to every element of the sub matrix.
const Element * GetPtr() const
void operator+=(Element val)
Add val to every element of the matrix diagonal.
const Element * GetPtr() const
void operator=(Element val)
Assign val to every element of the matrix row.
virtual const Int_t * GetColIndexArray() const
void operator*=(Element val)
Multiply every element of the matrix row by val.
Int_t GetNoElements() const
const Element * GetPtr() const
const TMatrixTBase< Element > * GetMatrix() const
const Element * GetPtr() const
void operator*=(Element val)
Multiply every element of the matrix column with val.
Short_t Max(Short_t a, Short_t b)
Element operator()(Int_t i) const
static Element & NaNValue()
void operator=(Element val)
Assign val to every non-zero (!) element of the matrix row.
void operator*=(Element val)
Assign val to every element of the matrix diagonal.
virtual TMatrixTBase< Element > & GetSub(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb, TMatrixTBase< Element > &target, Option_t *option="S") const =0
void operator+=(Element val)
Add val to every element of the matrix row.
Long64_t BinarySearch(Long64_t n, const T *array, T value)
void operator=(Element val)
Assign val to every element of the matrix diagonal.