"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "include/armadillo_bits/Row_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.

Row_meat.hpp  (armadillo-10.2.0.tar.xz):Row_meat.hpp  (armadillo-10.2.1.tar.xz)
skipping to change at line 489 skipping to change at line 489
return Op<Row<eT>,op_strans>(*this); return Op<Row<eT>,op_strans>(*this);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_row<eT> subview_row<eT>
Row<eT>::col(const uword in_col1) Row<eT>::col(const uword in_col1)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (in_col1 >= Mat<eT>::n_cols), "Row::col(): indices out of bo unds or incorrectly used"); arma_debug_check( (in_col1 >= Mat<eT>::n_cols), "Row::col(): indices out of bo unds or incorrectly used" );
return subview_row<eT>(*this, 0, in_col1, 1); return subview_row<eT>(*this, 0, in_col1, 1);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
const subview_row<eT> const subview_row<eT>
Row<eT>::col(const uword in_col1) const Row<eT>::col(const uword in_col1) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (in_col1 >= Mat<eT>::n_cols), "Row::col(): indices out of bo unds or incorrectly used"); arma_debug_check( (in_col1 >= Mat<eT>::n_cols), "Row::col(): indices out of bo unds or incorrectly used" );
return subview_row<eT>(*this, 0, in_col1, 1); return subview_row<eT>(*this, 0, in_col1, 1);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_row<eT> subview_row<eT>
Row<eT>::cols(const uword in_col1, const uword in_col2) Row<eT>::cols(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 >= Mat<eT>::n_cols) ), "Ro w::cols(): indices out of bounds or incorrectly used"); arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat<eT>::n_cols) ), "Ro w::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;
return subview_row<eT>(*this, 0, in_col1, subview_n_cols); return subview_row<eT>(*this, 0, in_col1, subview_n_cols);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
const subview_row<eT> const subview_row<eT>
Row<eT>::cols(const uword in_col1, const uword in_col2) const 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 >= Mat<eT>::n_cols) ), "Ro w::cols(): indices out of bounds or incorrectly used"); arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat<eT>::n_cols) ), "Ro w::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;
return subview_row<eT>(*this, 0, in_col1, subview_n_cols); return subview_row<eT>(*this, 0, in_col1, subview_n_cols);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_row<eT> subview_row<eT>
Row<eT>::subvec(const uword in_col1, const uword in_col2) 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 >= Mat<eT>::n_cols) ), "Ro w::subvec(): indices out of bounds or incorrectly used"); arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat<eT>::n_cols) ), "Ro w::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;
return subview_row<eT>(*this, 0, in_col1, subview_n_cols); return subview_row<eT>(*this, 0, in_col1, subview_n_cols);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
const subview_row<eT> const subview_row<eT>
Row<eT>::subvec(const uword in_col1, const uword in_col2) const 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 >= Mat<eT>::n_cols) ), "Ro w::subvec(): indices out of bounds or incorrectly used"); arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat<eT>::n_cols) ), "Ro w::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;
return subview_row<eT>(*this, 0, in_col1, subview_n_cols); return subview_row<eT>(*this, 0, in_col1, subview_n_cols);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_row<eT> subview_row<eT>
Row<eT>::cols(const span& col_span) Row<eT>::cols(const span& col_span)
skipping to change at line 597 skipping to change at line 597
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const bool col_all = col_span.whole; const bool col_all = col_span.whole;
const uword local_n_cols = Mat<eT>::n_cols; const uword local_n_cols = Mat<eT>::n_cols;
const uword in_col1 = col_all ? 0 : col_span.a; const uword in_col1 = col_all ? 0 : col_span.a;
const uword in_col2 = col_span.b; const uword in_col2 = col_span.b;
const uword subvec_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; const uword subvec_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1;
arma_debug_check( ( col_all ? false : ((in_col1 > in_col2) || (in_col2 >= loca l_n_cols)) ), "Row::subvec(): indices out of bounds or incorrectly used"); arma_debug_check( ( col_all ? false : ((in_col1 > in_col2) || (in_col2 >= loca l_n_cols)) ), "Row::subvec(): indices out of bounds or incorrectly used" );
return subview_row<eT>(*this, 0, in_col1, subvec_n_cols); return subview_row<eT>(*this, 0, in_col1, subvec_n_cols);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
const subview_row<eT> const subview_row<eT>
Row<eT>::subvec(const span& col_span) const Row<eT>::subvec(const span& col_span) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const bool col_all = col_span.whole; const bool col_all = col_span.whole;
const uword local_n_cols = Mat<eT>::n_cols; const uword local_n_cols = Mat<eT>::n_cols;
const uword in_col1 = col_all ? 0 : col_span.a; const uword in_col1 = col_all ? 0 : col_span.a;
const uword in_col2 = col_span.b; const uword in_col2 = col_span.b;
const uword subvec_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; const uword subvec_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1;
arma_debug_check( ( col_all ? false : ((in_col1 > in_col2) || (in_col2 >= loca l_n_cols)) ), "Row::subvec(): indices out of bounds or incorrectly used"); arma_debug_check( ( col_all ? false : ((in_col1 > in_col2) || (in_col2 >= loca l_n_cols)) ), "Row::subvec(): indices out of bounds or incorrectly used" );
return subview_row<eT>(*this, 0, in_col1, subvec_n_cols); return subview_row<eT>(*this, 0, in_col1, subvec_n_cols);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_row<eT> subview_row<eT>
Row<eT>::operator()(const span& col_span) Row<eT>::operator()(const span& col_span)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
skipping to change at line 677 skipping to change at line 677
return subview_row<eT>(*this, 0, start_col, s.n_cols); return subview_row<eT>(*this, 0, start_col, s.n_cols);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_row<eT> subview_row<eT>
Row<eT>::head(const uword N) Row<eT>::head(const uword N)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > Mat<eT>::n_cols), "Row::head(): size out of bounds"); arma_debug_check( (N > Mat<eT>::n_cols), "Row::head(): size out of bounds" );
return subview_row<eT>(*this, 0, 0, N); return subview_row<eT>(*this, 0, 0, N);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
const subview_row<eT> const subview_row<eT>
Row<eT>::head(const uword N) const Row<eT>::head(const uword N) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > Mat<eT>::n_cols), "Row::head(): size out of bounds"); arma_debug_check( (N > Mat<eT>::n_cols), "Row::head(): size out of bounds" );
return subview_row<eT>(*this, 0, 0, N); return subview_row<eT>(*this, 0, 0, N);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_row<eT> subview_row<eT>
Row<eT>::tail(const uword N) Row<eT>::tail(const uword N)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > Mat<eT>::n_cols), "Row::tail(): size out of bounds"); arma_debug_check( (N > Mat<eT>::n_cols), "Row::tail(): size out of bounds" );
const uword start_col = Mat<eT>::n_cols - N; const uword start_col = Mat<eT>::n_cols - N;
return subview_row<eT>(*this, 0, start_col, N); return subview_row<eT>(*this, 0, start_col, N);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
const subview_row<eT> const subview_row<eT>
Row<eT>::tail(const uword N) const Row<eT>::tail(const uword N) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > Mat<eT>::n_cols), "Row::tail(): size out of bounds"); arma_debug_check( (N > Mat<eT>::n_cols), "Row::tail(): size out of bounds" );
const uword start_col = Mat<eT>::n_cols - N; const uword start_col = Mat<eT>::n_cols - N;
return subview_row<eT>(*this, 0, start_col, N); return subview_row<eT>(*this, 0, start_col, N);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_row<eT> subview_row<eT>
Row<eT>::head_cols(const uword N) Row<eT>::head_cols(const uword N)
skipping to change at line 770 skipping to change at line 770
} }
//! remove specified columns //! remove specified columns
template<typename eT> template<typename eT>
inline inline
void void
Row<eT>::shed_col(const uword col_num) Row<eT>::shed_col(const uword col_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( col_num >= Mat<eT>::n_cols, "Row::shed_col(): index out of b ounds"); arma_debug_check( col_num >= Mat<eT>::n_cols, "Row::shed_col(): index out of b ounds" );
shed_cols(col_num, col_num); shed_cols(col_num, col_num);
} }
//! remove specified columns //! remove specified columns
template<typename eT> template<typename eT>
inline inline
void void
Row<eT>::shed_cols(const uword in_col1, const uword in_col2) Row<eT>::shed_cols(const uword in_col1, const uword in_col2)
{ {
skipping to change at line 837 skipping to change at line 837
Row<eT>::insert_cols(const uword col_num, const uword N, const bool set_to_zero) Row<eT>::insert_cols(const uword col_num, const uword N, const bool set_to_zero)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const uword t_n_cols = Mat<eT>::n_cols; const uword t_n_cols = Mat<eT>::n_cols;
const uword A_n_cols = col_num; const uword A_n_cols = col_num;
const uword B_n_cols = t_n_cols - col_num; const uword B_n_cols = t_n_cols - col_num;
// insertion at col_num == n_cols is in effect an append operation // insertion at col_num == n_cols is in effect an append operation
arma_debug_check( (col_num > t_n_cols), "Row::insert_cols(): index out of boun ds"); arma_debug_check( (col_num > t_n_cols), "Row::insert_cols(): index out of boun ds" );
if(N > 0) if(N > 0)
{ {
Row<eT> out(t_n_cols + N); Row<eT> out(t_n_cols + N);
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
const eT* t_mem = (*this).memptr(); const eT* t_mem = (*this).memptr();
if(A_n_cols > 0) if(A_n_cols > 0)
{ {
skipping to change at line 921 skipping to change at line 921
return Mat<eT>::mem[in_col]; return Mat<eT>::mem[in_col];
} }
template<typename eT> template<typename eT>
inline inline
typename Row<eT>::row_iterator typename Row<eT>::row_iterator
Row<eT>::begin_row(const uword row_num) Row<eT>::begin_row(const uword row_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (row_num >= Mat<eT>::n_rows), "Row::begin_row(): index out o f bounds"); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Row::begin_row(): index out o f bounds" );
return Mat<eT>::memptr(); return Mat<eT>::memptr();
} }
template<typename eT> template<typename eT>
inline inline
typename Row<eT>::const_row_iterator typename Row<eT>::const_row_iterator
Row<eT>::begin_row(const uword row_num) const Row<eT>::begin_row(const uword row_num) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (row_num >= Mat<eT>::n_rows), "Row::begin_row(): index out o f bounds"); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Row::begin_row(): index out o f bounds" );
return Mat<eT>::memptr(); return Mat<eT>::memptr();
} }
template<typename eT> template<typename eT>
inline inline
typename Row<eT>::row_iterator typename Row<eT>::row_iterator
Row<eT>::end_row(const uword row_num) Row<eT>::end_row(const uword row_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (row_num >= Mat<eT>::n_rows), "Row::end_row(): index out of bounds"); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Row::end_row(): index out of bounds" );
return Mat<eT>::memptr() + Mat<eT>::n_cols; return Mat<eT>::memptr() + Mat<eT>::n_cols;
} }
template<typename eT> template<typename eT>
inline inline
typename Row<eT>::const_row_iterator typename Row<eT>::const_row_iterator
Row<eT>::end_row(const uword row_num) const Row<eT>::end_row(const uword row_num) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (row_num >= Mat<eT>::n_rows), "Row::end_row(): index out of bounds"); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Row::end_row(): index out of bounds" );
return Mat<eT>::memptr() + Mat<eT>::n_cols; return Mat<eT>::memptr() + Mat<eT>::n_cols;
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
Row<eT>::fixed<fixed_n_elem>::fixed() Row<eT>::fixed<fixed_n_elem>::fixed()
: Row<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extr a : Mat<eT>::mem_local) ) : Row<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extr a : Mat<eT>::mem_local) )
{ {
skipping to change at line 1349 skipping to change at line 1349
return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Row<eT>::fixed<fixed_n_elem>::operator() (const uword ii) Row<eT>::fixed<fixed_n_elem>::operator() (const uword ii)
{ {
arma_debug_check( (ii >= fixed_n_elem), "Row::operator(): index out of bounds" ); arma_debug_check( (ii >= fixed_n_elem), "Row::operator(): index out of bounds" );
return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
const eT& const eT&
Row<eT>::fixed<fixed_n_elem>::operator() (const uword ii) const Row<eT>::fixed<fixed_n_elem>::operator() (const uword ii) const
{ {
arma_debug_check( (ii >= fixed_n_elem), "Row::operator(): index out of bounds" ); arma_debug_check( (ii >= fixed_n_elem), "Row::operator(): index out of bounds" );
return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii]; return (use_extra) ? mem_local_extra[ii] : Mat<eT>::mem_local[ii];
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Row<eT>::fixed<fixed_n_elem>::at(const uword, const uword in_col) Row<eT>::fixed<fixed_n_elem>::at(const uword, const uword in_col)
 End of changes. 20 change blocks. 
20 lines changed or deleted 20 lines changed or added

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