"Fossies" - the Fresh Open Source Software Archive  

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

SpMat_meat.hpp  (armadillo-10.2.0.tar.xz):SpMat_meat.hpp  (armadillo-10.2.1.tar.xz)
skipping to change at line 2492 skipping to change at line 2492
return (*this).submat(in_row1, in_col1, s); return (*this).submat(in_row1, in_col1, s);
} }
template<typename eT> template<typename eT>
inline inline
SpSubview<eT> SpSubview<eT>
SpMat<eT>::head_rows(const uword N) SpMat<eT>::head_rows(const uword N)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > n_rows), "SpMat::head_rows(): size out of bounds"); arma_debug_check( (N > n_rows), "SpMat::head_rows(): size out of bounds" );
return SpSubview<eT>(*this, 0, 0, N, n_cols); return SpSubview<eT>(*this, 0, 0, N, n_cols);
} }
template<typename eT> template<typename eT>
inline inline
const SpSubview<eT> const SpSubview<eT>
SpMat<eT>::head_rows(const uword N) const SpMat<eT>::head_rows(const uword N) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > n_rows), "SpMat::head_rows(): size out of bounds"); arma_debug_check( (N > n_rows), "SpMat::head_rows(): size out of bounds" );
return SpSubview<eT>(*this, 0, 0, N, n_cols); return SpSubview<eT>(*this, 0, 0, N, n_cols);
} }
template<typename eT> template<typename eT>
inline inline
SpSubview<eT> SpSubview<eT>
SpMat<eT>::tail_rows(const uword N) SpMat<eT>::tail_rows(const uword N)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > n_rows), "SpMat::tail_rows(): size out of bounds"); arma_debug_check( (N > n_rows), "SpMat::tail_rows(): size out of bounds" );
const uword start_row = n_rows - N; const uword start_row = n_rows - N;
return SpSubview<eT>(*this, start_row, 0, N, n_cols); return SpSubview<eT>(*this, start_row, 0, N, n_cols);
} }
template<typename eT> template<typename eT>
inline inline
const SpSubview<eT> const SpSubview<eT>
SpMat<eT>::tail_rows(const uword N) const SpMat<eT>::tail_rows(const uword N) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > n_rows), "SpMat::tail_rows(): size out of bounds"); arma_debug_check( (N > n_rows), "SpMat::tail_rows(): size out of bounds" );
const uword start_row = n_rows - N; const uword start_row = n_rows - N;
return SpSubview<eT>(*this, start_row, 0, N, n_cols); return SpSubview<eT>(*this, start_row, 0, N, n_cols);
} }
template<typename eT> template<typename eT>
inline inline
SpSubview<eT> SpSubview<eT>
SpMat<eT>::head_cols(const uword N) SpMat<eT>::head_cols(const uword N)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > n_cols), "SpMat::head_cols(): size out of bounds"); arma_debug_check( (N > n_cols), "SpMat::head_cols(): size out of bounds" );
return SpSubview<eT>(*this, 0, 0, n_rows, N); return SpSubview<eT>(*this, 0, 0, n_rows, N);
} }
template<typename eT> template<typename eT>
inline inline
const SpSubview<eT> const SpSubview<eT>
SpMat<eT>::head_cols(const uword N) const SpMat<eT>::head_cols(const uword N) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > n_cols), "SpMat::head_cols(): size out of bounds"); arma_debug_check( (N > n_cols), "SpMat::head_cols(): size out of bounds" );
return SpSubview<eT>(*this, 0, 0, n_rows, N); return SpSubview<eT>(*this, 0, 0, n_rows, N);
} }
template<typename eT> template<typename eT>
inline inline
SpSubview<eT> SpSubview<eT>
SpMat<eT>::tail_cols(const uword N) SpMat<eT>::tail_cols(const uword N)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > n_cols), "SpMat::tail_cols(): size out of bounds"); arma_debug_check( (N > n_cols), "SpMat::tail_cols(): size out of bounds" );
const uword start_col = n_cols - N; const uword start_col = n_cols - N;
return SpSubview<eT>(*this, 0, start_col, n_rows, N); return SpSubview<eT>(*this, 0, start_col, n_rows, N);
} }
template<typename eT> template<typename eT>
inline inline
const SpSubview<eT> const SpSubview<eT>
SpMat<eT>::tail_cols(const uword N) const SpMat<eT>::tail_cols(const uword N) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (N > n_cols), "SpMat::tail_cols(): size out of bounds"); arma_debug_check( (N > n_cols), "SpMat::tail_cols(): size out of bounds" );
const uword start_col = n_cols - N; const uword start_col = n_cols - N;
return SpSubview<eT>(*this, 0, start_col, n_rows, N); return SpSubview<eT>(*this, 0, start_col, n_rows, N);
} }
template<typename eT> template<typename eT>
template<typename T1> template<typename T1>
arma_inline arma_inline
SpSubview_col_list<eT, T1> SpSubview_col_list<eT, T1>
skipping to change at line 3026 skipping to change at line 3026
{ {
return get_value(i); return get_value(i);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
SpMat_MapMat_val<eT> SpMat_MapMat_val<eT>
SpMat<eT>::operator()(const uword i) SpMat<eT>::operator()(const uword i)
{ {
arma_debug_check( (i >= n_elem), "SpMat::operator(): out of bounds"); arma_debug_check( (i >= n_elem), "SpMat::operator(): out of bounds" );
const uword in_col = i / n_rows; const uword in_col = i / n_rows;
const uword in_row = i % n_rows; const uword in_row = i % n_rows;
return SpMat_MapMat_val<eT>((*this), cache, in_row, in_col); return SpMat_MapMat_val<eT>((*this), cache, in_row, in_col);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT eT
SpMat<eT>::operator()(const uword i) const SpMat<eT>::operator()(const uword i) const
{ {
arma_debug_check( (i >= n_elem), "SpMat::operator(): out of bounds"); arma_debug_check( (i >= n_elem), "SpMat::operator(): out of bounds" );
return get_value(i); return get_value(i);
} }
/** /**
* Element access; access the element at row in_rows and column in_col. * Element access; access the element at row in_rows and column in_col.
* If there is nothing at that position, 0 is returned. * If there is nothing at that position, 0 is returned.
*/ */
template<typename eT> template<typename eT>
skipping to change at line 3074 skipping to change at line 3074
{ {
return get_value(in_row, in_col); return get_value(in_row, in_col);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
SpMat_MapMat_val<eT> SpMat_MapMat_val<eT>
SpMat<eT>::operator()(const uword in_row, const uword in_col) SpMat<eT>::operator()(const uword in_row, const uword in_col)
{ {
arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "SpMat::operator (): out of bounds"); arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "SpMat::operator (): out of bounds" );
return SpMat_MapMat_val<eT>((*this), cache, in_row, in_col); return SpMat_MapMat_val<eT>((*this), cache, in_row, in_col);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT eT
SpMat<eT>::operator()(const uword in_row, const uword in_col) const SpMat<eT>::operator()(const uword in_row, const uword in_col) const
{ {
arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "SpMat::operator (): out of bounds"); arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "SpMat::operator (): out of bounds" );
return get_value(in_row, in_col); return get_value(in_row, in_col);
} }
/** /**
* Check if matrix is empty (no size, no values). * Check if matrix is empty (no size, no values).
*/ */
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
 End of changes. 12 change blocks. 
12 lines changed or deleted 12 lines changed or added

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