"Fossies" - the Fresh Open Source Software Archive  

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

Col_meat.hpp  (armadillo-10.2.0.tar.xz):Col_meat.hpp  (armadillo-10.2.1.tar.xz)
skipping to change at line 489 skipping to change at line 489
return Op<Col<eT>,op_strans>(*this); return Op<Col<eT>,op_strans>(*this);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_col<eT> subview_col<eT>
Col<eT>::row(const uword in_row1) Col<eT>::row(const uword in_row1)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (in_row1 >= Mat<eT>::n_rows), "Col::row(): indices out of bo unds or incorrectly used"); arma_debug_check( (in_row1 >= Mat<eT>::n_rows), "Col::row(): indices out of bo unds or incorrectly used" );
return subview_col<eT>(*this, 0, in_row1, 1); return subview_col<eT>(*this, 0, in_row1, 1);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
const subview_col<eT> const subview_col<eT>
Col<eT>::row(const uword in_row1) const Col<eT>::row(const uword in_row1) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (in_row1 >= Mat<eT>::n_rows), "Col::row(): indices out of bo unds or incorrectly used"); arma_debug_check( (in_row1 >= Mat<eT>::n_rows), "Col::row(): indices out of bo unds or incorrectly used" );
return subview_col<eT>(*this, 0, in_row1, 1); return subview_col<eT>(*this, 0, in_row1, 1);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_col<eT> subview_col<eT>
Col<eT>::rows(const uword in_row1, const uword in_row2) 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 >= Mat<eT>::n_rows) ), "Co l::rows(): indices out of bounds or incorrectly used"); arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= Mat<eT>::n_rows) ), "Co l::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;
return subview_col<eT>(*this, 0, in_row1, subview_n_rows); return subview_col<eT>(*this, 0, in_row1, subview_n_rows);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
const subview_col<eT> const subview_col<eT>
Col<eT>::rows(const uword in_row1, const uword in_row2) const 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 >= Mat<eT>::n_rows) ), "Co l::rows(): indices out of bounds or incorrectly used"); arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= Mat<eT>::n_rows) ), "Co l::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;
return subview_col<eT>(*this, 0, in_row1, subview_n_rows); return subview_col<eT>(*this, 0, in_row1, subview_n_rows);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_col<eT> subview_col<eT>
Col<eT>::subvec(const uword in_row1, const uword in_row2) 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 >= Mat<eT>::n_rows) ), "Co l::subvec(): indices out of bounds or incorrectly used"); arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= Mat<eT>::n_rows) ), "Co l::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;
return subview_col<eT>(*this, 0, in_row1, subview_n_rows); return subview_col<eT>(*this, 0, in_row1, subview_n_rows);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
const subview_col<eT> const subview_col<eT>
Col<eT>::subvec(const uword in_row1, const uword in_row2) const 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 >= Mat<eT>::n_rows) ), "Co l::subvec(): indices out of bounds or incorrectly used"); arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= Mat<eT>::n_rows) ), "Co l::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;
return subview_col<eT>(*this, 0, in_row1, subview_n_rows); return subview_col<eT>(*this, 0, in_row1, subview_n_rows);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_col<eT> subview_col<eT>
Col<eT>::rows(const span& row_span) Col<eT>::rows(const span& row_span)
skipping to change at line 597 skipping to change at line 597
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const bool row_all = row_span.whole; const bool row_all = row_span.whole;
const uword local_n_rows = Mat<eT>::n_rows; const uword local_n_rows = Mat<eT>::n_rows;
const uword in_row1 = row_all ? 0 : row_span.a; const uword in_row1 = row_all ? 0 : row_span.a;
const uword in_row2 = row_span.b; const uword in_row2 = row_span.b;
const uword subvec_n_rows = row_all ? local_n_rows : in_row2 - in_row1 + 1; const uword subvec_n_rows = row_all ? local_n_rows : in_row2 - in_row1 + 1;
arma_debug_check( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= loca l_n_rows)) ), "Col::subvec(): indices out of bounds or incorrectly used"); arma_debug_check( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= loca l_n_rows)) ), "Col::subvec(): indices out of bounds or incorrectly used" );
return subview_col<eT>(*this, 0, in_row1, subvec_n_rows); return subview_col<eT>(*this, 0, in_row1, subvec_n_rows);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
const subview_col<eT> const subview_col<eT>
Col<eT>::subvec(const span& row_span) const Col<eT>::subvec(const span& row_span) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const bool row_all = row_span.whole; const bool row_all = row_span.whole;
const uword local_n_rows = Mat<eT>::n_rows; const uword local_n_rows = Mat<eT>::n_rows;
const uword in_row1 = row_all ? 0 : row_span.a; const uword in_row1 = row_all ? 0 : row_span.a;
const uword in_row2 = row_span.b; const uword in_row2 = row_span.b;
const uword subvec_n_rows = row_all ? local_n_rows : in_row2 - in_row1 + 1; const uword subvec_n_rows = row_all ? local_n_rows : in_row2 - in_row1 + 1;
arma_debug_check( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= loca l_n_rows)) ), "Col::subvec(): indices out of bounds or incorrectly used"); arma_debug_check( ( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= loca l_n_rows)) ), "Col::subvec(): indices out of bounds or incorrectly used" );
return subview_col<eT>(*this, 0, in_row1, subvec_n_rows); return subview_col<eT>(*this, 0, in_row1, subvec_n_rows);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_col<eT> subview_col<eT>
Col<eT>::operator()(const span& row_span) Col<eT>::operator()(const span& row_span)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
skipping to change at line 677 skipping to change at line 677
return subview_col<eT>(*this, 0, start_row, s.n_rows); return subview_col<eT>(*this, 0, start_row, s.n_rows);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_col<eT> subview_col<eT>
Col<eT>::head(const uword N) Col<eT>::head(const uword N)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > Mat<eT>::n_rows), "Col::head(): size out of bounds"); arma_debug_check( (N > Mat<eT>::n_rows), "Col::head(): size out of bounds" );
return subview_col<eT>(*this, 0, 0, N); return subview_col<eT>(*this, 0, 0, N);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
const subview_col<eT> const subview_col<eT>
Col<eT>::head(const uword N) const Col<eT>::head(const uword N) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > Mat<eT>::n_rows), "Col::head(): size out of bounds"); arma_debug_check( (N > Mat<eT>::n_rows), "Col::head(): size out of bounds" );
return subview_col<eT>(*this, 0, 0, N); return subview_col<eT>(*this, 0, 0, N);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_col<eT> subview_col<eT>
Col<eT>::tail(const uword N) Col<eT>::tail(const uword N)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > Mat<eT>::n_rows), "Col::tail(): size out of bounds"); arma_debug_check( (N > Mat<eT>::n_rows), "Col::tail(): size out of bounds" );
const uword start_row = Mat<eT>::n_rows - N; const uword start_row = Mat<eT>::n_rows - N;
return subview_col<eT>(*this, 0, start_row, N); return subview_col<eT>(*this, 0, start_row, N);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
const subview_col<eT> const subview_col<eT>
Col<eT>::tail(const uword N) const Col<eT>::tail(const uword N) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > Mat<eT>::n_rows), "Col::tail(): size out of bounds"); arma_debug_check( (N > Mat<eT>::n_rows), "Col::tail(): size out of bounds" );
const uword start_row = Mat<eT>::n_rows - N; const uword start_row = Mat<eT>::n_rows - N;
return subview_col<eT>(*this, 0, start_row, N); return subview_col<eT>(*this, 0, start_row, N);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_col<eT> subview_col<eT>
Col<eT>::head_rows(const uword N) Col<eT>::head_rows(const uword N)
skipping to change at line 770 skipping to change at line 770
} }
//! remove specified row //! remove specified row
template<typename eT> template<typename eT>
inline inline
void void
Col<eT>::shed_row(const uword row_num) Col<eT>::shed_row(const uword row_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( row_num >= Mat<eT>::n_rows, "Col::shed_row(): index out of b ounds"); arma_debug_check( row_num >= Mat<eT>::n_rows, "Col::shed_row(): index out of b ounds" );
shed_rows(row_num, row_num); shed_rows(row_num, row_num);
} }
//! remove specified rows //! remove specified rows
template<typename eT> template<typename eT>
inline inline
void void
Col<eT>::shed_rows(const uword in_row1, const uword in_row2) Col<eT>::shed_rows(const uword in_row1, const uword in_row2)
{ {
skipping to change at line 837 skipping to change at line 837
Col<eT>::insert_rows(const uword row_num, const uword N, const bool set_to_zero) Col<eT>::insert_rows(const uword row_num, const uword N, const bool set_to_zero)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const uword t_n_rows = Mat<eT>::n_rows; const uword t_n_rows = Mat<eT>::n_rows;
const uword A_n_rows = row_num; const uword A_n_rows = row_num;
const uword B_n_rows = t_n_rows - row_num; const uword B_n_rows = t_n_rows - row_num;
// insertion at row_num == n_rows is in effect an append operation // insertion at row_num == n_rows is in effect an append operation
arma_debug_check( (row_num > t_n_rows), "Col::insert_rows(): index out of boun ds"); arma_debug_check( (row_num > t_n_rows), "Col::insert_rows(): index out of boun ds" );
if(N > 0) if(N > 0)
{ {
Col<eT> out(t_n_rows + N); Col<eT> out(t_n_rows + 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_rows > 0) if(A_n_rows > 0)
{ {
skipping to change at line 921 skipping to change at line 921
return Mat<eT>::mem[in_row]; return Mat<eT>::mem[in_row];
} }
template<typename eT> template<typename eT>
inline inline
typename Col<eT>::row_iterator typename Col<eT>::row_iterator
Col<eT>::begin_row(const uword row_num) Col<eT>::begin_row(const uword row_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::begin_row(): index out o f bounds"); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::begin_row(): index out o f bounds" );
return Mat<eT>::memptr() + row_num; return Mat<eT>::memptr() + row_num;
} }
template<typename eT> template<typename eT>
inline inline
typename Col<eT>::const_row_iterator typename Col<eT>::const_row_iterator
Col<eT>::begin_row(const uword row_num) const Col<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), "Col::begin_row(): index out o f bounds"); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::begin_row(): index out o f bounds" );
return Mat<eT>::memptr() + row_num; return Mat<eT>::memptr() + row_num;
} }
template<typename eT> template<typename eT>
inline inline
typename Col<eT>::row_iterator typename Col<eT>::row_iterator
Col<eT>::end_row(const uword row_num) Col<eT>::end_row(const uword row_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::end_row(): index out of bounds"); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::end_row(): index out of bounds" );
return Mat<eT>::memptr() + row_num + 1; return Mat<eT>::memptr() + row_num + 1;
} }
template<typename eT> template<typename eT>
inline inline
typename Col<eT>::const_row_iterator typename Col<eT>::const_row_iterator
Col<eT>::end_row(const uword row_num) const Col<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), "Col::end_row(): index out of bounds"); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::end_row(): index out of bounds" );
return Mat<eT>::memptr() + row_num + 1; return Mat<eT>::memptr() + row_num + 1;
} }
template<typename eT> template<typename eT>
template<uword fixed_n_elem> template<uword fixed_n_elem>
arma_inline arma_inline
Col<eT>::fixed<fixed_n_elem>::fixed() Col<eT>::fixed<fixed_n_elem>::fixed()
: Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extr a : Mat<eT>::mem_local) ) : Col<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&
Col<eT>::fixed<fixed_n_elem>::operator() (const uword ii) Col<eT>::fixed<fixed_n_elem>::operator() (const uword ii)
{ {
arma_debug_check( (ii >= fixed_n_elem), "Col::operator(): index out of bounds" ); arma_debug_check( (ii >= fixed_n_elem), "Col::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&
Col<eT>::fixed<fixed_n_elem>::operator() (const uword ii) const Col<eT>::fixed<fixed_n_elem>::operator() (const uword ii) const
{ {
arma_debug_check( (ii >= fixed_n_elem), "Col::operator(): index out of bounds" ); arma_debug_check( (ii >= fixed_n_elem), "Col::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&
Col<eT>::fixed<fixed_n_elem>::at(const uword in_row, const uword) Col<eT>::fixed<fixed_n_elem>::at(const uword in_row, const uword)
 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)