"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "include/armadillo_bits/subview_meat.hpp" between
armadillo-10.2.0.tar.xz and armadillo-10.2.1.tar.xz

About: Armadillo is a C++ linear algebra library (matrix maths) aiming towards a good balance between speed and ease of use.

subview_meat.hpp  (armadillo-10.2.0.tar.xz):subview_meat.hpp  (armadillo-10.2.1.tar.xz)
skipping to change at line 1128 skipping to change at line 1128
const uword index = (in_col + aux_col1)*m.n_rows + aux_row1 + in_row; const uword index = (in_col + aux_col1)*m.n_rows + aux_row1 + in_row;
return m.mem[index]; return m.mem[index];
} }
template<typename eT> template<typename eT>
inline inline
eT& eT&
subview<eT>::operator()(const uword ii) subview<eT>::operator()(const uword ii)
{ {
arma_debug_check( (ii >= n_elem), "subview::operator(): index out of bounds"); arma_debug_check( (ii >= n_elem), "subview::operator(): index out of bounds" ) ;
const uword in_col = ii / n_rows; const uword in_col = ii / n_rows;
const uword in_row = ii % n_rows; const uword in_row = ii % n_rows;
const uword index = (in_col + aux_col1)*m.n_rows + aux_row1 + in_row; const uword index = (in_col + aux_col1)*m.n_rows + aux_row1 + in_row;
return access::rw( (const_cast< Mat<eT>& >(m)).mem[index] ); return access::rw( (const_cast< Mat<eT>& >(m)).mem[index] );
} }
template<typename eT> template<typename eT>
inline inline
eT eT
subview<eT>::operator()(const uword ii) const subview<eT>::operator()(const uword ii) const
{ {
arma_debug_check( (ii >= n_elem), "subview::operator(): index out of bounds"); arma_debug_check( (ii >= n_elem), "subview::operator(): index out of bounds" ) ;
const uword in_col = ii / n_rows; const uword in_col = ii / n_rows;
const uword in_row = ii % n_rows; const uword in_row = ii % n_rows;
const uword index = (in_col + aux_col1)*m.n_rows + aux_row1 + in_row; const uword index = (in_col + aux_col1)*m.n_rows + aux_row1 + in_row;
return m.mem[index]; return m.mem[index];
} }
template<typename eT> template<typename eT>
inline inline
eT& eT&
subview<eT>::operator()(const uword in_row, const uword in_col) subview<eT>::operator()(const uword in_row, const uword in_col)
{ {
arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "subview::operat or(): index out of bounds"); arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "subview::operat or(): index out of bounds" );
const uword index = (in_col + aux_col1)*m.n_rows + aux_row1 + in_row; const uword index = (in_col + aux_col1)*m.n_rows + aux_row1 + in_row;
return access::rw( (const_cast< Mat<eT>& >(m)).mem[index] ); return access::rw( (const_cast< Mat<eT>& >(m)).mem[index] );
} }
template<typename eT> template<typename eT>
inline inline
eT eT
subview<eT>::operator()(const uword in_row, const uword in_col) const subview<eT>::operator()(const uword in_row, const uword in_col) const
{ {
arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "subview::operat or(): index out of bounds"); arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "subview::operat or(): index out of bounds" );
const uword index = (in_col + aux_col1)*m.n_rows + aux_row1 + in_row; const uword index = (in_col + aux_col1)*m.n_rows + aux_row1 + in_row;
return m.mem[index]; return m.mem[index];
} }
template<typename eT> template<typename eT>
inline inline
eT& eT&
subview<eT>::at(const uword in_row, const uword in_col) subview<eT>::at(const uword in_row, const uword in_col)
skipping to change at line 1728 skipping to change at line 1728
} }
//! creation of subview (column vector) //! creation of subview (column vector)
template<typename eT> template<typename eT>
inline inline
subview_col<eT> subview_col<eT>
subview<eT>::col(const uword col_num) subview<eT>::col(const uword col_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( col_num >= n_cols, "subview::col(): out of bounds"); arma_debug_check( col_num >= n_cols, "subview::col(): out of bounds" );
const uword base_col = aux_col1 + col_num; const uword base_col = aux_col1 + col_num;
return subview_col<eT>(m, base_col, aux_row1, n_rows); return subview_col<eT>(m, base_col, aux_row1, n_rows);
} }
//! creation of subview (column vector) //! creation of subview (column vector)
template<typename eT> template<typename eT>
inline inline
const subview_col<eT> const subview_col<eT>
subview<eT>::col(const uword col_num) const subview<eT>::col(const uword col_num) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( col_num >= n_cols, "subview::col(): out of bounds"); arma_debug_check( col_num >= n_cols, "subview::col(): out of bounds" );
const uword base_col = aux_col1 + col_num; const uword base_col = aux_col1 + col_num;
return subview_col<eT>(m, base_col, aux_row1, n_rows); return subview_col<eT>(m, base_col, aux_row1, n_rows);
} }
template<typename eT> template<typename eT>
inline inline
subview_col<eT> subview_col<eT>
subview<eT>::operator()(const span& row_span, const uword col_num) subview<eT>::operator()(const span& row_span, const uword col_num)
skipping to change at line 1822 skipping to change at line 1822
//! and does not take into account that the parent matrix object could be delete d. //! and does not take into account that the parent matrix object could be delete d.
//! if deleted memory is accessed by the created Col object, //! if deleted memory is accessed by the created Col object,
//! it will cause memory corruption and/or a crash //! it will cause memory corruption and/or a crash
template<typename eT> template<typename eT>
inline inline
Col<eT> Col<eT>
subview<eT>::unsafe_col(const uword col_num) subview<eT>::unsafe_col(const uword col_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( col_num >= n_cols, "subview::unsafe_col(): out of bounds"); arma_debug_check( col_num >= n_cols, "subview::unsafe_col(): out of bounds" );
return Col<eT>(colptr(col_num), n_rows, false, true); return Col<eT>(colptr(col_num), n_rows, false, true);
} }
//! create a Col object which uses memory from an existing matrix object. //! create a Col object which uses memory from an existing matrix object.
//! this approach is currently not alias safe //! this approach is currently not alias safe
//! and does not take into account that the parent matrix object could be delete d. //! and does not take into account that the parent matrix object could be delete d.
//! if deleted memory is accessed by the created Col object, //! if deleted memory is accessed by the created Col object,
//! it will cause memory corruption and/or a crash //! it will cause memory corruption and/or a crash
template<typename eT> template<typename eT>
inline inline
const Col<eT> const Col<eT>
subview<eT>::unsafe_col(const uword col_num) const subview<eT>::unsafe_col(const uword col_num) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( col_num >= n_cols, "subview::unsafe_col(): out of bounds"); arma_debug_check( col_num >= n_cols, "subview::unsafe_col(): out of bounds" );
return Col<eT>(const_cast<eT*>(colptr(col_num)), n_rows, false, true); return Col<eT>(const_cast<eT*>(colptr(col_num)), n_rows, false, true);
} }
//! creation of subview (submatrix comprised of specified row vectors) //! creation of subview (submatrix comprised of specified row vectors)
template<typename eT> template<typename eT>
inline inline
subview<eT> subview<eT>
subview<eT>::rows(const uword in_row1, const uword in_row2) subview<eT>::rows(const uword in_row1, const uword in_row2)
{ {
skipping to change at line 3091 skipping to change at line 3091
subview_col<eT>::operator[](const uword ii) const subview_col<eT>::operator[](const uword ii) const
{ {
return colmem[ii]; return colmem[ii];
} }
template<typename eT> template<typename eT>
inline inline
eT& eT&
subview_col<eT>::operator()(const uword ii) subview_col<eT>::operator()(const uword ii)
{ {
arma_debug_check( (ii >= subview<eT>::n_elem), "subview::operator(): index out of bounds"); arma_debug_check( (ii >= subview<eT>::n_elem), "subview::operator(): index out of bounds" );
return access::rw( colmem[ii] ); return access::rw( colmem[ii] );
} }
template<typename eT> template<typename eT>
inline inline
eT eT
subview_col<eT>::operator()(const uword ii) const subview_col<eT>::operator()(const uword ii) const
{ {
arma_debug_check( (ii >= subview<eT>::n_elem), "subview::operator(): index out of bounds"); arma_debug_check( (ii >= subview<eT>::n_elem), "subview::operator(): index out of bounds" );
return colmem[ii]; return colmem[ii];
} }
template<typename eT> template<typename eT>
inline inline
eT& eT&
subview_col<eT>::operator()(const uword in_row, const uword in_col) subview_col<eT>::operator()(const uword in_row, const uword in_col)
{ {
arma_debug_check( ((in_row >= subview<eT>::n_rows) || (in_col > 0)), "subview: :operator(): index out of bounds"); arma_debug_check( ((in_row >= subview<eT>::n_rows) || (in_col > 0)), "subview: :operator(): index out of bounds" );
return access::rw( colmem[in_row] ); return access::rw( colmem[in_row] );
} }
template<typename eT> template<typename eT>
inline inline
eT eT
subview_col<eT>::operator()(const uword in_row, const uword in_col) const subview_col<eT>::operator()(const uword in_row, const uword in_col) const
{ {
arma_debug_check( ((in_row >= subview<eT>::n_rows) || (in_col > 0)), "subview: :operator(): index out of bounds"); arma_debug_check( ((in_row >= subview<eT>::n_rows) || (in_col > 0)), "subview: :operator(): index out of bounds" );
return colmem[in_row]; return colmem[in_row];
} }
template<typename eT> template<typename eT>
inline inline
eT& eT&
subview_col<eT>::at(const uword in_row, const uword) subview_col<eT>::at(const uword in_row, const uword)
{ {
return access::rw( colmem[in_row] ); return access::rw( colmem[in_row] );
skipping to change at line 3165 skipping to change at line 3165
return colmem; return colmem;
} }
template<typename eT> template<typename eT>
inline inline
subview_col<eT> subview_col<eT>
subview_col<eT>::rows(const uword in_row1, const uword in_row2) subview_col<eT>::rows(const uword in_row1, const uword in_row2)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= subview<eT>::n_rows) ), "subview_col::rows(): indices out of bounds or incorrectly used"); arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= subview<eT>::n_rows) ), "subview_col::rows(): indices out of bounds or incorrectly used" );
const uword subview_n_rows = in_row2 - in_row1 + 1; const uword subview_n_rows = in_row2 - in_row1 + 1;
const uword base_row1 = this->aux_row1 + in_row1; const uword base_row1 = this->aux_row1 + in_row1;
return subview_col<eT>(this->m, this->aux_col1, base_row1, subview_n_rows); return subview_col<eT>(this->m, this->aux_col1, base_row1, subview_n_rows);
} }
template<typename eT> template<typename eT>
inline inline
const subview_col<eT> const subview_col<eT>
subview_col<eT>::rows(const uword in_row1, const uword in_row2) const subview_col<eT>::rows(const uword in_row1, const uword in_row2) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= subview<eT>::n_rows) ), "subview_col::rows(): indices out of bounds or incorrectly used"); arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= subview<eT>::n_rows) ), "subview_col::rows(): indices out of bounds or incorrectly used" );
const uword subview_n_rows = in_row2 - in_row1 + 1; const uword subview_n_rows = in_row2 - in_row1 + 1;
const uword base_row1 = this->aux_row1 + in_row1; const uword base_row1 = this->aux_row1 + in_row1;
return subview_col<eT>(this->m, this->aux_col1, base_row1, subview_n_rows); return subview_col<eT>(this->m, this->aux_col1, base_row1, subview_n_rows);
} }
template<typename eT> template<typename eT>
inline inline
subview_col<eT> subview_col<eT>
subview_col<eT>::subvec(const uword in_row1, const uword in_row2) subview_col<eT>::subvec(const uword in_row1, const uword in_row2)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= subview<eT>::n_rows) ), "subview_col::subvec(): indices out of bounds or incorrectly used"); arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= subview<eT>::n_rows) ), "subview_col::subvec(): indices out of bounds or incorrectly used" );
const uword subview_n_rows = in_row2 - in_row1 + 1; const uword subview_n_rows = in_row2 - in_row1 + 1;
const uword base_row1 = this->aux_row1 + in_row1; const uword base_row1 = this->aux_row1 + in_row1;
return subview_col<eT>(this->m, this->aux_col1, base_row1, subview_n_rows); return subview_col<eT>(this->m, this->aux_col1, base_row1, subview_n_rows);
} }
template<typename eT> template<typename eT>
inline inline
const subview_col<eT> const subview_col<eT>
subview_col<eT>::subvec(const uword in_row1, const uword in_row2) const subview_col<eT>::subvec(const uword in_row1, const uword in_row2) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= subview<eT>::n_rows) ), "subview_col::subvec(): indices out of bounds or incorrectly used"); arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= subview<eT>::n_rows) ), "subview_col::subvec(): indices out of bounds or incorrectly used" );
const uword subview_n_rows = in_row2 - in_row1 + 1; const uword subview_n_rows = in_row2 - in_row1 + 1;
const uword base_row1 = this->aux_row1 + in_row1; const uword base_row1 = this->aux_row1 + in_row1;
return subview_col<eT>(this->m, this->aux_col1, base_row1, subview_n_rows); return subview_col<eT>(this->m, this->aux_col1, base_row1, subview_n_rows);
} }
template<typename eT> template<typename eT>
inline inline
skipping to change at line 3261 skipping to change at line 3261
return subview_col<eT>(this->m, this->aux_col1, base_row1, s.n_rows); return subview_col<eT>(this->m, this->aux_col1, base_row1, s.n_rows);
} }
template<typename eT> template<typename eT>
inline inline
subview_col<eT> subview_col<eT>
subview_col<eT>::head(const uword N) subview_col<eT>::head(const uword N)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > subview<eT>::n_rows), "subview_col::head(): size out of bounds"); arma_debug_check( (N > subview<eT>::n_rows), "subview_col::head(): size out of bounds" );
return subview_col<eT>(this->m, this->aux_col1, this->aux_row1, N); return subview_col<eT>(this->m, this->aux_col1, this->aux_row1, N);
} }
template<typename eT> template<typename eT>
inline inline
const subview_col<eT> const subview_col<eT>
subview_col<eT>::head(const uword N) const subview_col<eT>::head(const uword N) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > subview<eT>::n_rows), "subview_col::head(): size out of bounds"); arma_debug_check( (N > subview<eT>::n_rows), "subview_col::head(): size out of bounds" );
return subview_col<eT>(this->m, this->aux_col1, this->aux_row1, N); return subview_col<eT>(this->m, this->aux_col1, this->aux_row1, N);
} }
template<typename eT> template<typename eT>
inline inline
subview_col<eT> subview_col<eT>
subview_col<eT>::tail(const uword N) subview_col<eT>::tail(const uword N)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > subview<eT>::n_rows), "subview_col::tail(): size out of bounds"); arma_debug_check( (N > subview<eT>::n_rows), "subview_col::tail(): size out of bounds" );
const uword start_row = subview<eT>::aux_row1 + subview<eT>::n_rows - N; const uword start_row = subview<eT>::aux_row1 + subview<eT>::n_rows - N;
return subview_col<eT>(this->m, this->aux_col1, start_row, N); return subview_col<eT>(this->m, this->aux_col1, start_row, N);
} }
template<typename eT> template<typename eT>
inline inline
const subview_col<eT> const subview_col<eT>
subview_col<eT>::tail(const uword N) const subview_col<eT>::tail(const uword N) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > subview<eT>::n_rows), "subview_col::tail(): size out of bounds"); arma_debug_check( (N > subview<eT>::n_rows), "subview_col::tail(): size out of bounds" );
const uword start_row = subview<eT>::aux_row1 + subview<eT>::n_rows - N; const uword start_row = subview<eT>::aux_row1 + subview<eT>::n_rows - N;
return subview_col<eT>(this->m, this->aux_col1, start_row, N); return subview_col<eT>(this->m, this->aux_col1, start_row, N);
} }
template<typename eT> template<typename eT>
inline inline
arma_warn_unused arma_warn_unused
eT eT
skipping to change at line 3605 skipping to change at line 3605
const uword index = (ii + (subview<eT>::aux_col1))*(subview<eT>::m).n_rows + ( subview<eT>::aux_row1); const uword index = (ii + (subview<eT>::aux_col1))*(subview<eT>::m).n_rows + ( subview<eT>::aux_row1);
return subview<eT>::m.mem[index]; return subview<eT>::m.mem[index];
} }
template<typename eT> template<typename eT>
inline inline
eT& eT&
subview_row<eT>::operator()(const uword ii) subview_row<eT>::operator()(const uword ii)
{ {
arma_debug_check( (ii >= subview<eT>::n_elem), "subview::operator(): index out of bounds"); arma_debug_check( (ii >= subview<eT>::n_elem), "subview::operator(): index out of bounds" );
const uword index = (ii + (subview<eT>::aux_col1))*(subview<eT>::m).n_rows + ( subview<eT>::aux_row1); const uword index = (ii + (subview<eT>::aux_col1))*(subview<eT>::m).n_rows + ( subview<eT>::aux_row1);
return access::rw( (const_cast< Mat<eT>& >(subview<eT>::m)).mem[index] ); return access::rw( (const_cast< Mat<eT>& >(subview<eT>::m)).mem[index] );
} }
template<typename eT> template<typename eT>
inline inline
eT eT
subview_row<eT>::operator()(const uword ii) const subview_row<eT>::operator()(const uword ii) const
{ {
arma_debug_check( (ii >= subview<eT>::n_elem), "subview::operator(): index out of bounds"); arma_debug_check( (ii >= subview<eT>::n_elem), "subview::operator(): index out of bounds" );
const uword index = (ii + (subview<eT>::aux_col1))*(subview<eT>::m).n_rows + ( subview<eT>::aux_row1); const uword index = (ii + (subview<eT>::aux_col1))*(subview<eT>::m).n_rows + ( subview<eT>::aux_row1);
return subview<eT>::m.mem[index]; return subview<eT>::m.mem[index];
} }
template<typename eT> template<typename eT>
inline inline
eT& eT&
subview_row<eT>::operator()(const uword in_row, const uword in_col) subview_row<eT>::operator()(const uword in_row, const uword in_col)
{ {
arma_debug_check( ((in_row > 0) || (in_col >= subview<eT>::n_cols)), "subview: :operator(): index out of bounds"); arma_debug_check( ((in_row > 0) || (in_col >= subview<eT>::n_cols)), "subview: :operator(): index out of bounds" );
const uword index = (in_col + (subview<eT>::aux_col1))*(subview<eT>::m).n_rows + (subview<eT>::aux_row1); const uword index = (in_col + (subview<eT>::aux_col1))*(subview<eT>::m).n_rows + (subview<eT>::aux_row1);
return access::rw( (const_cast< Mat<eT>& >(subview<eT>::m)).mem[index] ); return access::rw( (const_cast< Mat<eT>& >(subview<eT>::m)).mem[index] );
} }
template<typename eT> template<typename eT>
inline inline
eT eT
subview_row<eT>::operator()(const uword in_row, const uword in_col) const subview_row<eT>::operator()(const uword in_row, const uword in_col) const
{ {
arma_debug_check( ((in_row > 0) || (in_col >= subview<eT>::n_cols)), "subview: :operator(): index out of bounds"); arma_debug_check( ((in_row > 0) || (in_col >= subview<eT>::n_cols)), "subview: :operator(): index out of bounds" );
const uword index = (in_col + (subview<eT>::aux_col1))*(subview<eT>::m).n_rows + (subview<eT>::aux_row1); const uword index = (in_col + (subview<eT>::aux_col1))*(subview<eT>::m).n_rows + (subview<eT>::aux_row1);
return subview<eT>::m.mem[index]; return subview<eT>::m.mem[index];
} }
template<typename eT> template<typename eT>
inline inline
eT& eT&
subview_row<eT>::at(const uword, const uword in_col) subview_row<eT>::at(const uword, const uword in_col)
skipping to change at line 3691 skipping to change at line 3691
return subview_row<eT>(this->m, this->aux_row1, base_col1, subview_n_cols); return subview_row<eT>(this->m, this->aux_row1, base_col1, subview_n_cols);
} }
template<typename eT> template<typename eT>
inline inline
const subview_row<eT> const subview_row<eT>
subview_row<eT>::cols(const uword in_col1, const uword in_col2) const subview_row<eT>::cols(const uword in_col1, const uword in_col2) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= subview<eT>::n_cols) ), "subview_row::cols(): indices out of bounds or incorrectly used"); arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= subview<eT>::n_cols) ), "subview_row::cols(): indices out of bounds or incorrectly used" );
const uword subview_n_cols = in_col2 - in_col1 + 1; const uword subview_n_cols = in_col2 - in_col1 + 1;
const uword base_col1 = this->aux_col1 + in_col1; const uword base_col1 = this->aux_col1 + in_col1;
return subview_row<eT>(this->m, this->aux_row1, base_col1, subview_n_cols); return subview_row<eT>(this->m, this->aux_row1, base_col1, subview_n_cols);
} }
template<typename eT> template<typename eT>
inline inline
subview_row<eT> subview_row<eT>
subview_row<eT>::subvec(const uword in_col1, const uword in_col2) subview_row<eT>::subvec(const uword in_col1, const uword in_col2)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= subview<eT>::n_cols) ), "subview_row::subvec(): indices out of bounds or incorrectly used"); arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= subview<eT>::n_cols) ), "subview_row::subvec(): indices out of bounds or incorrectly used" );
const uword subview_n_cols = in_col2 - in_col1 + 1; const uword subview_n_cols = in_col2 - in_col1 + 1;
const uword base_col1 = this->aux_col1 + in_col1; const uword base_col1 = this->aux_col1 + in_col1;
return subview_row<eT>(this->m, this->aux_row1, base_col1, subview_n_cols); return subview_row<eT>(this->m, this->aux_row1, base_col1, subview_n_cols);
} }
template<typename eT> template<typename eT>
inline inline
const subview_row<eT> const subview_row<eT>
subview_row<eT>::subvec(const uword in_col1, const uword in_col2) const subview_row<eT>::subvec(const uword in_col1, const uword in_col2) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= subview<eT>::n_cols) ), "subview_row::subvec(): indices out of bounds or incorrectly used"); arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= subview<eT>::n_cols) ), "subview_row::subvec(): indices out of bounds or incorrectly used" );
const uword subview_n_cols = in_col2 - in_col1 + 1; const uword subview_n_cols = in_col2 - in_col1 + 1;
const uword base_col1 = this->aux_col1 + in_col1; const uword base_col1 = this->aux_col1 + in_col1;
return subview_row<eT>(this->m, this->aux_row1, base_col1, subview_n_cols); return subview_row<eT>(this->m, this->aux_row1, base_col1, subview_n_cols);
} }
template<typename eT> template<typename eT>
inline inline
skipping to change at line 3771 skipping to change at line 3771
return subview_row<eT>(this->m, this->aux_row1, base_col1, s.n_cols); return subview_row<eT>(this->m, this->aux_row1, base_col1, s.n_cols);
} }
template<typename eT> template<typename eT>
inline inline
subview_row<eT> subview_row<eT>
subview_row<eT>::head(const uword N) subview_row<eT>::head(const uword N)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > subview<eT>::n_cols), "subview_row::head(): size out of bounds"); arma_debug_check( (N > subview<eT>::n_cols), "subview_row::head(): size out of bounds" );
return subview_row<eT>(this->m, this->aux_row1, this->aux_col1, N); return subview_row<eT>(this->m, this->aux_row1, this->aux_col1, N);
} }
template<typename eT> template<typename eT>
inline inline
const subview_row<eT> const subview_row<eT>
subview_row<eT>::head(const uword N) const subview_row<eT>::head(const uword N) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > subview<eT>::n_cols), "subview_row::head(): size out of bounds"); arma_debug_check( (N > subview<eT>::n_cols), "subview_row::head(): size out of bounds" );
return subview_row<eT>(this->m, this->aux_row1, this->aux_col1, N); return subview_row<eT>(this->m, this->aux_row1, this->aux_col1, N);
} }
template<typename eT> template<typename eT>
inline inline
subview_row<eT> subview_row<eT>
subview_row<eT>::tail(const uword N) subview_row<eT>::tail(const uword N)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > subview<eT>::n_cols), "subview_row::tail(): size out of bounds"); arma_debug_check( (N > subview<eT>::n_cols), "subview_row::tail(): size out of bounds" );
const uword start_col = subview<eT>::aux_col1 + subview<eT>::n_cols - N; const uword start_col = subview<eT>::aux_col1 + subview<eT>::n_cols - N;
return subview_row<eT>(this->m, this->aux_row1, start_col, N); return subview_row<eT>(this->m, this->aux_row1, start_col, N);
} }
template<typename eT> template<typename eT>
inline inline
const subview_row<eT> const subview_row<eT>
subview_row<eT>::tail(const uword N) const subview_row<eT>::tail(const uword N) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > subview<eT>::n_cols), "subview_row::tail(): size out of bounds"); arma_debug_check( (N > subview<eT>::n_cols), "subview_row::tail(): size out of bounds" );
const uword start_col = subview<eT>::aux_col1 + subview<eT>::n_cols - N; const uword start_col = subview<eT>::aux_col1 + subview<eT>::n_cols - N;
return subview_row<eT>(this->m, this->aux_row1, start_col, N); return subview_row<eT>(this->m, this->aux_row1, start_col, N);
} }
template<typename eT> template<typename eT>
inline inline
arma_warn_unused arma_warn_unused
uword uword
 End of changes. 31 change blocks. 
31 lines changed or deleted 31 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)