<commit_before>



template<typename eT>
arma_inline
SpSubview<eT>::SpSubview(const SpMat<eT>& in_m, const uword in_row1, const uword in_col1, const uword in_n_rows, const uword in_n_cols)
  : m(in_m)
  , aux_row1(in_row1)
  , aux_col1(in_col1)
  , n_rows(in_n_rows)
  , n_cols(in_n_cols)
  , n_elem(in_n_rows * in_n_cols)
  , n_nonzero(0)
  {
  arma_extra_debug_sigprint();

  // There must be a O(1) way to do this
  uword end     = m.col_ptrs[in_col1 + in_n_cols];
  uword end_row = in_row1 + in_n_rows;
  uword count   = 0;

  for(uword i = m.col_ptrs[in_col1]; i < end; ++i)
    {
    if(m.row_indices[i] >= in_row1 && m.row_indices[i] < end_row)
      {
      ++count;
      }
    }

  access::rw(n_nonzero) = count;
  }



template<typename eT>
arma_inline
SpSubview<eT>::SpSubview(SpMat<eT>& in_m, const uword in_row1, const uword in_col1, const uword in_n_rows, const uword in_n_cols)
  : m(in_m)
  , aux_row1(in_row1)
  , aux_col1(in_col1)
  , n_rows(in_n_rows)
  , n_cols(in_n_cols)
  , n_elem(in_n_rows * in_n_cols)
  , n_nonzero(0)
  {
  arma_extra_debug_sigprint();

  // There must be a O(1) way to do this
  uword end     = m.col_ptrs[in_col1 + in_n_cols];
  uword end_row = in_row1 + in_n_rows;
  uword count   = 0;

  for(uword i = m.col_ptrs[in_col1]; i < end; ++i)
    {
    if(m.row_indices[i] >= in_row1 && m.row_indices[i] < end_row)
      {
      ++count;
      }
    }

  access::rw(n_nonzero) = count;
  }



template<typename eT>
inline
SpSubview<eT>::~SpSubview()
  {
  arma_extra_debug_sigprint();
  }



template<typename eT>
inline
void
SpSubview<eT>::operator+= (const eT val)
  {
  arma_extra_debug_sigprint();

  if(val == 0)
    {
    return;
    }

  const uword start_row = aux_row1;
  const uword end_row   = aux_row1 + n_rows;
  const uword start_col = aux_col1;
  const uword end_col   = aux_col1 + n_cols;

  // iterate over our part of the sparse matrix
  for(uword col = start_col; col < end_col; ++col)
    {
    for(uword row = start_row; row < end_row; ++row)
      {
      access::rw(m).at(row, col) += val;
      }
    }
  }



template<typename eT>
inline
void
SpSubview<eT>::operator-= (const eT val)
  {
  arma_extra_debug_sigprint();

  if(val == 0)
    {
    return;
    }

  const uword start_row = aux_row1;
  const uword end_row   = aux_row1 + n_rows;
  const uword start_col = aux_col1;
  const uword end_col   = aux_col1 + n_cols;


  for(uword col = start_col; col < end_col; ++col)
    {
    for(uword row = start_row; row < end_row; ++row)
      {
      access::rw(m).at(row, col) -= val;
      }
    }
  }



template<typename eT>
inline
void
SpSubview<eT>::operator*= (const eT val)
  {
  arma_extra_debug_sigprint();

  const uword start_row = aux_row1;
  const uword end_row   = aux_row1 + n_rows;
  const uword start_col = aux_col1;
  const uword end_col   = aux_col1 + n_cols;

  for(uword c = start_col; c < end_col;)
    {
    for(uword r = m.col_ptrs[c]; r < m.col_ptrs[++c]; ++r)
      {
      if(m.row_indices[r] >= start_row && m.row_indices[r] < end_row)
        {
        access::rw(m).values[r] *= val;
        }
      }
    }
  }



