diff --git a/fourindex.h b/fourindex.h index 414acfb..e3dd4ff 100644 --- a/fourindex.h +++ b/fourindex.h @@ -640,13 +640,14 @@ unsigned long I = SMat_index_1(i,j); unsigned long J = SMat_index_1(k,l); //I,J act as indices of a NRSmat #ifdef DEBUG - if (*count != 1) laerror("lval (i,j,k,l) with count > 1 in fourindex_dense"); - if (I<0 || I>=(unsigned long)nn || J<0 || J>=(unsigned long)nn) laerror("fourindex_dense index out of range"); + if (*NRSMat::count != 1) laerror("lval (i,j,k,l) with count > 1 in fourindex_dense"); + if (I<0 || I>=(unsigned long)NRSMat::nn || J<0 || J>=(unsigned long)NRSMat::nn) laerror("fourindex_dense index out of range"); if (!NRSMat::v) laerror("access to unallocated fourindex_dense"); #endif return NRSMat::v[SMat_index(I,J)]; } + template const T& fourindex_dense::operator() (unsigned int i, unsigned int j, unsigned int k, unsigned int l) const { @@ -654,7 +655,7 @@ unsigned long I = SMat_index_1(i,j); unsigned long J = SMat_index_1(k,l); //I,J act as indices of a NRSmat #ifdef DEBUG - if (I<0 || I>=(unsigned long)nn || J<0 || J>=(unsigned long)nn) laerror("fourindex_dense index out of range"); + if (I<0 || I>=(unsigned long)NRSMat::nn || J<0 || J>=(unsigned long)NRSMat::nn) laerror("fourindex_dense index out of range"); if (!NRSMat::v) laerror("access to unallocated fourindex_dense"); #endif return NRSMat::v[SMat_index(I,J)]; diff --git a/smat.h b/smat.h index b1e0c11..f13cf5d 100644 --- a/smat.h +++ b/smat.h @@ -542,14 +542,14 @@ public: inline const T& operator() (const int i, const int j) const { #ifdef DEBUG - if(i<=0||j<=0||i>nn||j>nn) laerror("index out of range in NRSMat_from1"); + if(i<=0||j<=0||i>NRSMat::nn||j>NRSMat::nn) laerror("index out of range in NRSMat_from1"); #endif return NRSMat::v[SMat_index_1(i,j)]; } inline T& operator() (const int i, const int j) { #ifdef DEBUG - if(i<=0||j<=0||i>nn||j>nn) laerror("index out of range in NRSMat_from1"); + if(i<=0||j<=0||i>NRSMat::nn||j>NRSMat::nn) laerror("index out of range in NRSMat_from1"); #endif return NRSMat::v[SMat_index_1(i,j)]; }