20 #ifndef SELDON_FILE_BAND_MATRIX_CXX
22 #include "BandMatrixInline.cxx"
33 template <
class T,
class Prop,
class Storage,
class Allocator>
44 template <
class T,
class Prop,
class Storage,
class Allocator>
56 template <
class T,
class Prop,
class Storage,
class Allocator>
64 data_.Reallocate(2*kl_+ku_+1, this->n_);
70 template <
class T,
class Prop,
class Storage,
class Allocator>
74 int k = kl_ + ku_ + i - j;
75 if ((k >= kl_) && (k <= 2*kl_+ku_))
79 cout <<
"Matrix not compatible " << endl;
92 template <
class T,
class Prop,
class Storage,
class Allocator>
97 for (
int j = 0; j < n; j++)
98 AddInteraction(i, num(j), val(j));
106 template <
class T,
class Prop,
class Storage,
class Allocator>
109 T zero; SetComplexZero(zero);
110 for (
int k = max(-i, -this->kl_); k <= min(this->ku_, this->n_-1-i); k++)
113 this->Get(i, j) = zero;
119 template <
class T,
class Prop,
class Storage,
class Allocator>
123 T zero; SetComplexZero(zero);
124 int k = kl_ + ku_ + i - j;
125 if ((k >= kl_) && (k <= 2*kl_+ku_))
133 template <
class T,
class Prop,
class Storage,
class Allocator>
136 int k = kl_ + ku_ + i - j;
137 if ((k >= kl_) && (k <= 2*kl_+ku_))
141 cout <<
"Element not accessible " << endl;
148 template <
class T,
class Prop,
class Storage,
class Allocator>
151 int k = kl_ + ku_ + i - j;
152 if ((k >= kl_) && (k <= 2*kl_+ku_))
156 cout <<
"Element not accessible " << endl;
163 template <
class T,
class Prop,
class Storage,
class Allocator>
166 T zero, one; SetComplexZero(zero);
170 for (
int i = 0; i < this->n_; i++)
171 data_(kl_+ku_, i) = one;
176 template <
class T,
class Prop,
class Storage,
class Allocator>
182 T zero; SetComplexZero(zero);
183 for (
int i = 0; i < this->n_; i++)
184 for (
int j = 0; j < kl_; j++)
190 template <
class T,
class Prop,
class Storage,
class Allocator>
195 T zero; SetComplexZero(zero);
196 for (
int i = 0; i < this->n_; i++)
197 for (
int j = 0; j < kl_; j++)
203 template <
class T,
class Prop,
class Storage,
class Allocator>
211 for (
int i = 0; i < A.GetM(); i++)
212 for (
int j = 0; j < A.GetRowSize(i); j++)
214 int col = A.Index(i, j);
221 Reallocate(A.GetM(), A.GetN(), kl, ku);
222 T zero; SetComplexZero(zero);
226 for (
int i = 0; i < A.GetM(); i++)
227 for (
int j = 0; j < A.GetRowSize(i); j++)
228 AddInteraction(i, A.Index(i, j), A.Value(i, j));
234 template <
class T,
class Prop,
class Storage,
class Allocator>
241 for (
int j = 0; j < this->n_; j++)
244 data_(d, j) = one/data_(d, j);
245 for (
int p = 1; p <= min(this->m_ - 1 - j, kl_); p++)
247 pivot = data_(d+p, j)*data_(d, j);
248 data_(d+p, j) = pivot;
249 for (
int k = 1; k <= min(this->n_ - 1 - j, ku_); k++)
250 data_(d+p-k, j+k) -= pivot*data_(d-k, j+k);
257 template <
class T,
class Prop,
class Storage,
class Allocator>
260 ipivot.Reallocate(this->m_);
264 typename ClassComplexType<T>::Treal amax;
266 for (
int j = 0; j < this->n_; j++)
269 int pmin = min(this->m_ - 1 - j, kl_);
270 amax = abs(data_(d, j));
272 for (
int p = 1; p <= pmin; p++)
273 if (abs(data_(d+p, j)) > amax)
276 amax = abs(data_(d+p, j));
283 for (
int j2 = j; j2 <= min(this->m_-1, kl_ + ku_ + j); j2++)
285 int k = kl_ + ku_ + j - j2;
287 data_(k, j2) = data_(k+p0, j2);
288 data_(k+p0, j2) = tmp;
293 data_(d, j) = one/data_(d, j);
296 for (
int p = 1; p <= pmin; p++)
298 pivot = data_(d+p, j)*data_(d, j);
299 data_(d+p, j) = pivot;
301 for (
int k = 1; k <= min(this->n_ - 1 - j, kl_ + ku_); k++)
302 data_(d+p-k, j+k) -= pivot*data_(d-k, j+k);
309 template <
class T,
class Prop,
class Storage,
class Allocator>
315 for (
int i = 0; i < A.
GetM(); i++)
316 for (
int k = max(-i, -kl); k <= min(ku, this->n_-1-i); k++)
319 AddInteraction(i, j, alpha*A(i, j));
325 template <
class T,
class Prop,
class Storage,
class Allocator>
326 template<
class T0,
class T1>
331 int d = kl_ + ku_; T1 val;
334 for (
int j = 0; j < GetN(); j++)
336 int kmin = max(kl_, d - j), row;
337 int kmax = min(kl_ + d, this->m_ -1 + d - j);
339 for (
int k = kmin; k <= kmax; k++)
342 y(row) = y(row) + data_(k, j)*val;
346 else if (trans.Trans())
348 for (
int j = 0; j < GetN(); j++)
350 int kmin = max(kl_, d - j), row;
351 int kmax = min(kl_ + d, this->m_ -1 + d - j);
353 for (
int k = kmin; k <= kmax; k++)
356 val += data_(k, j)*x(row);
364 for (
int j = 0; j < GetN(); j++)
366 int kmin = max(kl_, d - j), row;
367 int kmax = min(kl_ + d, this->m_ -1 + d - j);
369 for (
int k = kmin; k <= kmax; k++)
372 val += conjugate(data_(k, j))*x(row);
382 template <
class T,
class Prop,
class Storage,
class Allocator>
388 for (
int j = 0; j < this->n_; j++)
389 for (
int p = 1; p <= min(this->m_ - 1 - j, kl_); p++)
390 x(j+p) -= data_(d+p, j)*x(j);
393 for (
int j = this->n_-1; j >= 0; j--)
396 for (
int p = 1; p <= min(j, ku_); p++)
397 x(j-p) -= data_(d-p, j)*x(j);
404 template <
class T,
class Prop,
class Storage,
class Allocator>
411 for (
int j = 0; j < this->n_; j++)
421 for (
int p = 1; p <= min(this->m_ - 1 - j, kl_); p++)
422 x(j+p) -= data_(d+p, j)*x(j);
426 for (
int j = this->n_-1; j >= 0; j--)
429 for (
int p = 1; p <= min(j, kl_+ku_); p++)
430 x(j-p) -= data_(d-p, j)*x(j);
436 template <
class T,
class Prop,
class Storage,
class Allocator>
440 FileStream.open(FileName.c_str());
442 #ifdef SELDON_CHECK_IO
444 if (!FileStream.is_open())
445 throw IOError(
"Matrix_Band::Write(string FileName)",
446 string(
"Unable to open file \"") + FileName +
"\".");
449 this->Write(FileStream);
456 template <
class T,
class Prop,
class Storage,
class Allocator>
460 FileStream.write(
reinterpret_cast<char*
>(
const_cast<int*
>(&this->m_)),
462 FileStream.write(
reinterpret_cast<char*
>(
const_cast<int*
>(&this->n_)),
464 FileStream.write(
reinterpret_cast<char*
>(
const_cast<int*
>(&this->kl_)),
466 FileStream.write(
reinterpret_cast<char*
>(
const_cast<int*
>(&this->ku_)),
469 data_.Write(FileStream,
false);
474 template <
class T,
class Prop,
class Storage,
class Allocator>
479 FileStream.precision(cout.precision());
480 FileStream.flags(cout.flags());
481 FileStream.open(FileName.c_str());
483 #ifdef SELDON_CHECK_IO
485 if (!FileStream.is_open())
486 throw IOError(
"TinyBandMatrix::WriteText(string FileName)",
487 string(
"Unable to open file \"") + FileName +
"\".");
490 this->WriteText(FileStream);
497 template <
class T,
class Prop,
class Storage,
class Allocator>
502 for (
int j = 0; j < GetN(); j++)
504 int kmin = max(kl_, d - j);
506 int kmax = min(kl_ + d, this->m_ -1 + d - j);
507 for (
int k = kmin; k <= kmax; k++)
511 << row + 1 <<
" " << j+1 <<
" " << data_(k, j) <<
'\n';
523 template <
class T,
class Prop,
class Storage,
class Allocator>
529 last_columns_.Clear();
535 template <
class T,
class Prop,
class Storage,
class Allocator>
540 last_columns_.Zero();
546 template <
class T,
class Prop,
class Storage,
class Allocator>
549 int nb_last_row,
int nb_last_col)
552 Reallocate(m-nb_last_row, n-nb_last_col, kl, ku);
554 last_rows_.Reallocate(nb_last_row, n-nb_last_col);
555 last_columns_.Reallocate(m-nb_last_row, nb_last_col);
556 last_block_.Reallocate(nb_last_row, nb_last_col);
561 template <
class T,
class Prop,
class Storage,
class Allocator>
568 last_block_(i-this->m_, j-this->n_) += val;
570 last_rows_(i-this->m_, j) += val;
575 last_columns_(i, j-this->n_) += val;
590 template <
class T,
class Prop,
class Storage,
class Allocator>
595 for (
int j = 0; j < n; j++)
596 AddInteraction(i, num(j), val(j));
604 template <
class T,
class Prop,
class Storage,
class Allocator>
607 T zero; SetComplexZero(zero);
610 for (
int k = max(-i, -this->kl_);
611 k <= min(this->ku_, this->n_-1-i); k++)
614 this->Get(i, j) = zero;
617 for (
int j = 0; j < last_columns_.GetN(); j++)
618 this->Get(i, this->n_+j) = zero;
622 for (
int j = 0; j < this->n_+this->last_columns_.GetN(); j++)
623 this->Get(i, j) = zero;
629 template <
class T,
class Prop,
class Storage,
class Allocator>
636 return last_block_(i-this->m_, j-this->n_);
638 return last_rows_(i-this->m_, j);
642 return last_columns_(i, j-this->n_);
650 template <
class T,
class Prop,
class Storage,
class Allocator>
654 this->data_ *= alpha;
656 last_columns_ *= alpha;
657 last_block_ *= alpha;
663 template <
class T,
class Prop,
class Storage,
class Allocator>
669 return last_block_(i-this->m_, j-this->n_);
671 return last_rows_(i-this->m_, j);
675 return last_columns_(i, j-this->n_);
682 template <
class T,
class Prop,
class Storage,
class Allocator>
688 return last_block_(i-this->m_, j-this->n_);
690 return last_rows_(i-this->m_, j);
694 return last_columns_(i, j-this->n_);
701 template <
class T,
class Prop,
class Storage,
class Allocator>
707 SetComplexZero(zero);
709 last_rows_.Fill(zero);
710 last_columns_.Fill(zero);
711 last_block_.Fill(zero);
712 for (
int i = min(this->m_, this->n_); i < this->GetM(); i++)
713 this->Get(i, i) = one;
718 template <
class T,
class Prop,
class Storage,
class Allocator>
724 this->data_.Fill(x_);
726 last_columns_.Fill(x_);
727 last_block_.Fill(x_);
732 template <
class T,
class Prop,
class Storage,
class Allocator>
735 this->data_.FillRand();
736 last_rows_.FillRand();
737 last_columns_.FillRand();
738 last_block_.FillRand();
743 template <
class T,
class Prop,
class Storage,
class Allocator>
747 int d = this->kl_ + this->ku_;
751 int nb_last_row = last_rows_.GetM();
752 int nb_last_col = last_columns_.GetN();
753 T one; SetComplexOne(one);
754 for (
int j = 0; j < this->n_; j++)
759 diag = one / this->last_rows_(j-this->m_, j);
760 this->last_rows_(j-this->m_, j) = diag;
764 this->data_(d, j) = one / this->data_(d, j);
765 diag = this->data_(d, j);
769 for (
int p = 1; p <= min(this->m_ - 1 - j, this->kl_); p++)
771 pivot = this->data_(d+p, j)*diag;
772 this->data_(d+p, j) = pivot;
774 for (
int k = 1; k <= min(this->n_ - 1 - j, this->ku_); k++)
775 this->data_(d+p-k, j+k) -= pivot*this->data_(d-k, j+k);
778 for (
int k = 0; k < nb_last_col; k++)
779 last_columns_(j+p, k) -= pivot*last_columns_(j, k);
783 for (
int p = max(0, j-this->m_+1); p < nb_last_row; p++)
785 pivot = last_rows_(p, j)*diag;
786 last_rows_(p, j) = pivot;
789 for (
int k = j+1; k < this->n_; k++)
790 last_rows_(p, k) -= pivot*this->last_rows_(j-this->m_, k);
793 for (
int k = 0; k < nb_last_col; k++)
794 last_block_(p, k) -= pivot*last_block_(j-this->m_, k);
798 for (
int k = 1; k <= min(this->n_ - 1 - j, this->ku_); k++)
799 last_rows_(p, j+k) -= pivot*this->data_(d-k, j+k);
802 for (
int k = 0; k < nb_last_col; k++)
803 last_block_(p, k) -= pivot*last_columns_(j, k);
809 for (
int j = this->n_; j < this->GetM(); j++)
813 diag = one / last_block_(j-this->m_, j-this->n_);
814 last_block_(j-this->m_, j-this->n_) = diag;
818 diag = one / last_columns_(j, j-this->n_);
819 last_columns_(j, j-this->n_) = diag;
822 for (
int i = j+1; i < this->m_; i++)
824 pivot = last_columns_(i, j-this->n_)*diag;
825 last_columns_(i, j-this->n_) = pivot;
826 for (
int k = j+1; k < this->GetM(); k++)
827 last_columns_(i, k-this->n_)
828 -= pivot*last_columns_(j, k-this->n_);
833 for (
int i = max(j+1,this->m_); i < this->GetM(); i++)
835 pivot = last_block_(i-this->m_, j-this->n_)*diag;
836 last_block_(i-this->m_, j-this->n_) = pivot;
838 for (
int k = j+1; k < this->GetM(); k++)
839 last_block_(i-this->m_, k-this->n_)
840 -= pivot*last_block_(j-this->m_, k-this->n_);
842 for (
int k = j+1; k < this->GetM(); k++)
843 last_block_(i-this->m_, k-this->n_)
844 -= pivot*last_columns_(j, k-this->n_);
851 template <
class T,
class Prop,
class Storage,
class Allocator>
861 for (
int i = 0; i < m; i++)
862 for (
int k = max(-i, -kl); k <= min(ku, n-1-i); k++)
865 AddInteraction(i, j, alpha*A(i, j));
870 for (
int j = 0; j < A.
GetN(); j++)
871 AddInteraction(m+i, j, alpha*A(m+i, j));
875 for (
int i = 0; i < m; i++)
876 AddInteraction(i, n+j, alpha*A(i, n+j));
881 template <
class T,
class Prop,
class Storage,
class Allocator>
882 template<
class T0,
class T1>
890 T1 val, zero; SetComplexZero(zero);
894 for (
int i = 0; i < last_rows_.GetM(); i++)
897 for (
int j = 0; j < this->n_; j++)
898 val += last_rows_(i, j)*x(j);
900 y(this->m_ + i) += alpha*val;
904 for (
int j = 0; j < last_columns_.GetN(); j++)
906 val = alpha*x(this->n_+j);
907 for (
int i = 0; i < this->m_; i++)
908 y(i) += last_columns_(i, j)*val;
912 for (
int i = 0; i < last_block_.GetM(); i++)
915 for (
int j = 0; j < last_block_.GetN(); j++)
916 val += last_block_(i, j)*x(this->n_+j);
918 y(this->m_+i) += alpha*val;
921 else if (trans.Trans())
924 for (
int i = 0; i < last_rows_.GetM(); i++)
926 val = alpha*x(this->m_ + i);
927 for (
int j = 0; j < this->n_; j++)
928 y(j) += last_rows_(i, j)*val;
932 for (
int j = 0; j < last_columns_.GetN(); j++)
935 for (
int i = 0; i < this->m_; i++)
936 val += last_columns_(i, j)*x(i);
938 y(this->n_+j) += alpha*val;
942 for (
int i = 0; i < last_block_.GetM(); i++)
944 val = alpha*x(this->m_+i);
945 for (
int j = 0; j < last_block_.GetN(); j++)
946 y(this->n_+j) += last_block_(i, j)*val;
952 for (
int i = 0; i < last_rows_.GetM(); i++)
954 val = alpha*x(this->m_ + i);
955 for (
int j = 0; j < this->n_; j++)
956 y(j) += conjugate(last_rows_(i, j))*val;
960 for (
int j = 0; j < last_columns_.GetN(); j++)
963 for (
int i = 0; i < this->m_; i++)
964 val += conjugate(last_columns_(i, j))*x(i);
966 y(this->n_+j) += alpha*val;
970 for (
int i = 0; i < last_block_.GetM(); i++)
972 val = alpha*x(this->m_+i);
973 for (
int j = 0; j < last_block_.GetN(); j++)
974 y(this->n_+j) += conjugate(last_block_(i, j))*val;
981 template <
class T,
class Prop,
class Storage,
class Allocator>
985 int d = this->kl_ + this->ku_;
989 for (
int j = 0; j < min(this->m_, this->n_); j++)
990 for (
int p = 1; p <= min(this->m_ - 1 - j, this->kl_); p++)
991 x(j+p) -= this->data_(d+p, j)*x(j);
994 if (this->m_ > this->n_)
995 for (
int j = this->n_; j < this->m_; j++)
996 for (
int k = j+1; k < this->m_; k++)
997 x(k) -= last_columns_(k, j-this->n_)*x(j);
999 for (
int j = this->m_; j < this->n_; j++)
1000 for (
int k = 0; k < j; k++)
1001 x(j) -= last_rows_(j-this->m_, k)*x(k);
1004 for (
int i = max(this->m_, this->n_); i < this->GetM(); i++)
1006 for (
int j = 0; j < this->n_; j++)
1007 x(i) -= last_rows_(i-this->m_, j)*x(j);
1009 for (
int j = this->n_; j < i; j++)
1010 x(i) -= last_block_(i-this->m_, j-this->n_)*x(j);
1016 int N = this->GetM();
1017 for (
int i = N-1; i >= max(this->m_, this->n_); i--)
1019 x(i) *= last_block_(i-this->m_, i-this->n_);
1020 for (
int j = this->m_; j < i; j++)
1021 x(j) -= last_block_(j-this->m_, i-this->n_)*x(i);
1023 for (
int j = 0; j < this->m_; j++)
1024 x(j) -= last_columns_(j, i-this->n_)*x(i);
1028 if (this->m_ > this->n_)
1029 for (
int i = this->m_-1; i >= this->n_; i--)
1031 x(i) *= last_columns_(i, i-this->n_);
1032 for (
int j = 0; j < i; j++)
1033 x(j) -= last_columns_(j, i-this->n_)*x(i);
1036 for (
int i = this->n_-1; i >= this->m_; i--)
1038 for (
int j = i+1; j < this->n_; j++)
1039 x(i) -= last_rows_(i-this->m_, j)*x(j);
1041 x(i) *= last_rows_(i-this->m_, i);
1045 for (
int j = this->n_-1; j >= 0; j--)
1047 if (j < min(this->m_, this->n_))
1048 x(j) *= this->data_(d, j);
1050 for (
int p = 1; p <= min(j, this->ku_); p++)
1052 x(j-p) -= this->data_(d-p, j)*x(j);
1058 template <
class T,
class Prop,
class Storage,
class Allocator>
1062 ofstream FileStream;
1063 FileStream.open(FileName.c_str());
1065 #ifdef SELDON_CHECK_IO
1067 if (!FileStream.is_open())
1068 throw IOError(
"Matrix_Arrow::Write(string FileName)",
1069 string(
"Unable to open file \"") + FileName +
"\".");
1072 this->Write(FileStream);
1079 template <
class T,
class Prop,
class Storage,
class Allocator>
1085 last_rows_.Write(FileStream);
1086 last_columns_.Write(FileStream);
1087 last_block_.Write(FileStream);
1092 template <
class T,
class Prop,
class Storage,
class Allocator>
1096 ofstream FileStream;
1097 FileStream.precision(cout.precision());
1098 FileStream.flags(cout.flags());
1099 FileStream.open(FileName.c_str());
1101 #ifdef SELDON_CHECK_IO
1103 if (!FileStream.is_open())
1104 throw IOError(
"TinyBandMatrix::WriteText(string FileName)",
1105 string(
"Unable to open file \"") + FileName +
"\".");
1108 this->WriteText(FileStream);
1115 template <
class T,
class Prop,
class Storage,
class Allocator>
1119 int d = this->kl_ + this->ku_;
1120 for (
int j = 0; j < this->n_; j++)
1122 int kmin = max(this->kl_, d - j);
1123 int kmax = min(this->kl_ + d, this->m_ -1 + d - j);
1124 for (
int k = kmin; k <= kmax; k++)
1126 int row = j + k - d;
1128 << row + 1 <<
" " << j+1 <<
" " << this->data_(k, j) <<
'\n';
1131 for (
int k = 0; k < last_rows_.GetM(); k++)
1133 int row = this->m_ + k;
1135 << row + 1 <<
" " << j+1 <<
" " << last_rows_(k, j) <<
'\n';
1139 for (
int j = 0; j < last_columns_.GetN(); j++)
1141 for (
int i = 0; i < this->m_; i++)
1142 FileStream << i+1 <<
" " << this->n_+j+1 <<
" "
1143 << last_columns_(i, j) <<
'\n';
1145 for (
int i = 0; i < last_block_.GetM(); i++)
1146 FileStream << this->m_+i+1 <<
" " << this->n_+j+1
1147 <<
" " << last_block_(i, j) <<
'\n';
1158 template<
class T,
class Allocator>
1172 template<
class T,
class Allocator>
1180 template<
class Allocator>
1184 #ifdef SELDON_WITH_LAPACK
1187 #ifdef SELDON_CHECK_BOUNDS
1188 if ((m <= 0)||(n <= 0))
1189 throw WrongDim(
"GetLU",
"Provide a non-empty matrix");
1192 ipivot.Reallocate(m);
1195 int lda = 2*kl + ku + 1;
1196 dgbtrf_(&m, &n, &kl, &ku, A.GetData(), &lda,
1197 ipivot.GetData(), &info.GetInfoRef());
1199 #ifdef SELDON_LAPACK_CHECK_INFO
1200 if (info.GetInfo() != 0)
1202 "An error occured during the factorization.");
1207 A.Factorize(ipivot);
1214 template<
class Allocator>
1219 #ifdef SELDON_WITH_LAPACK
1224 int lda = 2*kl + ku + 1;
1227 dgbtrs_(&trans, &n, &kl, &ku, &nrhs, A.GetData(), &lda,
1228 ipivot.GetData(), b.GetData(), &ldb, &info.GetInfoRef());
1238 template<
class Allocator>
1243 #ifdef SELDON_WITH_LAPACK
1248 int lda = 2*kl + ku + 1;
1253 for (
int i = 0; i < n; i++)
1255 brhs(i, 0) = real(b(i));
1256 brhs(i, 1) = imag(b(i));
1259 dgbtrs_(&trans, &n, &kl, &ku, &nrhs, A.GetData(), &lda,
1260 ipivot.GetData(), brhs.GetData(), &ldb, &info.GetInfoRef());
1262 for (
int i = 0; i < n; i++)
1263 b(i) = complex<double>(brhs(i, 0), brhs(i, 1));
1274 template<
class Allocator>
1278 #ifdef SELDON_WITH_LAPACK
1281 #ifdef SELDON_CHECK_BOUNDS
1282 if ((m <= 0)||(n <= 0))
1283 throw WrongDim(
"GetLU",
"Provide a non-empty matrix");
1286 ipivot.Reallocate(m);
1289 int lda = 2*kl + ku + 1;
1290 zgbtrf_(&m, &n, &kl, &ku, A.GetData(), &lda,
1291 ipivot.GetData(), &info.GetInfoRef());
1293 #ifdef SELDON_LAPACK_CHECK_INFO
1294 if (info.GetInfo() != 0)
1296 "An error occured during the factorization.");
1301 A.Factorize(ipivot);
1308 template<
class Allocator>
1314 #ifdef SELDON_WITH_LAPACK
1319 int lda = 2*kl + ku + 1;
1322 zgbtrs_(&trans, &n, &kl, &ku, &nrhs, A.GetData(), &lda,
1323 ipivot.GetData(), b.GetDataVoid(), &ldb, &info.GetInfoRef());
1333 template<
class T,
class Allocator>
1342 template<
class T,
class Allocator>
1351 template<
class T,
class Allocator>
1365 template<
class T,
class Prop,
class Allocator,
1366 class T1,
class Allocator1,
class T2,
class Allocator2>
1371 int kl = A.GetKL(), ku = A.GetKU(), n = A.GetM();
1372 for (
int i = 0; i < A.GetM(); i++)
1373 for (
int j = max(0, i-kl); j < min(n, i+ku+1); j++)
1374 A.Get(i, j) *= Drow(i)*Dcol(j);
1379 #define SELDON_FILE_BAND_MATRIX_CXX