template<typename eT>
inline
void
SpSubview<eT>::operator/= (const eT val)
  {
  arma_extra_debug_sigprint();

  const uword start_row = aux_row1;
  const uword end_row   = aux_row1 + n_rows;
  const uword start_col = aux_col1;
  const uword end_col   = aux_col1 + n_cols;

  for(uword c = start_col; c < end_col; ++c)
    {
    for(uword r = m.col_ptrs[c]; r < m.col_ptrs[++c]; ++r)
      {
      access::rw(m).values[r] /= val;<commit_msg>Unused variables.<commit_after>



template<typename eT>
arma_inline
SpSubview<eT>::SpSubview(const SpMat<eT>& in_m, const uword in_row1, const uword in_col1, const uword in_n_rows, const uword in_n_cols)
  : m(in_m)
  , aux_row1(in_row1)
  , aux_col1(in_col1)
  , n_rows(in_n_rows)
  , n_cols(in_n_cols)
  , n_elem(in_n_rows * in_n_cols)
  , n_nonzero(0)
  {
  arma_extra_debug_sigprint();

  // There must be a O(1) way to do this
  uword end     = m.col_ptrs[in_col1 + in_n_cols];
  uword end_row = in_row1 + in_n_rows;
  uword count   = 0;

  for(uword i = m.col_ptrs[in_col1]; i < end; ++i)
    {
    if(m.row_indices[i] >= in_row1 && m.row_indices[i] < end_row)
      {
      ++count;
      }
    }

  access::rw(n_nonzero) = count;
  }



template<typename eT>
arma_inline
SpSubview<eT>::SpSubview(SpMat<eT>& in_m, const uword in_row1, const uword in_col1, const uword in_n_rows, const uword in_n_cols)
  : m(in_m)
  , aux_row1(in_row1)
  , aux_col1(in_col1)
  , n_rows(in_n_rows)
  , n_cols(in_n_cols)
  , n_elem(in_n_rows * in_n_cols)
  , n_nonzero(0)
  {
  arma_extra_debug_sigprint();

  // There must be a O(1) way to do this
  uword end     = m.col_ptrs[in_col1 + in_n_cols];
  uword end_row = in_row1 + in_n_rows;
  uword count   = 0;

  for(uword i = m.col_ptrs[in_col1]; i < end; ++i)
    {
    if(m.row_indices[i] >= in_row1 && m.row_indices[i] < end_row)
      {
      ++count;
      }
    }

  access::rw(n_nonzero) = count;
  }



template<typename eT>
inline
SpSubview<eT>::~SpSubview()
  {
  arma_extra_debug_sigprint();
  }



template<typename eT>
inline
void
SpSubview<eT>::operator+= (const eT val)
  {
  arma_extra_debug_sigprint();

  if(val == 0)
    {
    return;
    }

  const uword start_row = aux_row1;
  const uword end_row   = aux_row1 + n_rows;
  const uword start_col = aux_col1;
  const uword end_col   = aux_col1 + n_cols;

  // iterate over our part of the sparse matrix
  for(uword col = start_col; col < end_col; ++col)
    {
    for(uword row = start_row; row < end_row; ++row)
      {
      access::rw(m).at(row, col) += val;
      }
    }
  }



template<typename eT>
inline
void
SpSubview<eT>::operator-= (const eT val)
  {
  arma_extra_debug_sigprint();

  if(val == 0)
    {
    return;
    }

  const uword start_row = aux_row1;
  const uword end_row   = aux_row1 + n_rows;
  const uword start_col = aux_col1;
  const uword end_col   = aux_col1 + n_cols;


  for(uword col = start_col; col < end_col; ++col)
    {
    for(uword row = start_row; row < end_row; ++row)
      {
      access::rw(m).at(row, col) -= val;
      }
    }
  }



template<typename eT>
inline
void
SpSubview<eT>::operator*= (const eT val)
  {
  arma_extra_debug_sigprint();

  const uword start_row = aux_row1;
  const uword end_row   = aux_row1 + n_rows;
  const uword start_col = aux_col1;
  const uword end_col   = aux_col1 + n_cols;

  for(uword c = start_col; c < end_col;)
    {
    for(uword r = m.col_ptrs[c]; r < m.col_ptrs[++c]; ++r)
      {
      if(m.row_indices[r] >= start_row && m.row_indices[r] < end_row)
        {
        access::rw(m).values[r] *= val;
        }
      }
    }
  }



template<typename eT>
inline
void
SpSubview<eT>::operator/= (const eT val)
  {
  arma_extra_debug_sigprint();

  const uword start_col = aux_col1;
  const uword end_col   = aux_col1 + n_cols;

  for(uword c = start_col; c < end_col; ++c)
    {
    for(uword r = m.col_ptrs[c]; r < m.col_ptrs[++c]; ++r)
      {
      access::rw(m).values[r] /= val;
{'fraction_non_alphanumeric': 0.13295373665480428, 'fraction_numerical': 0.012241992882562277, 'mean_word_length': 2.9897785349233392, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1082309', 'n_tokens_mistral': 3132, 'n_tokens_neox': 3036, 'n_words': 607}