Exemplo n.º 1
0
 inline const T& KVector<T, BEG, DBG>::operator()(K_UINT_32 i) const {
   if (DBG) {
     if (i < BEG || i >= n_ + BEG) {
       KOSTRINGSTREAM oss;
       oss << "Trying to access element " << i << " not included in ["
           << BEG << ", " << n_ + BEG - 1 << "]." KEND_OF_STREAM;
       throw OutOfBoundError(oss.str());
     }
   }
   return v_[i];
 }
Exemplo n.º 2
0
 inline const T& KMatrix<T, BEG, DBG>::operator()(K_UINT_32 i, 
                                                  K_UINT_32 j) const {
   if (DBG) {
     if (i < BEG || i >= m_ + BEG || j < BEG || j >= n_ + BEG) {
       KOSTRINGSTREAM oss;
       oss << "Trying to access element (" << i << ", " << j 
           << ") not included in [" << BEG << ", " << m_ + BEG - 1 << "][" 
           << BEG << ", " << n_ + BEG - 1 << "]." KEND_OF_STREAM;
       throw OutOfBoundError(oss.str());
     }
   }
   return M_[i][j];
 }