Col_meat.hpp   Col_meat.hpp 
skipping to change at line 850 skipping to change at line 850
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), "begin_row(): index out o f bounds"); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::begin_row(): index out of 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), "begin_row(): index out o f bounds"); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::begin_row(): index out of 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), "end_row(): index out of bounds"); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::end_row(): index ou t 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), "end_row(): index out of bounds"); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Col::end_row(): index ou t 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
void void
Col<eT>::fixed<fixed_n_elem>::change_to_row() Col<eT>::fixed<fixed_n_elem>::change_to_row()
{ {
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added


 Cube_meat.hpp   Cube_meat.hpp 
skipping to change at line 137 skipping to change at line 137
#endif #endif
template<typename eT> template<typename eT>
inline inline
void void
Cube<eT>::init_cold() Cube<eT>::init_cold()
{ {
arma_extra_debug_sigprint( arma_boost::format("n_rows = %d, n_cols = %d, n_slices = %d") % n_rows % n_cols % n_slices ); arma_extra_debug_sigprint( arma_boost::format("n_rows = %d, n_cols = %d, n_slices = %d") % n_rows % n_cols % n_slices );
#if (defined(ARMA_USE_CXX11) || defined(ARMA_64BIT_WORD))
const char* error_message = "Cube::init(): requested size is too large"
;
#else
const char* error_message = "Cube::init(): requested size is too large;
suggest to compile in C++11 mode or enable ARMA_64BIT_WORD";
#endif
arma_debug_check arma_debug_check
( (
( (
( (n_rows > 0x0FFF) || (n_cols > 0x0FFF) || (n_slices > 0xFF) ) ( (n_rows > 0x0FFF) || (n_cols > 0x0FFF) || (n_slices > 0xFF) )
? ( (float(n_rows) * float(n_cols) * float(n_slices)) > float(ARMA_ MAX_UWORD) ) ? ( (double(n_rows) * double(n_cols) * double(n_slices)) > double(A RMA_MAX_UWORD) )
: false : false
), ),
"Cube::init(): requested size is too large; suggest to enable ARMA_64BI T_WORD" error_message
); );
if(n_elem <= Cube_prealloc::mem_n_elem) if(n_elem <= Cube_prealloc::mem_n_elem)
{ {
arma_extra_debug_print("Cube::init(): using local memory"); arma_extra_debug_print("Cube::init(): using local memory");
access::rw(mem) = mem_local; access::rw(mem) = mem_local;
} }
else else
{ {
skipping to change at line 200 skipping to change at line 206
char* err_msg = 0; char* err_msg = 0;
arma_debug_set_error arma_debug_set_error
( (
err_state, err_state,
err_msg, err_msg,
(t_mem_state == 3), (t_mem_state == 3),
"Cube::init(): size is fixed and hence cannot be changed" "Cube::init(): size is fixed and hence cannot be changed"
); );
#if (defined(ARMA_USE_CXX11) || defined(ARMA_64BIT_WORD))
const char* error_message = "Cube::init(): requested size is too large"
;
#else
const char* error_message = "Cube::init(): requested size is too large;
suggest to compile in C++11 mode or enable ARMA_64BIT_WORD";
#endif
arma_debug_set_error arma_debug_set_error
( (
err_state, err_state,
err_msg, err_msg,
( (
( (in_n_rows > 0x0FFF) || (in_n_cols > 0x0FFF) || (in_n_slices > 0xFF ) ) ( (in_n_rows > 0x0FFF) || (in_n_cols > 0x0FFF) || (in_n_slices > 0xFF ) )
? ( (float(in_n_rows) * float(in_n_cols) * float(in_n_slices)) > fl oat(ARMA_MAX_UWORD) ) ? ( (double(in_n_rows) * double(in_n_cols) * double(in_n_slices)) > double(ARMA_MAX_UWORD) )
: false : false
), ),
"Cube::init(): requested size is too large" error_message
); );
arma_debug_check(err_state, err_msg); arma_debug_check(err_state, err_msg);
const uword old_n_elem = n_elem; const uword old_n_elem = n_elem;
const uword new_n_elem = in_n_rows * in_n_cols * in_n_slices; const uword new_n_elem = in_n_rows * in_n_cols * in_n_slices;
if(old_n_elem == new_n_elem) if(old_n_elem == new_n_elem)
{ {
delete_mat(); delete_mat();
 End of changes. 6 change blocks. 
4 lines changed or deleted 20 lines changed or added


 Mat_bones.hpp   Mat_bones.hpp 
skipping to change at line 127 skipping to change at line 127
inline const Mat& operator/=(const subview_cube<eT>& X); inline const Mat& operator/=(const subview_cube<eT>& X);
inline Mat(const diagview<eT>& X); inline Mat(const diagview<eT>& X);
inline const Mat& operator=(const diagview<eT>& X); inline const Mat& operator=(const diagview<eT>& X);
inline const Mat& operator+=(const diagview<eT>& X); inline const Mat& operator+=(const diagview<eT>& X);
inline const Mat& operator-=(const diagview<eT>& X); inline const Mat& operator-=(const diagview<eT>& X);
inline const Mat& operator*=(const diagview<eT>& X); inline const Mat& operator*=(const diagview<eT>& X);
inline const Mat& operator%=(const diagview<eT>& X); inline const Mat& operator%=(const diagview<eT>& X);
inline const Mat& operator/=(const diagview<eT>& X); inline const Mat& operator/=(const diagview<eT>& X);
inline Mat(const spdiagview<eT>& X);
inline const Mat& operator=(const spdiagview<eT>& X);
inline const Mat& operator+=(const spdiagview<eT>& X);
inline const Mat& operator-=(const spdiagview<eT>& X);
inline const Mat& operator*=(const spdiagview<eT>& X);
inline const Mat& operator%=(const spdiagview<eT>& X);
inline const Mat& operator/=(const spdiagview<eT>& X);
template<typename T1> inline Mat(const subview_elem1<eT ,T1>& X); template<typename T1> inline Mat(const subview_elem1<eT ,T1>& X);
template<typename T1> inline const Mat& operator= (const subview_elem1<eT ,T1>& X); template<typename T1> inline const Mat& operator= (const subview_elem1<eT ,T1>& X);
template<typename T1> inline const Mat& operator+=(const subview_elem1<eT ,T1>& X); template<typename T1> inline const Mat& operator+=(const subview_elem1<eT ,T1>& X);
template<typename T1> inline const Mat& operator-=(const subview_elem1<eT ,T1>& X); template<typename T1> inline const Mat& operator-=(const subview_elem1<eT ,T1>& X);
template<typename T1> inline const Mat& operator*=(const subview_elem1<eT ,T1>& X); template<typename T1> inline const Mat& operator*=(const subview_elem1<eT ,T1>& X);
template<typename T1> inline const Mat& operator%=(const subview_elem1<eT ,T1>& X); template<typename T1> inline const Mat& operator%=(const subview_elem1<eT ,T1>& X);
template<typename T1> inline const Mat& operator/=(const subview_elem1<eT ,T1>& X); template<typename T1> inline const Mat& operator/=(const subview_elem1<eT ,T1>& X);
template<typename T1, typename T2> inline Mat(const sub view_elem2<eT,T1,T2>& X); template<typename T1, typename T2> inline Mat(const sub view_elem2<eT,T1,T2>& X);
template<typename T1, typename T2> inline const Mat& operator= (const sub view_elem2<eT,T1,T2>& X); template<typename T1, typename T2> inline const Mat& operator= (const sub view_elem2<eT,T1,T2>& X);
 End of changes. 1 change blocks. 
0 lines changed or deleted 8 lines changed or added


 Mat_meat.hpp   Mat_meat.hpp 
skipping to change at line 135 skipping to change at line 135
template<typename eT> template<typename eT>
inline inline
void void
Mat<eT>::init_cold() Mat<eT>::init_cold()
{ {
arma_extra_debug_sigprint( arma_boost::format("n_rows = %d, n_cols = %d") % n_rows % n_cols ); arma_extra_debug_sigprint( arma_boost::format("n_rows = %d, n_cols = %d") % n_rows % n_cols );
// ensure that n_elem can hold the result of (n_rows * n_cols) // ensure that n_elem can hold the result of (n_rows * n_cols)
#if (defined(ARMA_USE_CXX11) || defined(ARMA_64BIT_WORD))
const char* error_message = "Mat::init(): requested size is too large";
#else
const char* error_message = "Mat::init(): requested size is too large;
suggest to compile in C++11 mode or enable ARMA_64BIT_WORD";
#endif
arma_debug_check arma_debug_check
( (
( (
( (n_rows > ARMA_MAX_UHWORD) || (n_cols > ARMA_MAX_UHWORD) ) ( (n_rows > ARMA_MAX_UHWORD) || (n_cols > ARMA_MAX_UHWORD) )
? ( (float(n_rows) * float(n_cols)) > float(ARMA_MAX_UWORD) ) ? ( (double(n_rows) * double(n_cols)) > double(ARMA_MAX_UWORD) )
: false : false
), ),
"Mat::init(): requested size is too large; suggest to enable ARMA_64BIT _WORD" error_message
); );
if(n_elem <= arma_config::mat_prealloc) if(n_elem <= arma_config::mat_prealloc)
{ {
arma_extra_debug_print("Mat::init(): using local memory"); arma_extra_debug_print("Mat::init(): using local memory");
access::rw(mem) = mem_local; access::rw(mem) = mem_local;
} }
else else
{ {
skipping to change at line 228 skipping to change at line 234
err_msg, err_msg,
(in_n_rows != 1), (in_n_rows != 1),
"Mat::init(): requested size is not compatible with row vector la yout" "Mat::init(): requested size is not compatible with row vector la yout"
); );
} }
} }
} }
// ensure that n_elem can hold the result of (n_rows * n_cols) // ensure that n_elem can hold the result of (n_rows * n_cols)
#if (defined(ARMA_USE_CXX11) || defined(ARMA_64BIT_WORD))
const char* error_message = "Mat::init(): requested size is too large";
#else
const char* error_message = "Mat::init(): requested size is too large;
suggest to compile in C++11 mode or enable ARMA_64BIT_WORD";
#endif
arma_debug_set_error arma_debug_set_error
( (
err_state, err_state,
err_msg, err_msg,
( (
( (in_n_rows > ARMA_MAX_UHWORD) || (in_n_cols > ARMA_MAX_UHWORD) ) ( (in_n_rows > ARMA_MAX_UHWORD) || (in_n_cols > ARMA_MAX_UHWORD) )
? ( (float(in_n_rows) * float(in_n_cols)) > float(ARMA_MAX_UWORD) ) ? ( (double(in_n_rows) * double(in_n_cols)) > double(ARMA_MAX_UWORD ) )
: false : false
), ),
"Mat::init(): requested size is too large" error_message
); );
arma_debug_check(err_state, err_msg); arma_debug_check(err_state, err_msg);
const uword old_n_elem = n_elem; const uword old_n_elem = n_elem;
const uword new_n_elem = in_n_rows * in_n_cols; const uword new_n_elem = in_n_rows * in_n_cols;
if(old_n_elem == new_n_elem) if(old_n_elem == new_n_elem)
{ {
arma_extra_debug_print("Mat::init(): reusing memory"); arma_extra_debug_print("Mat::init(): reusing memory");
skipping to change at line 1978 skipping to change at line 1990
Mat<eT>::operator/=(const diagview<eT>& X) Mat<eT>::operator/=(const diagview<eT>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
diagview<eT>::div_inplace(*this, X); diagview<eT>::div_inplace(*this, X);
return *this; return *this;
} }
template<typename eT> template<typename eT>
inline
Mat<eT>::Mat(const spdiagview<eT>& X)
: n_rows(X.n_rows)
, n_cols(X.n_cols)
, n_elem(X.n_elem)
, vec_state(0)
, mem_state(0)
, mem()
{
arma_extra_debug_sigprint_this(this);
init_cold();
spdiagview<eT>::extract(*this, X);
}
template<typename eT>
inline
const Mat<eT>&
Mat<eT>::operator=(const spdiagview<eT>& X)
{
arma_extra_debug_sigprint();
init_warm(X.n_rows, X.n_cols);
spdiagview<eT>::extract(*this, X);
return *this;
}
template<typename eT>
inline
const Mat<eT>&
Mat<eT>::operator+=(const spdiagview<eT>& X)
{
arma_extra_debug_sigprint();
const Mat<eT> tmp(X);
(*this).operator+=(tmp);
return *this;
}
template<typename eT>
inline
const Mat<eT>&
Mat<eT>::operator-=(const spdiagview<eT>& X)
{
arma_extra_debug_sigprint();
const Mat<eT> tmp(X);
(*this).operator-=(tmp);
return *this;
}
template<typename eT>
inline
const Mat<eT>&
Mat<eT>::operator*=(const spdiagview<eT>& X)
{
arma_extra_debug_sigprint();
const Mat<eT> tmp(X);
(*this).operator*=(tmp);
return *this;
}
template<typename eT>
inline
const Mat<eT>&
Mat<eT>::operator%=(const spdiagview<eT>& X)
{
arma_extra_debug_sigprint();
const Mat<eT> tmp(X);
(*this).operator%=(tmp);
return *this;
}
template<typename eT>
inline
const Mat<eT>&
Mat<eT>::operator/=(const spdiagview<eT>& X)
{
arma_extra_debug_sigprint();
const Mat<eT> tmp(X);
(*this).operator/=(tmp);
return *this;
}
template<typename eT>
template<typename T1> template<typename T1>
inline inline
Mat<eT>::Mat(const subview_elem1<eT,T1>& X) Mat<eT>::Mat(const subview_elem1<eT,T1>& X)
: n_rows(0) : n_rows(0)
, n_cols(0) , n_cols(0)
, n_elem(0) , n_elem(0)
, vec_state(0) , vec_state(0)
, mem_state(0) , mem_state(0)
, mem() , mem()
{ {
skipping to change at line 6335 skipping to change at line 6448
return memptr() + n_elem; return memptr() + n_elem;
} }
template<typename eT> template<typename eT>
inline inline
typename Mat<eT>::col_iterator typename Mat<eT>::col_iterator
Mat<eT>::begin_col(const uword col_num) Mat<eT>::begin_col(const uword col_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (col_num >= n_cols), "begin_col(): index out of bounds" ); arma_debug_check( (col_num >= n_cols), "Mat::begin_col(): index out of bo unds");
return colptr(col_num); return colptr(col_num);
} }
template<typename eT> template<typename eT>
inline inline
typename Mat<eT>::const_col_iterator typename Mat<eT>::const_col_iterator
Mat<eT>::begin_col(const uword col_num) const Mat<eT>::begin_col(const uword col_num) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (col_num >= n_cols), "begin_col(): index out of bounds" ); arma_debug_check( (col_num >= n_cols), "Mat::begin_col(): index out of bo unds");
return colptr(col_num); return colptr(col_num);
} }
template<typename eT> template<typename eT>
inline inline
typename Mat<eT>::col_iterator typename Mat<eT>::col_iterator
Mat<eT>::end_col(const uword col_num) Mat<eT>::end_col(const uword col_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (col_num >= n_cols), "end_col(): index out of bounds"); arma_debug_check( (col_num >= n_cols), "Mat::end_col(): index out of boun ds");
return colptr(col_num) + n_rows; return colptr(col_num) + n_rows;
} }
template<typename eT> template<typename eT>
inline inline
typename Mat<eT>::const_col_iterator typename Mat<eT>::const_col_iterator
Mat<eT>::end_col(const uword col_num) const Mat<eT>::end_col(const uword col_num) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (col_num >= n_cols), "end_col(): index out of bounds"); arma_debug_check( (col_num >= n_cols), "Mat::end_col(): index out of boun ds");
return colptr(col_num) + n_rows; return colptr(col_num) + n_rows;
} }
template<typename eT> template<typename eT>
inline inline
typename Mat<eT>::row_iterator typename Mat<eT>::row_iterator
Mat<eT>::begin_row(const uword row_num) Mat<eT>::begin_row(const uword row_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
 End of changes. 11 change blocks. 
8 lines changed or deleted 123 lines changed or added


 Op_bones.hpp   Op_bones.hpp 
skipping to change at line 39 skipping to change at line 39
static const bool is_row = \ static const bool is_row = \
(T1::is_col && (is_same_type<op_type, op_strans>::yes || is_same_type< op_type, op_htrans>::yes || is_same_type<op_type, op_htrans2>::yes)) (T1::is_col && (is_same_type<op_type, op_strans>::yes || is_same_type< op_type, op_htrans>::yes || is_same_type<op_type, op_htrans2>::yes))
|| (T1::is_row && (is_same_type<op_type, op_sort>::yes || is_same_type<op _type, op_shuffle>::yes || is_same_type<op_type, op_cumsum_vec>::yes || is_ same_type<op_type, op_flipud>::yes || is_same_type<op_type, op_fliplr>::yes )) || (T1::is_row && (is_same_type<op_type, op_sort>::yes || is_same_type<op _type, op_shuffle>::yes || is_same_type<op_type, op_cumsum_vec>::yes || is_ same_type<op_type, op_flipud>::yes || is_same_type<op_type, op_fliplr>::yes ))
|| (is_same_type<op_type, op_normalise_rowvec>::yes); || (is_same_type<op_type, op_normalise_rowvec>::yes);
static const bool is_col = \ static const bool is_col = \
(T1::is_row && (is_same_type<op_type, op_strans>::yes || is_same_type< op_type, op_htrans>::yes || is_same_type<op_type, op_htrans2>::yes)) (T1::is_row && (is_same_type<op_type, op_strans>::yes || is_same_type< op_type, op_htrans>::yes || is_same_type<op_type, op_htrans2>::yes))
|| (T1::is_col && (is_same_type<op_type, op_sort>::yes || is_same_type<op _type, op_shuffle>::yes || is_same_type<op_type, op_cumsum_vec>::yes || is_ same_type<op_type, op_flipud>::yes || is_same_type<op_type, op_fliplr>::yes )) || (T1::is_col && (is_same_type<op_type, op_sort>::yes || is_same_type<op _type, op_shuffle>::yes || is_same_type<op_type, op_cumsum_vec>::yes || is_ same_type<op_type, op_flipud>::yes || is_same_type<op_type, op_fliplr>::yes ))
|| (is_same_type<op_type, op_normalise_colvec>::yes) || (is_same_type<op_type, op_normalise_colvec>::yes)
|| (is_same_type<op_type, op_diagvec>::yes) || (is_same_type<op_type, op_diagvec>::yes)
|| (is_same_type<op_type, op_vectorise_col>::yes); || (is_same_type<op_type, op_vectorise_col>::yes)
|| (is_same_type<op_type, op_nonzeros>::yes);
inline explicit Op(const T1& in_m); inline explicit Op(const T1& in_m);
inline Op(const T1& in_m, const elem_type in_aux); inline Op(const T1& in_m, const elem_type in_aux);
inline Op(const T1& in_m, const elem_type in_aux, const uword in_aux_uword_a, const uword in_aux_uword_b); inline Op(const T1& in_m, const elem_type in_aux, const uword in_aux_uword_a, const uword in_aux_uword_b);
inline Op(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b); inline Op(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b);
inline Op(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b, const uword in_aux_uword_c, const char junk); inline Op(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b, const uword in_aux_uword_c, const char junk);
inline ~Op(); inline ~Op();
arma_aligned const T1& m; //!< storage of reference to t he operand (eg. a matrix) arma_aligned const T1& m; //!< storage of reference to t he operand (eg. a matrix)
arma_aligned elem_type aux; //!< storage of auxiliary data , user defined format arma_aligned elem_type aux; //!< storage of auxiliary data , user defined format
 End of changes. 1 change blocks. 
1 lines changed or deleted 2 lines changed or added


 Proxy.hpp   Proxy.hpp 
skipping to change at line 1582 skipping to change at line 1582
arma_inline ea_type get_ea() const { return Q; } arma_inline ea_type get_ea() const { return Q; }
arma_inline aligned_ea_type get_aligned_ea() const { return Q; } arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&(Q .m)) == void_ptr(&X)); } arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&(Q .m)) == void_ptr(&X)); }
arma_inline bool is_aligned() const { return false; } arma_inline bool is_aligned() const { return false; }
}; };
template<typename eT>
class Proxy< spdiagview<eT> >
{
public:
typedef eT elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
typedef spdiagview<eT> stored_type;
typedef const spdiagview<eT>& ea_type;
typedef const spdiagview<eT>& aligned_ea_type;
static const bool prefer_at_accessor = false;
static const bool has_subview = false;
static const bool fake_mat = false;
static const bool is_row = false;
static const bool is_col = true;
arma_aligned const spdiagview<eT>& Q;
inline explicit Proxy(const spdiagview<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
arma_inline uword get_n_cols() const { return 1; }
arma_inline uword get_n_elem() const { return Q.n_elem; }
arma_inline elem_type operator[] (const uword i) const { r
eturn Q[i]; }
arma_inline elem_type at (const uword row, const uword) const { r
eturn Q.at(row, 0); }
arma_inline elem_type at_alt (const uword i) const { r
eturn Q[i]; }
arma_inline ea_type get_ea() const { return Q; }
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>&) const { return false; }
arma_inline bool is_aligned() const { return false; }
};
template<typename T1, typename eop_type> template<typename T1, typename eop_type>
class Proxy< eOp<T1, eop_type > > class Proxy< eOp<T1, eop_type > >
{ {
public: public:
typedef typename T1::elem_type elem_type; typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef eOp<T1, eop_type> stored_type; typedef eOp<T1, eop_type> stored_type;
typedef const eOp<T1, eop_type>& ea_type; typedef const eOp<T1, eop_type>& ea_type;
typedef const eOp<T1, eop_type>& aligned_ea_type; typedef const eOp<T1, eop_type>& aligned_ea_type;
 End of changes. 1 change blocks. 
0 lines changed or deleted 46 lines changed or added


 Row_meat.hpp   Row_meat.hpp 
skipping to change at line 816 skipping to change at line 816
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), "begin_row(): index out o f bounds"); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Row::begin_row(): index out of 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), "begin_row(): index out o f bounds"); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Row::begin_row(): index out of 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), "end_row(): index out of bounds"); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Row::end_row(): index ou t 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), "end_row(): index out of bounds"); arma_debug_check( (row_num >= Mat<eT>::n_rows), "Row::end_row(): index ou t 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>
inline 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 _extra : Mat<eT>::mem_local) ) : Row<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local _extra : Mat<eT>::mem_local) )
{ {
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added


 SpCol_bones.hpp   SpCol_bones.hpp 
skipping to change at line 45 skipping to change at line 45
template<typename T1> inline SpCol(const Base<eT,T1>& X) ; template<typename T1> inline SpCol(const Base<eT,T1>& X) ;
template<typename T1> inline const SpCol& operator=(const Base<eT,T1>& X) ; template<typename T1> inline const SpCol& operator=(const Base<eT,T1>& X) ;
template<typename T1> inline SpCol(const SpBase<eT,T1>& X); template<typename T1> inline SpCol(const SpBase<eT,T1>& X);
template<typename T1> inline const SpCol& operator=(const SpBase<eT,T1>& X); template<typename T1> inline const SpCol& operator=(const SpBase<eT,T1>& X);
template<typename T1, typename T2> template<typename T1, typename T2>
inline explicit SpCol(const SpBase<pod_type,T1>& A, const SpBase<pod_type ,T2>& B); inline explicit SpCol(const SpBase<pod_type,T1>& A, const SpBase<pod_type ,T2>& B);
inline SpValProxy<SpMat<eT> > row(const uword row_num);
inline eT row(const uword row_num) const;
// arma_inline subview_col<eT> rows(const uword in_row1, const uword
in_row2);
// arma_inline const subview_col<eT> rows(const uword in_row1, const uword
in_row2) const;
// arma_inline subview_col<eT> subvec(const uword in_row1, const uwo
rd in_row2);
// arma_inline const subview_col<eT> subvec(const uword in_row1, const uwo
rd in_row2) const;
// arma_inline subview_col<eT> subvec(const span& row_span);
// arma_inline const subview_col<eT> subvec(const span& row_span) const;
inline void shed_row (const uword row_num); inline void shed_row (const uword row_num);
inline void shed_rows(const uword in_row1, const uword in_row2); inline void shed_rows(const uword in_row1, const uword in_row2);
// inline void insert_rows(const uword row_num, con // inline void insert_rows(const uword row_num, const uword N, const bool
st uword N, const bool set_to_zero = true); set_to_zero = true);
// template<typename T1> inline void insert_rows(const uword row_num, con
st Base<eT,T1>& X);
typedef typename SpMat<eT>::iterator row_iterator; typedef typename SpMat<eT>::iterator row_iterator;
typedef typename SpMat<eT>::const_iterator const_row_iterator; typedef typename SpMat<eT>::const_iterator const_row_iterator;
inline row_iterator begin_row(const uword row_num = 0); inline row_iterator begin_row(const uword row_num = 0);
inline const_row_iterator begin_row(const uword row_num = 0) const; inline const_row_iterator begin_row(const uword row_num = 0) const;
inline row_iterator end_row (const uword row_num = 0); inline row_iterator end_row (const uword row_num = 0);
inline const_row_iterator end_row (const uword row_num = 0) const; inline const_row_iterator end_row (const uword row_num = 0) const;
 End of changes. 2 change blocks. 
20 lines changed or deleted 2 lines changed or added


 SpCol_meat.hpp   SpCol_meat.hpp 
// Copyright (C) 2011-2012 Ryan Curtin // Copyright (C) 2011-2012 Ryan Curtin
// Copyright (C) 2015 Conrad Sanderson
// Copyright (C) 2011 Matthew Amidon // Copyright (C) 2011 Matthew Amidon
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup SpCol //! \addtogroup SpCol
//! @{ //! @{
//! construct an empty column vector //! construct an empty column vector
skipping to change at line 181 skipping to change at line 182
const SpBase<typename SpCol<eT>::pod_type, T2>& B const SpBase<typename SpCol<eT>::pod_type, T2>& B
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
access::rw(SpMat<eT>::vec_state) = 1; access::rw(SpMat<eT>::vec_state) = 1;
SpMat<eT>::init(A,B); SpMat<eT>::init(A,B);
} }
template<typename eT>
inline
SpValProxy< SpMat<eT> >
SpCol<eT>::row(const uword row_num)
{
arma_debug_check( (row_num >= SpMat<eT>::n_rows), "SpCol::row(): out of b
ounds" );
return SpMat<eT>::at(row_num, 0);
}
template<typename eT>
inline
eT
SpCol<eT>::row(const uword row_num) const
{
arma_debug_check( (row_num >= SpMat<eT>::n_rows), "SpCol::row(): out of b
ounds" );
return SpMat<eT>::at(row_num, 0);
}
/*
template<typename eT>
arma_inline
subview_col<eT>
SpCol<eT>::rows(const uword in_row1, const uword in_row2)
{
arma_extra_debug_sigprint();
arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= SpMat<eT>::n_rows)
), "Col::rows(): indices out of bounds or incorrectly used");
const uword subview_n_rows = in_row2 - in_row1 + 1;
return subview_col<eT>(*this, 0, in_row1, subview_n_rows);
}
template<typename eT>
arma_inline
const subview_col<eT>
SpCol<eT>::rows(const uword in_row1, const uword in_row2) const
{
arma_extra_debug_sigprint();
arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= SpMat<eT>::n_rows)
), "Col::rows(): indices out of bounds or incorrectly used");
const uword subview_n_rows = in_row2 - in_row1 + 1;
return subview_col<eT>(*this, 0, in_row1, subview_n_rows);
}
template<typename eT>
arma_inline
subview_col<eT>
SpCol<eT>::subvec(const uword in_row1, const uword in_row2)
{
arma_extra_debug_sigprint();
arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= SpMat<eT>::n_rows)
), "Col::subvec(): indices out of bounds or incorrectly used");
const uword subview_n_rows = in_row2 - in_row1 + 1;
return subview_col<eT>(*this, 0, in_row1, subview_n_rows);
}
template<typename eT>
arma_inline
const subview_col<eT>
SpCol<eT>::subvec(const uword in_row1, const uword in_row2) const
{
arma_extra_debug_sigprint();
arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= SpMat<eT>::n_rows)
), "Col::subvec(): indices out of bounds or incorrectly used");
const uword subview_n_rows = in_row2 - in_row1 + 1;
return subview_col<eT>(*this, 0, in_row1, subview_n_rows);
}
template<typename eT>
arma_inline
subview_col<eT>
SpCol<eT>::subvec(const span& row_span)
{
arma_extra_debug_sigprint();
const bool row_all = row_span.whole;
const uword local_n_rows = SpMat<eT>::n_rows;
const uword in_row1 = row_all ? 0 : row_span.a;
const uword in_row2 = row_span.b;
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 >=
local_n_rows)) ), "Col::subvec(): indices out of bounds or incorrectly use
d");
return subview_col<eT>(*this, 0, in_row1, subvec_n_rows);
}
template<typename eT>
arma_inline
const subview_col<eT>
SpCol<eT>::subvec(const span& row_span) const
{
arma_extra_debug_sigprint();
const bool row_all = row_span.whole;
const uword local_n_rows = SpMat<eT>::n_rows;
const uword in_row1 = row_all ? 0 : row_span.a;
const uword in_row2 = row_span.b;
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 >=
local_n_rows)) ), "Col::subvec(): indices out of bounds or incorrectly use
d");
return subview_col<eT>(*this, 0, in_row1, subvec_n_rows);
}
*/
//! remove specified row //! remove specified row
template<typename eT> template<typename eT>
inline inline
void void
SpCol<eT>::shed_row(const uword row_num) SpCol<eT>::shed_row(const uword row_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( row_num >= SpMat<eT>::n_rows, "SpCol::shed_row(): out o f bounds"); arma_debug_check( row_num >= SpMat<eT>::n_rows, "SpCol::shed_row(): out o f bounds");
skipping to change at line 389 skipping to change at line 272
access::rw(SpMat<eT>::values) = new_values; access::rw(SpMat<eT>::values) = new_values;
access::rw(SpMat<eT>::row_indices) = new_row_indices; access::rw(SpMat<eT>::row_indices) = new_row_indices;
access::rw(SpMat<eT>::n_nonzero) -= elem_diff; access::rw(SpMat<eT>::n_nonzero) -= elem_diff;
access::rw(SpMat<eT>::col_ptrs[1]) -= elem_diff; access::rw(SpMat<eT>::col_ptrs[1]) -= elem_diff;
} }
access::rw(SpMat<eT>::n_rows) -= diff; access::rw(SpMat<eT>::n_rows) -= diff;
access::rw(SpMat<eT>::n_elem) -= diff; access::rw(SpMat<eT>::n_elem) -= diff;
} }
// //! insert N rows at the specified row position, // //! insert N rows at the specified row position,
// //! optionally setting the elements of the inserted rows to zero // //! optionally setting the elements of the inserted rows to zero
// template<typename eT> // template<typename eT>
// inline // inline
// void // void
// SpCol<eT>::insert_rows(const uword row_num, const uword N, const bool se t_to_zero) // SpCol<eT>::insert_rows(const uword row_num, const uword N, const bool se t_to_zero)
// { // {
// arma_extra_debug_sigprint(); // arma_extra_debug_sigprint();
skipping to change at line 416 skipping to change at line 298
// { // {
// if (SpMat<eT>::row_indices[row] >= row_num) // if (SpMat<eT>::row_indices[row] >= row_num)
// { // {
// access::rw(SpMat<eT>::row_indices[row]) += N; // access::rw(SpMat<eT>::row_indices[row]) += N;
// } // }
// } // }
// //
// access::rw(SpMat<eT>::n_rows) += N; // access::rw(SpMat<eT>::n_rows) += N;
// access::rw(SpMat<eT>::n_elem) += N; // access::rw(SpMat<eT>::n_elem) += N;
// } // }
//
//
//
// //! insert the given object at the specified row position;
// //! the given object must have one column
// template<typename eT>
// template<typename T1>
// inline
// void
// SpCol<eT>::insert_rows(const uword row_num, const Base<eT,T1>& X)
// {
// arma_extra_debug_sigprint();
//
// SpMat<eT>::insert_rows(row_num, X);
// }
template<typename eT> template<typename eT>
inline inline
typename SpCol<eT>::row_iterator typename SpCol<eT>::row_iterator
SpCol<eT>::begin_row(const uword row_num) SpCol<eT>::begin_row(const uword row_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (row_num >= SpMat<eT>::n_rows), "begin_row(): index out of bounds"); arma_debug_check( (row_num >= SpMat<eT>::n_rows), "SpCol::begin_row(): in dex out of bounds");
return row_iterator(*this, row_num, 0); return row_iterator(*this, row_num, 0);
} }
template<typename eT> template<typename eT>
inline inline
typename SpCol<eT>::const_row_iterator typename SpCol<eT>::const_row_iterator
SpCol<eT>::begin_row(const uword row_num) const SpCol<eT>::begin_row(const uword row_num) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (row_num >= SpMat<eT>::n_rows), "begin_row(): index out of bounds"); arma_debug_check( (row_num >= SpMat<eT>::n_rows), "SpCol::begin_row(): in dex out of bounds");
return const_row_iterator(*this, row_num, 0); return const_row_iterator(*this, row_num, 0);
} }
template<typename eT> template<typename eT>
inline inline
typename SpCol<eT>::row_iterator typename SpCol<eT>::row_iterator
SpCol<eT>::end_row(const uword row_num) SpCol<eT>::end_row(const uword row_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (row_num >= SpMat<eT>::n_rows), "end_row(): index out o f bounds"); arma_debug_check( (row_num >= SpMat<eT>::n_rows), "SpCol::end_row(): inde x out of bounds");
return row_iterator(*this, row_num + 1, 0); return row_iterator(*this, row_num + 1, 0);
} }
template<typename eT> template<typename eT>
inline inline
typename SpCol<eT>::const_row_iterator typename SpCol<eT>::const_row_iterator
SpCol<eT>::end_row(const uword row_num) const SpCol<eT>::end_row(const uword row_num) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (row_num >= SpMat<eT>::n_rows), "end_row(): index out o f bounds"); arma_debug_check( (row_num >= SpMat<eT>::n_rows), "SpCol::end_row(): inde x out of bounds");
return const_row_iterator(*this, row_num + 1, 0); return const_row_iterator(*this, row_num + 1, 0);
} }
#ifdef ARMA_EXTRA_SPCOL_MEAT #ifdef ARMA_EXTRA_SPCOL_MEAT
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_SPCOL_MEAT) #include ARMA_INCFILE_WRAP(ARMA_EXTRA_SPCOL_MEAT)
#endif #endif
//! @} //! @}
 End of changes. 8 change blocks. 
150 lines changed or deleted 5 lines changed or added


 SpMat_bones.hpp   SpMat_bones.hpp 
skipping to change at line 47 skipping to change at line 47
* In accordance with the CSC format, this stores only the actual values. * In accordance with the CSC format, this stores only the actual values.
* The correct locations of the values are assembled from the row indices * The correct locations of the values are assembled from the row indices
* and the column pointers. * and the column pointers.
* *
* The length of this array is (n_nonzero + 1); the final value ensures * The length of this array is (n_nonzero + 1); the final value ensures
* the integrity of iterators. If you are planning on resizing this vect or, * the integrity of iterators. If you are planning on resizing this vect or,
* it's probably best to use mem_resize() instead, which automatically se ts * it's probably best to use mem_resize() instead, which automatically se ts
* the length to (n_nonzero + 1). If you need to allocate the memory you rself * the length to (n_nonzero + 1). If you need to allocate the memory you rself
* for some reason, be sure to set values[n_nonzero] to 0. * for some reason, be sure to set values[n_nonzero] to 0.
*/ */
const eT* const values; arma_aligned const eT* const values;
/** /**
* The row indices of each value. row_indices[i] is the row of values[i] . * The row indices of each value. row_indices[i] is the row of values[i] .
* *
* The length of this array is (n_nonzero + 1); the final value ensures * The length of this array is (n_nonzero + 1); the final value ensures
* the integrity of iterators. If you are planning on resizing this vect or, * the integrity of iterators. If you are planning on resizing this vect or,
* it's probably best to use mem_resize() instead. If you need to alloca te * it's probably best to use mem_resize() instead. If you need to alloca te
* the memory yourself for some reason, be sure to set row_indices[n_nonz ero] to 0. * the memory yourself for some reason, be sure to set row_indices[n_nonz ero] to 0.
*/ */
const uword* const row_indices; arma_aligned const uword* const row_indices;
/** /**
* The column pointers. This stores the index of the first item in colum n i. * The column pointers. This stores the index of the first item in colum n i.
* That is, values[col_ptrs[i]] is the first value in column i, and it is in * That is, values[col_ptrs[i]] is the first value in column i, and it is in
* the row indicated by row_indices[col_ptrs[i]]. * the row indicated by row_indices[col_ptrs[i]].
* *
* This array is of length (n_cols + 2); the element col_ptrs[n_cols] sho uld * This array is of length (n_cols + 2); the element col_ptrs[n_cols] sho uld
* be equal to n_nonzero, and the element col_ptrs[n_cols + 1] is an inva lid * be equal to n_nonzero, and the element col_ptrs[n_cols + 1] is an inva lid
* very large value that ensures the integrity of iterators. * very large value that ensures the integrity of iterators.
* *
* The col_ptrs array is set by the init() function (which is called by t he * The col_ptrs array is set by the init() function (which is called by t he
* constructors and set_size() and other functions that set the size of t he * constructors and set_size() and other functions that set the size of t he
* matrix), so allocating col_ptrs by hand should not be necessary. * matrix), so allocating col_ptrs by hand should not be necessary.
*/ */
const uword* const col_ptrs; arma_aligned const uword* const col_ptrs;
inline SpMat(); //! Size will be 0x0 (empty). inline SpMat(); //! Size will be 0x0 (empty).
inline ~SpMat(); inline ~SpMat();
inline SpMat(const uword in_rows, const uword in_cols); inline SpMat(const uword in_rows, const uword in_cols);
inline SpMat(const char* text); inline SpMat(const char* text);
inline const SpMat& operator=(const char* text); inline const SpMat& operator=(const char* text);
inline SpMat(const std::string& text); inline SpMat(const std::string& text);
inline const SpMat& operator=(const std::string& text); inline const SpMat& operator=(const std::string& text);
skipping to change at line 218 skipping to change at line 218
inline SpSubview<eT> tail_rows(const uword N); inline SpSubview<eT> tail_rows(const uword N);
inline const SpSubview<eT> tail_rows(const uword N) const; inline const SpSubview<eT> tail_rows(const uword N) const;
inline SpSubview<eT> head_cols(const uword N); inline SpSubview<eT> head_cols(const uword N);
inline const SpSubview<eT> head_cols(const uword N) const; inline const SpSubview<eT> head_cols(const uword N) const;
inline SpSubview<eT> tail_cols(const uword N); inline SpSubview<eT> tail_cols(const uword N);
inline const SpSubview<eT> tail_cols(const uword N) const; inline const SpSubview<eT> tail_cols(const uword N) const;
inline spdiagview<eT> diag(const sword in_id = 0);
inline const spdiagview<eT> diag(const sword in_id = 0) const;
inline void swap_rows(const uword in_row1, const uword in_row2); inline void swap_rows(const uword in_row1, const uword in_row2);
inline void swap_cols(const uword in_col1, const uword in_col2); inline void swap_cols(const uword in_col1, const uword in_col2);
inline void shed_row(const uword row_num); inline void shed_row(const uword row_num);
inline void shed_col(const uword col_num); inline void shed_col(const uword col_num);
inline void shed_rows(const uword in_row1, const uword in_row2); inline void shed_rows(const uword in_row1, const uword in_row2);
inline void shed_cols(const uword in_col1, const uword in_col2); inline void shed_cols(const uword in_col1, const uword in_col2);
/** /**
 End of changes. 4 change blocks. 
3 lines changed or deleted 6 lines changed or added


 SpMat_meat.hpp   SpMat_meat.hpp 
skipping to change at line 1949 skipping to change at line 1949
{ {
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);
} }
//! creation of spdiagview (diagonal)
template<typename eT>
inline
spdiagview<eT>
SpMat<eT>::diag(const sword in_id)
{
arma_extra_debug_sigprint();
const uword row_offset = (in_id < 0) ? uword(-in_id) : 0;
const uword col_offset = (in_id > 0) ? uword( in_id) : 0;
arma_debug_check
(
((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (c
ol_offset >= n_cols)),
"SpMat::diag(): requested diagonal out of bounds"
);
const uword len = (std::min)(n_rows - row_offset, n_cols - col_offset);
return spdiagview<eT>(*this, row_offset, col_offset, len);
}
//! creation of spdiagview (diagonal)
template<typename eT>
inline
const spdiagview<eT>
SpMat<eT>::diag(const sword in_id) const
{
arma_extra_debug_sigprint();
const uword row_offset = (in_id < 0) ? -in_id : 0;
const uword col_offset = (in_id > 0) ? in_id : 0;
arma_debug_check
(
((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (c
ol_offset >= n_cols)),
"SpMat::diag(): requested diagonal out of bounds"
);
const uword len = (std::min)(n_rows - row_offset, n_cols - col_offset);
return spdiagview<eT>(*this, row_offset, col_offset, len);
}
template<typename eT> template<typename eT>
inline inline
void void
SpMat<eT>::swap_rows(const uword in_row1, const uword in_row2) SpMat<eT>::swap_rows(const uword in_row1, const uword in_row2)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check arma_debug_check
( (
(in_row1 >= n_rows) || (in_row2 >= n_rows), (in_row1 >= n_rows) || (in_row2 >= n_rows),
skipping to change at line 3359 skipping to change at line 3403
else else
{ {
arma_debug_check arma_debug_check
( (
( ((vec_state == 1) && (in_cols != 1)) || ((vec_state == 2) && (in_ rows != 1)) ), ( ((vec_state == 1) && (in_cols != 1)) || ((vec_state == 2) && (in_ rows != 1)) ),
"SpMat::init(): object is a row or column vector; requested size is not compatible" "SpMat::init(): object is a row or column vector; requested size is not compatible"
); );
} }
} }
#if (defined(ARMA_USE_CXX11) || defined(ARMA_64BIT_WORD))
const char* error_message = "SpMat::init(): requested size is too large
";
#else
const char* error_message = "SpMat::init(): requested size is too large
; suggest to compile in C++11 mode or enable ARMA_64BIT_WORD";
#endif
// Ensure that n_elem can hold the result of (n_rows * n_cols) // Ensure that n_elem can hold the result of (n_rows * n_cols)
arma_debug_check arma_debug_check
( (
( (
( (in_rows > ARMA_MAX_UHWORD) || (in_cols > ARMA_MAX_UHWORD) ) ( (in_rows > ARMA_MAX_UHWORD) || (in_cols > ARMA_MAX_UHWORD) )
? ( (float(in_rows) * float(in_cols)) > float(ARMA_MAX_UWORD) ) ? ( (double(in_rows) * double(in_cols)) > double(ARMA_MAX_UWORD) )
: false : false
), ),
"SpMat::init(): requested size is too large; suggest to enable ARMA_6 4BIT_WORD" error_message
); );
// Clean out the existing memory. // Clean out the existing memory.
if (values) if (values)
{ {
memory::release(values); memory::release(values);
memory::release(row_indices); memory::release(row_indices);
} }
access::rw(values) = memory::acquire_chunked<eT> (1); access::rw(values) = memory::acquire_chunked<eT> (1);
 End of changes. 4 change blocks. 
2 lines changed or deleted 56 lines changed or added


 SpRow_bones.hpp   SpRow_bones.hpp 
skipping to change at line 45 skipping to change at line 45
template<typename T1> inline SpRow(const Base<eT,T1>& X) ; template<typename T1> inline SpRow(const Base<eT,T1>& X) ;
template<typename T1> inline const SpRow& operator=(const Base<eT,T1>& X) ; template<typename T1> inline const SpRow& operator=(const Base<eT,T1>& X) ;
template<typename T1> inline SpRow(const SpBase<eT,T1>& X); template<typename T1> inline SpRow(const SpBase<eT,T1>& X);
template<typename T1> inline const SpRow& operator=(const SpBase<eT,T1>& X); template<typename T1> inline const SpRow& operator=(const SpBase<eT,T1>& X);
template<typename T1, typename T2> template<typename T1, typename T2>
inline explicit SpRow(const SpBase<pod_type,T1>& A, const SpBase<pod_type ,T2>& B); inline explicit SpRow(const SpBase<pod_type,T1>& A, const SpBase<pod_type ,T2>& B);
inline SpValProxy<SpMat<eT> > col(const uword col_num);
inline eT col(const uword col_num) const;
// arma_inline subview_row<eT> cols(const uword in_col1, const uword
in_col2);
// arma_inline const subview_row<eT> cols(const uword in_col1, const uword
in_col2) const;
// arma_inline subview_row<eT> subvec(const uword in_col1, const uwo
rd in_col2);
// arma_inline const subview_row<eT> subvec(const uword in_col1, const uwo
rd in_col2) const;
// arma_inline subview_row<eT> subvec(const span& col_span);
// arma_inline const subview_row<eT> subvec(const span& col_span) const;
// arma_inline subview_row<eT> operator()(const span& col_span);
// arma_inline const subview_row<eT> operator()(const span& col_span) cons
t;
inline void shed_col (const uword col_num); inline void shed_col (const uword col_num);
inline void shed_cols(const uword in_col1, const uword in_col2); inline void shed_cols(const uword in_col1, const uword in_col2);
// inline void insert_cols(const uword col_num, con // inline void insert_cols(const uword col_num, const uword N, const bool
st uword N, const bool set_to_zero = true); set_to_zero = true);
// template<typename T1> inline void insert_cols(const uword col_num, con
st Base<eT,T1>& X);
typedef typename SpMat<eT>::iterator row_iterator; typedef typename SpMat<eT>::iterator row_iterator;
typedef typename SpMat<eT>::const_iterator const_row_iterator; typedef typename SpMat<eT>::const_iterator const_row_iterator;
inline row_iterator begin_row(const uword row_num = 0); inline row_iterator begin_row(const uword row_num = 0);
inline const_row_iterator begin_row(const uword row_num = 0) const; inline const_row_iterator begin_row(const uword row_num = 0) const;
inline row_iterator end_row(const uword row_num = 0); inline row_iterator end_row(const uword row_num = 0);
inline const_row_iterator end_row(const uword row_num = 0) const; inline const_row_iterator end_row(const uword row_num = 0) const;
 End of changes. 2 change blocks. 
24 lines changed or deleted 2 lines changed or added


 SpRow_meat.hpp   SpRow_meat.hpp 
// Copyright (C) 2011-2012 Ryan Curtin // Copyright (C) 2011-2012 Ryan Curtin
// Copyright (C) 2015 Conrad Sanderson
// Copyright (C) 2011 Matthew Amidon // Copyright (C) 2011 Matthew Amidon
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup SpRow //! \addtogroup SpRow
//! @{ //! @{
template<typename eT> template<typename eT>
skipping to change at line 171 skipping to change at line 172
const SpBase<typename SpRow<eT>::pod_type, T2>& B const SpBase<typename SpRow<eT>::pod_type, T2>& B
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
access::rw(SpMat<eT>::vec_state) = 2; access::rw(SpMat<eT>::vec_state) = 2;
SpMat<eT>::init(A,B); SpMat<eT>::init(A,B);
} }
template<typename eT>
inline
SpValProxy< SpMat<eT> >
SpRow<eT>::col(const uword col_num)
{
arma_debug_check( (col_num >= SpMat<eT>::n_cols), "SpRow::col(): out of b
ounds" );
return SpMat<eT>::at(0, col_num);
}
template<typename eT>
inline
eT
SpRow<eT>::col(const uword col_num) const
{
arma_debug_check( (col_num >= SpMat<eT>::n_cols), "SpRow::col(): out of b
ounds" );
return SpMat<eT>::at(0, col_num);
}
/*
template<typename eT>
arma_inline
subview_row<eT>
SpRow<eT>::cols(const uword in_col1, const uword in_col2)
{
arma_extra_debug_sigprint();
arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat<eT>::n_cols) )
, "SpRow::cols(): indices out of bounds or incorrectly used");
const uword subview_n_cols = in_col2 - in_col1 + 1;
return subview_row<eT>(*this, 0, in_col1, subview_n_cols);
}
template<typename eT>
arma_inline
const subview_row<eT>
SpRow<eT>::cols(const uword in_col1, const uword in_col2) const
{
arma_extra_debug_sigprint();
arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat<eT>::n_cols) )
, "SpRow::cols(): indices out of bounds or incorrectly used");
const uword subview_n_cols = in_col2 - in_col1 + 1;
return subview_row<eT>(*this, 0, in_col1, subview_n_cols);
}
template<typename eT>
arma_inline
subview_row<eT>
SpRow<eT>::subvec(const uword in_col1, const uword in_col2)
{
arma_extra_debug_sigprint();
arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat<eT>::n_cols) )
, "SpRow::subvec(): indices out of bounds or incorrectly used");
const uword subview_n_cols = in_col2 - in_col1 + 1;
return subview_row<eT>(*this, 0, in_col1, subview_n_cols);
}
template<typename eT>
arma_inline
const subview_row<eT>
SpRow<eT>::subvec(const uword in_col1, const uword in_col2) const
{
arma_extra_debug_sigprint();
arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat<eT>::n_cols) )
, "SpRow::subvec(): indices out of bounds or incorrectly used");
const uword subview_n_cols = in_col2 - in_col1 + 1;
return subview_row<eT>(*this, 0, in_col1, subview_n_cols);
}
template<typename eT>
arma_inline
subview_row<eT>
SpRow<eT>::subvec(const span& col_span)
{
arma_extra_debug_sigprint();
const bool col_all = col_span.whole;
const uword local_n_cols = Mat<eT>::n_cols;
const uword in_col1 = col_all ? 0 : col_span.a;
const uword in_col2 = col_span.b;
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 >=
local_n_cols)) ), "SpRow::subvec(): indices out of bounds or incorrectly u
sed");
return subview_row<eT>(*this, 0, in_col1, subvec_n_cols);
}
template<typename eT>
arma_inline
const subview_row<eT>
SpRow<eT>::subvec(const span& col_span) const
{
arma_extra_debug_sigprint();
const bool col_all = col_span.whole;
const uword local_n_cols = Mat<eT>::n_cols;
const uword in_col1 = col_all ? 0 : col_span.a;
const uword in_col2 = col_span.b;
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 >=
local_n_cols)) ), "SpRow::subvec(): indices out of bounds or incorrectly u
sed");
return subview_row<eT>(*this, 0, in_col1, subvec_n_cols);
}
*/
// template<typename eT>
// arma_inline
// subview_row<eT>
// SpRow<eT>::operator()(const span& col_span)
// {
// arma_extra_debug_sigprint();
//
// return subvec(col_span);
// }
//
//
//
// template<typename eT>
// arma_inline
// const subview_row<eT>
// SpRow<eT>::operator()(const span& col_span) const
// {
// arma_extra_debug_sigprint();
//
// return subvec(col_span);
// }
//! remove specified columns //! remove specified columns
template<typename eT> template<typename eT>
inline inline
void void
SpRow<eT>::shed_col(const uword col_num) SpRow<eT>::shed_col(const uword col_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( col_num >= SpMat<eT>::n_cols, "SpRow::shed_col(): out o f bounds"); arma_debug_check( col_num >= SpMat<eT>::n_cols, "SpRow::shed_col(): out o f bounds");
skipping to change at line 427 skipping to change at line 288
// arrayops::copy(new_col_ptrs, SpMat<eT>::col_ptrs, col_num); // arrayops::copy(new_col_ptrs, SpMat<eT>::col_ptrs, col_num);
// //
// uword fill_value = (col_num == 0) ? 0 : SpMat<eT>::col_ptrs[col_num - 1]; // uword fill_value = (col_num == 0) ? 0 : SpMat<eT>::col_ptrs[col_num - 1];
// arrayops::inplace_set(new_col_ptrs + col_num, fill_value, N); // arrayops::inplace_set(new_col_ptrs + col_num, fill_value, N);
// //
// arrayops::copy(new_col_ptrs + col_num + N, SpMat<eT>::col_ptrs + col_n um, SpMat<eT>::n_cols - col_num); // arrayops::copy(new_col_ptrs + col_num + N, SpMat<eT>::col_ptrs + col_n um, SpMat<eT>::n_cols - col_num);
// //
// access::rw(SpMat<eT>::n_cols) += N; // access::rw(SpMat<eT>::n_cols) += N;
// access::rw(SpMat<eT>::n_elem) += N; // access::rw(SpMat<eT>::n_elem) += N;
// } // }
//
//
//
// //! insert the given object at the specified col position;
// //! the given object must have one row
// template<typename eT>
// template<typename T1>
// inline
// void
// SpRow<eT>::insert_cols(const uword col_num, const Base<eT,T1>& X)
// {
// arma_extra_debug_sigprint();
//
// SpMat<eT>::insert_cols(col_num, X);
// }
template<typename eT> template<typename eT>
inline inline
typename SpRow<eT>::row_iterator typename SpRow<eT>::row_iterator
SpRow<eT>::begin_row(const uword row_num) SpRow<eT>::begin_row(const uword row_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
// Since this is a row, row_num can only be 0. But the option is provide d for // Since this is a row, row_num can only be 0. But the option is provide d for
// compatibility. // compatibility.
arma_debug_check((row_num >= 1), "SpRow::row(): invalid row index"); arma_debug_check((row_num >= 1), "SpRow::begin_row(): index out of bounds ");
return SpMat<eT>::begin(); return SpMat<eT>::begin();
} }
template<typename eT> template<typename eT>
inline inline
typename SpRow<eT>::const_row_iterator typename SpRow<eT>::const_row_iterator
SpRow<eT>::begin_row(const uword row_num) const SpRow<eT>::begin_row(const uword row_num) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
// Since this is a row, row_num can only be 0. But the option is provide d for // Since this is a row, row_num can only be 0. But the option is provide d for
// compatibility. // compatibility.
arma_debug_check((row_num >= 1), "SpRow::row(): invalid row index"); arma_debug_check((row_num >= 1), "SpRow::begin_row(): index out of bounds ");
return SpMat<eT>::begin(); return SpMat<eT>::begin();
} }
template<typename eT> template<typename eT>
inline inline
typename SpRow<eT>::row_iterator typename SpRow<eT>::row_iterator
SpRow<eT>::end_row(const uword row_num) SpRow<eT>::end_row(const uword row_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
// Since this is a row, row_num can only be 0. But the option is provide d for // Since this is a row, row_num can only be 0. But the option is provide d for
// compatibility. // compatibility.
arma_debug_check((row_num >= 1), "SpRow::row(): invalid row index"); arma_debug_check((row_num >= 1), "SpRow::end_row(): index out of bounds") ;
return SpMat<eT>::end(); return SpMat<eT>::end();
} }
template<typename eT> template<typename eT>
inline inline
typename SpRow<eT>::const_row_iterator typename SpRow<eT>::const_row_iterator
SpRow<eT>::end_row(const uword row_num) const SpRow<eT>::end_row(const uword row_num) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
// Since this is a row, row_num can only be 0. But the option is provide d for // Since this is a row, row_num can only be 0. But the option is provide d for
// compatibility. // compatibility.
arma_debug_check((row_num >= 1), "SpRow::row(): invalid row index"); arma_debug_check((row_num >= 1), "SpRow::end_row(): index out of bounds") ;
return SpMat<eT>::end(); return SpMat<eT>::end();
} }
#ifdef ARMA_EXTRA_SPROW_MEAT #ifdef ARMA_EXTRA_SPROW_MEAT
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_SPROW_MEAT) #include ARMA_INCFILE_WRAP(ARMA_EXTRA_SPROW_MEAT)
#endif #endif
//! @} //! @}
 End of changes. 7 change blocks. 
171 lines changed or deleted 5 lines changed or added


 arma_config.hpp   arma_config.hpp 
// Copyright (C) 2008-2012 Conrad Sanderson // Copyright (C) 2008-2015 Conrad Sanderson
// Copyright (C) 2008-2012 NICTA (www.nicta.com.au) // Copyright (C) 2008-2015 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup arma_config //! \addtogroup arma_config
//! @{ //! @{
struct arma_config struct arma_config
{ {
skipping to change at line 49 skipping to change at line 49
#else #else
static const bool blas = false; static const bool blas = false;
#endif #endif
#if defined(ARMA_USE_ARPACK) #if defined(ARMA_USE_ARPACK)
static const bool arpack = true; static const bool arpack = true;
#else #else
static const bool arpack = false; static const bool arpack = false;
#endif #endif
#if defined(ARMA_USE_SUPERLU)
static const bool superlu = true;
#else
static const bool superlu = false;
#endif
#if defined(ARMA_USE_HDF5) #if defined(ARMA_USE_HDF5)
static const bool hdf5 = true; static const bool hdf5 = true;
#else #else
static const bool hdf5 = false; static const bool hdf5 = false;
#endif #endif
#if defined(ARMA_NO_DEBUG) #if defined(ARMA_NO_DEBUG)
static const bool debug = false; static const bool debug = false;
#else #else
static const bool debug = true; static const bool debug = true;
 End of changes. 2 change blocks. 
2 lines changed or deleted 8 lines changed or added


 arma_ostream_meat.hpp   arma_ostream_meat.hpp 
// Copyright (C) 2008-2014 Conrad Sanderson // Copyright (C) 2008-2015 Conrad Sanderson
// Copyright (C) 2008-2014 NICTA (www.nicta.com.au) // Copyright (C) 2008-2015 NICTA (www.nicta.com.au)
// Copyright (C) 2012 Ryan Curtin // Copyright (C) 2012 Ryan Curtin
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup arma_ostream //! \addtogroup arma_ostream
//! @{ //! @{
inline inline
skipping to change at line 49 skipping to change at line 49
o.unsetf(ios::showbase); o.unsetf(ios::showbase);
o.unsetf(ios::uppercase); o.unsetf(ios::uppercase);
o.unsetf(ios::showpos); o.unsetf(ios::showpos);
o.fill(' '); o.fill(' ');
std::streamsize cell_width; std::streamsize cell_width;
bool use_layout_B = false; bool use_layout_B = false;
bool use_layout_C = false; bool use_layout_C = false;
bool use_layout_D = false;
for(uword i=0; i<n_elem; ++i) for(uword i=0; i<n_elem; ++i)
{ {
const eT val = data[i]; const eT val = data[i];
if( if(
( cond_rel< (sizeof(eT) > 4) && (is_same_type<uword,eT>::yes || is_sa
me_type<sword,eT>::yes) >::geq(val, eT(+10000000000)) )
||
( cond_rel< (sizeof(eT) > 4) && is_same_type<sword,eT>::yes
>::leq(val, eT(-10000000000)) )
)
{
use_layout_D = true;
break;
}
if(
( val >= eT(+100) ) ( val >= eT(+100) )
|| ||
//( (is_signed<eT>::value == true) && (val <= eT(-100)) ) || //( (is_signed<eT>::value == true) && (val <= eT(-100)) ) ||
//( (is_non_integral<eT>::value == true) && (val > eT(0)) && (val <= eT(+1e-4)) ) || //( (is_non_integral<eT>::value == true) && (val > eT(0)) && (val <= eT(+1e-4)) ) ||
//( (is_non_integral<eT>::value == true) && (is_signed<eT>::value == true) && (val < eT(0)) && (val >= eT(-1e-4)) ) //( (is_non_integral<eT>::value == true) && (is_signed<eT>::value == true) && (val < eT(0)) && (val >= eT(-1e-4)) )
( (
cond_rel< is_signed<eT>::value >::leq(val, eT(-100)) cond_rel< is_signed<eT>::value >::leq(val, eT(-100))
) )
|| ||
( (
skipping to change at line 90 skipping to change at line 101
if( if(
// (val >= eT(+10)) || ( (is_signed<eT>::value == true) && (val <= eT (-10)) ) // (val >= eT(+10)) || ( (is_signed<eT>::value == true) && (val <= eT (-10)) )
(val >= eT(+10)) || ( cond_rel< is_signed<eT>::value >::leq(val, eT(- 10)) ) (val >= eT(+10)) || ( cond_rel< is_signed<eT>::value >::leq(val, eT(- 10)) )
) )
{ {
use_layout_B = true; use_layout_B = true;
} }
} }
if(use_layout_D == true)
{
o.setf(ios::scientific);
o.setf(ios::right);
o.unsetf(ios::fixed);
o.precision(4);
cell_width = 21;
}
else
if(use_layout_C == true) if(use_layout_C == true)
{ {
o.setf(ios::scientific); o.setf(ios::scientific);
o.setf(ios::right); o.setf(ios::right);
o.unsetf(ios::fixed); o.unsetf(ios::fixed);
o.precision(4); o.precision(4);
cell_width = 13; cell_width = 13;
} }
else else
if(use_layout_B == true) if(use_layout_B == true)
 End of changes. 4 change blocks. 
2 lines changed or deleted 24 lines changed or added


 arma_version.hpp   arma_version.hpp 
// Copyright (C) 2009-2014 Conrad Sanderson // Copyright (C) 2009-2015 Conrad Sanderson
// Copyright (C) 2009-2014 NICTA (www.nicta.com.au) // Copyright (C) 2009-2015 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup arma_version //! \addtogroup arma_version
//! @{ //! @{
#define ARMA_VERSION_MAJOR 4 #define ARMA_VERSION_MAJOR 5
#define ARMA_VERSION_MINOR 650 #define ARMA_VERSION_MINOR 000
#define ARMA_VERSION_PATCH 4 #define ARMA_VERSION_PATCH 0
#define ARMA_VERSION_NAME "Intravenous Caffeine Injector" #define ARMA_VERSION_NAME "Ankle Biter"
struct arma_version struct arma_version
{ {
static const unsigned int major = ARMA_VERSION_MAJOR; static const unsigned int major = ARMA_VERSION_MAJOR;
static const unsigned int minor = ARMA_VERSION_MINOR; static const unsigned int minor = ARMA_VERSION_MINOR;
static const unsigned int patch = ARMA_VERSION_PATCH; static const unsigned int patch = ARMA_VERSION_PATCH;
static static
inline inline
std::string std::string
 End of changes. 2 change blocks. 
6 lines changed or deleted 6 lines changed or added


 armadillo   armadillo 
skipping to change at line 36 skipping to change at line 36
#include <vector> #include <vector>
#if ( defined(__unix__) || defined(__unix) || defined(_POSIX_C_SOURCE) || ( defined(__APPLE__) && defined(__MACH__)) ) && !defined(_WIN32) #if ( defined(__unix__) || defined(__unix) || defined(_POSIX_C_SOURCE) || ( defined(__APPLE__) && defined(__MACH__)) ) && !defined(_WIN32)
#include <unistd.h> #include <unistd.h>
#endif #endif
#if (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L)) #if (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L))
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#if (__cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__)
#undef ARMA_USE_CXX11
#define ARMA_USE_CXX11
#endif
#include "armadillo_bits/config.hpp" #include "armadillo_bits/config.hpp"
#include "armadillo_bits/compiler_setup.hpp" #include "armadillo_bits/compiler_setup.hpp"
#if defined(ARMA_USE_CXX11) #if defined(ARMA_USE_CXX11)
#include <initializer_list> #include <initializer_list>
#include <cstdint> #include <cstdint>
#include <random> #include <random>
#if !defined(ARMA_DONT_USE_CXX11_CHRONO) #if !defined(ARMA_DONT_USE_CXX11_CHRONO)
#include <chrono> #include <chrono>
#endif #endif
skipping to change at line 65 skipping to change at line 70
#if !defined(ARMA_USE_CXX11) #if !defined(ARMA_USE_CXX11)
#if defined(ARMA_HAVE_TR1) #if defined(ARMA_HAVE_TR1)
#include <tr1/cmath> #include <tr1/cmath>
#include <tr1/complex> #include <tr1/complex>
#endif #endif
#endif #endif
#include "armadillo_bits/include_atlas.hpp" #include "armadillo_bits/include_atlas.hpp"
#include "armadillo_bits/include_hdf5.hpp" #include "armadillo_bits/include_hdf5.hpp"
#include "armadillo_bits/include_superlu.hpp"
#if defined(_OPENMP) #if defined(_OPENMP)
#include <omp.h> #include <omp.h>
#endif #endif
//! \namespace arma namespace for Armadillo classes and functions //! \namespace arma namespace for Armadillo classes and functions
namespace arma namespace arma
{ {
// preliminaries // preliminaries
skipping to change at line 114 skipping to change at line 120
// class prototypes // class prototypes
#include "armadillo_bits/Base_bones.hpp" #include "armadillo_bits/Base_bones.hpp"
#include "armadillo_bits/BaseCube_bones.hpp" #include "armadillo_bits/BaseCube_bones.hpp"
#include "armadillo_bits/SpBase_bones.hpp" #include "armadillo_bits/SpBase_bones.hpp"
#include "armadillo_bits/blas_bones.hpp" #include "armadillo_bits/blas_bones.hpp"
#include "armadillo_bits/lapack_bones.hpp" #include "armadillo_bits/lapack_bones.hpp"
#include "armadillo_bits/atlas_bones.hpp" #include "armadillo_bits/atlas_bones.hpp"
#include "armadillo_bits/arpack_bones.hpp" #include "armadillo_bits/arpack_bones.hpp"
#include "armadillo_bits/superlu_bones.hpp"
#include "armadillo_bits/hdf5_bones.hpp" #include "armadillo_bits/hdf5_bones.hpp"
#include "armadillo_bits/blas_wrapper.hpp" #include "armadillo_bits/blas_wrapper.hpp"
#include "armadillo_bits/lapack_wrapper.hpp" #include "armadillo_bits/lapack_wrapper.hpp"
#include "armadillo_bits/atlas_wrapper.hpp" #include "armadillo_bits/atlas_wrapper.hpp"
#include "armadillo_bits/arpack_wrapper.hpp" #include "armadillo_bits/arpack_wrapper.hpp"
#include "armadillo_bits/superlu_wrapper.hpp"
#include "armadillo_bits/cond_rel_bones.hpp" #include "armadillo_bits/cond_rel_bones.hpp"
#include "armadillo_bits/arrayops_bones.hpp" #include "armadillo_bits/arrayops_bones.hpp"
#include "armadillo_bits/podarray_bones.hpp" #include "armadillo_bits/podarray_bones.hpp"
#include "armadillo_bits/auxlib_bones.hpp" #include "armadillo_bits/auxlib_bones.hpp"
#include "armadillo_bits/sp_auxlib_bones.hpp" #include "armadillo_bits/sp_auxlib_bones.hpp"
#include "armadillo_bits/injector_bones.hpp" #include "armadillo_bits/injector_bones.hpp"
#include "armadillo_bits/Mat_bones.hpp" #include "armadillo_bits/Mat_bones.hpp"
skipping to change at line 143 skipping to change at line 151
#include "armadillo_bits/xvec_htrans_bones.hpp" #include "armadillo_bits/xvec_htrans_bones.hpp"
#include "armadillo_bits/xtrans_mat_bones.hpp" #include "armadillo_bits/xtrans_mat_bones.hpp"
#include "armadillo_bits/SizeMat_bones.hpp" #include "armadillo_bits/SizeMat_bones.hpp"
#include "armadillo_bits/SizeCube_bones.hpp" #include "armadillo_bits/SizeCube_bones.hpp"
#include "armadillo_bits/SpValProxy_bones.hpp" #include "armadillo_bits/SpValProxy_bones.hpp"
#include "armadillo_bits/SpMat_bones.hpp" #include "armadillo_bits/SpMat_bones.hpp"
#include "armadillo_bits/SpCol_bones.hpp" #include "armadillo_bits/SpCol_bones.hpp"
#include "armadillo_bits/SpRow_bones.hpp" #include "armadillo_bits/SpRow_bones.hpp"
#include "armadillo_bits/SpSubview_bones.hpp" #include "armadillo_bits/SpSubview_bones.hpp"
#include "armadillo_bits/spdiagview_bones.hpp"
#include "armadillo_bits/typedef_mat_fixed.hpp" #include "armadillo_bits/typedef_mat_fixed.hpp"
#include "armadillo_bits/field_bones.hpp" #include "armadillo_bits/field_bones.hpp"
#include "armadillo_bits/subview_bones.hpp" #include "armadillo_bits/subview_bones.hpp"
#include "armadillo_bits/subview_elem1_bones.hpp" #include "armadillo_bits/subview_elem1_bones.hpp"
#include "armadillo_bits/subview_elem2_bones.hpp" #include "armadillo_bits/subview_elem2_bones.hpp"
#include "armadillo_bits/subview_field_bones.hpp" #include "armadillo_bits/subview_field_bones.hpp"
#include "armadillo_bits/subview_cube_bones.hpp" #include "armadillo_bits/subview_cube_bones.hpp"
#include "armadillo_bits/diagview_bones.hpp" #include "armadillo_bits/diagview_bones.hpp"
skipping to change at line 196 skipping to change at line 205
#include "armadillo_bits/op_diagmat_bones.hpp" #include "armadillo_bits/op_diagmat_bones.hpp"
#include "armadillo_bits/op_diagvec_bones.hpp" #include "armadillo_bits/op_diagvec_bones.hpp"
#include "armadillo_bits/op_dot_bones.hpp" #include "armadillo_bits/op_dot_bones.hpp"
#include "armadillo_bits/op_inv_bones.hpp" #include "armadillo_bits/op_inv_bones.hpp"
#include "armadillo_bits/op_htrans_bones.hpp" #include "armadillo_bits/op_htrans_bones.hpp"
#include "armadillo_bits/op_max_bones.hpp" #include "armadillo_bits/op_max_bones.hpp"
#include "armadillo_bits/op_min_bones.hpp" #include "armadillo_bits/op_min_bones.hpp"
#include "armadillo_bits/op_mean_bones.hpp" #include "armadillo_bits/op_mean_bones.hpp"
#include "armadillo_bits/op_median_bones.hpp" #include "armadillo_bits/op_median_bones.hpp"
#include "armadillo_bits/op_sort_bones.hpp" #include "armadillo_bits/op_sort_bones.hpp"
#include "armadillo_bits/op_sort_index_bones.hpp"
#include "armadillo_bits/op_sum_bones.hpp" #include "armadillo_bits/op_sum_bones.hpp"
#include "armadillo_bits/op_stddev_bones.hpp" #include "armadillo_bits/op_stddev_bones.hpp"
#include "armadillo_bits/op_strans_bones.hpp" #include "armadillo_bits/op_strans_bones.hpp"
#include "armadillo_bits/op_var_bones.hpp" #include "armadillo_bits/op_var_bones.hpp"
#include "armadillo_bits/op_repmat_bones.hpp" #include "armadillo_bits/op_repmat_bones.hpp"
#include "armadillo_bits/op_reshape_bones.hpp" #include "armadillo_bits/op_reshape_bones.hpp"
#include "armadillo_bits/op_vectorise_bones.hpp" #include "armadillo_bits/op_vectorise_bones.hpp"
#include "armadillo_bits/op_resize_bones.hpp" #include "armadillo_bits/op_resize_bones.hpp"
#include "armadillo_bits/op_cov_bones.hpp" #include "armadillo_bits/op_cov_bones.hpp"
#include "armadillo_bits/op_cor_bones.hpp" #include "armadillo_bits/op_cor_bones.hpp"
skipping to change at line 229 skipping to change at line 239
#include "armadillo_bits/op_symmat_bones.hpp" #include "armadillo_bits/op_symmat_bones.hpp"
#include "armadillo_bits/op_hist_bones.hpp" #include "armadillo_bits/op_hist_bones.hpp"
#include "armadillo_bits/op_unique_bones.hpp" #include "armadillo_bits/op_unique_bones.hpp"
#include "armadillo_bits/op_toeplitz_bones.hpp" #include "armadillo_bits/op_toeplitz_bones.hpp"
#include "armadillo_bits/op_fft_bones.hpp" #include "armadillo_bits/op_fft_bones.hpp"
#include "armadillo_bits/op_any_bones.hpp" #include "armadillo_bits/op_any_bones.hpp"
#include "armadillo_bits/op_all_bones.hpp" #include "armadillo_bits/op_all_bones.hpp"
#include "armadillo_bits/op_normalise_bones.hpp" #include "armadillo_bits/op_normalise_bones.hpp"
#include "armadillo_bits/op_clamp_bones.hpp" #include "armadillo_bits/op_clamp_bones.hpp"
#include "armadillo_bits/op_expmat_bones.hpp" #include "armadillo_bits/op_expmat_bones.hpp"
#include "armadillo_bits/op_nonzeros_bones.hpp"
#include "armadillo_bits/glue_times_bones.hpp" #include "armadillo_bits/glue_times_bones.hpp"
#include "armadillo_bits/glue_mixed_bones.hpp" #include "armadillo_bits/glue_mixed_bones.hpp"
#include "armadillo_bits/glue_cov_bones.hpp" #include "armadillo_bits/glue_cov_bones.hpp"
#include "armadillo_bits/glue_cor_bones.hpp" #include "armadillo_bits/glue_cor_bones.hpp"
#include "armadillo_bits/glue_kron_bones.hpp" #include "armadillo_bits/glue_kron_bones.hpp"
#include "armadillo_bits/glue_cross_bones.hpp" #include "armadillo_bits/glue_cross_bones.hpp"
#include "armadillo_bits/glue_join_bones.hpp" #include "armadillo_bits/glue_join_bones.hpp"
#include "armadillo_bits/glue_relational_bones.hpp" #include "armadillo_bits/glue_relational_bones.hpp"
#include "armadillo_bits/glue_solve_bones.hpp" #include "armadillo_bits/glue_solve_bones.hpp"
skipping to change at line 258 skipping to change at line 269
#include "armadillo_bits/spop_sum_bones.hpp" #include "armadillo_bits/spop_sum_bones.hpp"
#include "armadillo_bits/spop_strans_bones.hpp" #include "armadillo_bits/spop_strans_bones.hpp"
#include "armadillo_bits/spop_htrans_bones.hpp" #include "armadillo_bits/spop_htrans_bones.hpp"
#include "armadillo_bits/spop_misc_bones.hpp" #include "armadillo_bits/spop_misc_bones.hpp"
#include "armadillo_bits/spop_mean_bones.hpp" #include "armadillo_bits/spop_mean_bones.hpp"
#include "armadillo_bits/spop_var_bones.hpp" #include "armadillo_bits/spop_var_bones.hpp"
#include "armadillo_bits/spglue_plus_bones.hpp" #include "armadillo_bits/spglue_plus_bones.hpp"
#include "armadillo_bits/spglue_minus_bones.hpp" #include "armadillo_bits/spglue_minus_bones.hpp"
#include "armadillo_bits/spglue_times_bones.hpp" #include "armadillo_bits/spglue_times_bones.hpp"
#include "armadillo_bits/spglue_join_bones.hpp"
// //
// low-level debugging and memory handling functions // low-level debugging and memory handling functions
#include "armadillo_bits/debug.hpp" #include "armadillo_bits/debug.hpp"
#include "armadillo_bits/memory.hpp" #include "armadillo_bits/memory.hpp"
// //
// wrappers for various cmath functions // wrappers for various cmath functions
skipping to change at line 431 skipping to change at line 443
#include "armadillo_bits/fn_size.hpp" #include "armadillo_bits/fn_size.hpp"
#include "armadillo_bits/fn_numel.hpp" #include "armadillo_bits/fn_numel.hpp"
#include "armadillo_bits/fn_inplace_strans.hpp" #include "armadillo_bits/fn_inplace_strans.hpp"
#include "armadillo_bits/fn_inplace_trans.hpp" #include "armadillo_bits/fn_inplace_trans.hpp"
#include "armadillo_bits/fn_randi.hpp" #include "armadillo_bits/fn_randi.hpp"
#include "armadillo_bits/fn_randg.hpp" #include "armadillo_bits/fn_randg.hpp"
#include "armadillo_bits/fn_cond.hpp" #include "armadillo_bits/fn_cond.hpp"
#include "armadillo_bits/fn_normalise.hpp" #include "armadillo_bits/fn_normalise.hpp"
#include "armadillo_bits/fn_clamp.hpp" #include "armadillo_bits/fn_clamp.hpp"
#include "armadillo_bits/fn_expmat.hpp" #include "armadillo_bits/fn_expmat.hpp"
#include "armadillo_bits/fn_nonzeros.hpp"
#include "armadillo_bits/fn_speye.hpp" #include "armadillo_bits/fn_speye.hpp"
#include "armadillo_bits/fn_spones.hpp" #include "armadillo_bits/fn_spones.hpp"
#include "armadillo_bits/fn_sprandn.hpp" #include "armadillo_bits/fn_sprandn.hpp"
#include "armadillo_bits/fn_sprandu.hpp" #include "armadillo_bits/fn_sprandu.hpp"
#include "armadillo_bits/fn_eigs_sym.hpp" #include "armadillo_bits/fn_eigs_sym.hpp"
#include "armadillo_bits/fn_eigs_gen.hpp" #include "armadillo_bits/fn_eigs_gen.hpp"
#include "armadillo_bits/fn_norm_sparse.hpp" #include "armadillo_bits/fn_norm_sparse.hpp"
#include "armadillo_bits/fn_spsolve.hpp"
#include "armadillo_bits/fn_svds.hpp"
// //
// misc stuff // misc stuff
#include "armadillo_bits/hdf5_misc.hpp" #include "armadillo_bits/hdf5_misc.hpp"
#include "armadillo_bits/fft_engine.hpp" #include "armadillo_bits/fft_engine.hpp"
#if !defined(ARMA_BAD_COMPILER) #if !defined(ARMA_BAD_COMPILER)
#include "armadillo_bits/gmm_misc_bones.hpp" #include "armadillo_bits/gmm_misc_bones.hpp"
#include "armadillo_bits/gmm_misc_meat.hpp" #include "armadillo_bits/gmm_misc_meat.hpp"
skipping to change at line 501 skipping to change at line 516
#include "armadillo_bits/diagview_meat.hpp" #include "armadillo_bits/diagview_meat.hpp"
#include "armadillo_bits/subview_each_meat.hpp" #include "armadillo_bits/subview_each_meat.hpp"
#include "armadillo_bits/SpValProxy_meat.hpp" #include "armadillo_bits/SpValProxy_meat.hpp"
#include "armadillo_bits/SpMat_meat.hpp" #include "armadillo_bits/SpMat_meat.hpp"
#include "armadillo_bits/SpMat_iterators_meat.hpp" #include "armadillo_bits/SpMat_iterators_meat.hpp"
#include "armadillo_bits/SpCol_meat.hpp" #include "armadillo_bits/SpCol_meat.hpp"
#include "armadillo_bits/SpRow_meat.hpp" #include "armadillo_bits/SpRow_meat.hpp"
#include "armadillo_bits/SpSubview_meat.hpp" #include "armadillo_bits/SpSubview_meat.hpp"
#include "armadillo_bits/SpSubview_iterators_meat.hpp" #include "armadillo_bits/SpSubview_iterators_meat.hpp"
#include "armadillo_bits/spdiagview_meat.hpp"
#include "armadillo_bits/diskio_meat.hpp" #include "armadillo_bits/diskio_meat.hpp"
#include "armadillo_bits/wall_clock_meat.hpp" #include "armadillo_bits/wall_clock_meat.hpp"
#include "armadillo_bits/running_stat_meat.hpp" #include "armadillo_bits/running_stat_meat.hpp"
#include "armadillo_bits/running_stat_vec_meat.hpp" #include "armadillo_bits/running_stat_vec_meat.hpp"
#include "armadillo_bits/op_diagmat_meat.hpp" #include "armadillo_bits/op_diagmat_meat.hpp"
#include "armadillo_bits/op_diagvec_meat.hpp" #include "armadillo_bits/op_diagvec_meat.hpp"
#include "armadillo_bits/op_dot_meat.hpp" #include "armadillo_bits/op_dot_meat.hpp"
#include "armadillo_bits/op_inv_meat.hpp" #include "armadillo_bits/op_inv_meat.hpp"
#include "armadillo_bits/op_htrans_meat.hpp" #include "armadillo_bits/op_htrans_meat.hpp"
#include "armadillo_bits/op_max_meat.hpp" #include "armadillo_bits/op_max_meat.hpp"
#include "armadillo_bits/op_min_meat.hpp" #include "armadillo_bits/op_min_meat.hpp"
#include "armadillo_bits/op_mean_meat.hpp" #include "armadillo_bits/op_mean_meat.hpp"
#include "armadillo_bits/op_median_meat.hpp" #include "armadillo_bits/op_median_meat.hpp"
#include "armadillo_bits/op_sort_meat.hpp" #include "armadillo_bits/op_sort_meat.hpp"
#include "armadillo_bits/op_sort_index_meat.hpp"
#include "armadillo_bits/op_sum_meat.hpp" #include "armadillo_bits/op_sum_meat.hpp"
#include "armadillo_bits/op_stddev_meat.hpp" #include "armadillo_bits/op_stddev_meat.hpp"
#include "armadillo_bits/op_strans_meat.hpp" #include "armadillo_bits/op_strans_meat.hpp"
#include "armadillo_bits/op_var_meat.hpp" #include "armadillo_bits/op_var_meat.hpp"
#include "armadillo_bits/op_repmat_meat.hpp" #include "armadillo_bits/op_repmat_meat.hpp"
#include "armadillo_bits/op_reshape_meat.hpp" #include "armadillo_bits/op_reshape_meat.hpp"
#include "armadillo_bits/op_vectorise_meat.hpp" #include "armadillo_bits/op_vectorise_meat.hpp"
#include "armadillo_bits/op_resize_meat.hpp" #include "armadillo_bits/op_resize_meat.hpp"
#include "armadillo_bits/op_cov_meat.hpp" #include "armadillo_bits/op_cov_meat.hpp"
#include "armadillo_bits/op_cor_meat.hpp" #include "armadillo_bits/op_cor_meat.hpp"
skipping to change at line 550 skipping to change at line 567
#include "armadillo_bits/op_symmat_meat.hpp" #include "armadillo_bits/op_symmat_meat.hpp"
#include "armadillo_bits/op_hist_meat.hpp" #include "armadillo_bits/op_hist_meat.hpp"
#include "armadillo_bits/op_unique_meat.hpp" #include "armadillo_bits/op_unique_meat.hpp"
#include "armadillo_bits/op_toeplitz_meat.hpp" #include "armadillo_bits/op_toeplitz_meat.hpp"
#include "armadillo_bits/op_fft_meat.hpp" #include "armadillo_bits/op_fft_meat.hpp"
#include "armadillo_bits/op_any_meat.hpp" #include "armadillo_bits/op_any_meat.hpp"
#include "armadillo_bits/op_all_meat.hpp" #include "armadillo_bits/op_all_meat.hpp"
#include "armadillo_bits/op_normalise_meat.hpp" #include "armadillo_bits/op_normalise_meat.hpp"
#include "armadillo_bits/op_clamp_meat.hpp" #include "armadillo_bits/op_clamp_meat.hpp"
#include "armadillo_bits/op_expmat_meat.hpp" #include "armadillo_bits/op_expmat_meat.hpp"
#include "armadillo_bits/op_nonzeros_meat.hpp"
#include "armadillo_bits/glue_times_meat.hpp" #include "armadillo_bits/glue_times_meat.hpp"
#include "armadillo_bits/glue_mixed_meat.hpp" #include "armadillo_bits/glue_mixed_meat.hpp"
#include "armadillo_bits/glue_cov_meat.hpp" #include "armadillo_bits/glue_cov_meat.hpp"
#include "armadillo_bits/glue_cor_meat.hpp" #include "armadillo_bits/glue_cor_meat.hpp"
#include "armadillo_bits/glue_kron_meat.hpp" #include "armadillo_bits/glue_kron_meat.hpp"
#include "armadillo_bits/glue_cross_meat.hpp" #include "armadillo_bits/glue_cross_meat.hpp"
#include "armadillo_bits/glue_join_meat.hpp" #include "armadillo_bits/glue_join_meat.hpp"
#include "armadillo_bits/glue_relational_meat.hpp" #include "armadillo_bits/glue_relational_meat.hpp"
#include "armadillo_bits/glue_solve_meat.hpp" #include "armadillo_bits/glue_solve_meat.hpp"
skipping to change at line 579 skipping to change at line 597
#include "armadillo_bits/spop_sum_meat.hpp" #include "armadillo_bits/spop_sum_meat.hpp"
#include "armadillo_bits/spop_strans_meat.hpp" #include "armadillo_bits/spop_strans_meat.hpp"
#include "armadillo_bits/spop_htrans_meat.hpp" #include "armadillo_bits/spop_htrans_meat.hpp"
#include "armadillo_bits/spop_misc_meat.hpp" #include "armadillo_bits/spop_misc_meat.hpp"
#include "armadillo_bits/spop_mean_meat.hpp" #include "armadillo_bits/spop_mean_meat.hpp"
#include "armadillo_bits/spop_var_meat.hpp" #include "armadillo_bits/spop_var_meat.hpp"
#include "armadillo_bits/spglue_plus_meat.hpp" #include "armadillo_bits/spglue_plus_meat.hpp"
#include "armadillo_bits/spglue_minus_meat.hpp" #include "armadillo_bits/spglue_minus_meat.hpp"
#include "armadillo_bits/spglue_times_meat.hpp" #include "armadillo_bits/spglue_times_meat.hpp"
#include "armadillo_bits/spglue_join_meat.hpp"
} }
#include "armadillo_bits/compiler_setup_post.hpp" #include "armadillo_bits/compiler_setup_post.hpp"
#endif #endif
 End of changes. 14 change blocks. 
0 lines changed or deleted 19 lines changed or added


 atlas_wrapper.hpp   atlas_wrapper.hpp 
skipping to change at line 30 skipping to change at line 30
template<typename eT> template<typename eT>
arma_inline arma_inline
eT eT
cblas_dot(const int N, const eT* X, const eT* Y) cblas_dot(const int N, const eT* X, const eT* Y)
{ {
arma_type_check((is_supported_blas_type<eT>::value == false)); arma_type_check((is_supported_blas_type<eT>::value == false));
if(is_float<eT>::value == true) if(is_float<eT>::value == true)
{ {
typedef float T; typedef float T;
return eT( arma_atlas(cblas_sdot)(N, (const T*)X, 1, (const T*)Y, 1) ); return eT( arma_wrapper(cblas_sdot)(N, (const T*)X, 1, (const T*)Y, 1 ) );
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
return eT( arma_atlas(cblas_ddot)(N, (const T*)X, 1, (const T*)Y, 1) ); return eT( arma_wrapper(cblas_ddot)(N, (const T*)X, 1, (const T*)Y, 1 ) );
} }
else else
{ {
return eT(0); return eT(0);
} }
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
eT eT
cx_cblas_dot(const int N, const eT* X, const eT* Y) cx_cblas_dot(const int N, const eT* X, const eT* Y)
{ {
arma_type_check((is_supported_blas_type<eT>::value == false)); arma_type_check((is_supported_blas_type<eT>::value == false));
if(is_supported_complex_float<eT>::value == true) if(is_supported_complex_float<eT>::value == true)
{ {
typedef typename std::complex<float> T; typedef typename std::complex<float> T;
T out; T out;
arma_atlas(cblas_cdotu_sub)(N, (const T*)X, 1, (const T*)Y, 1, &out); arma_wrapper(cblas_cdotu_sub)(N, (const T*)X, 1, (const T*)Y, 1, &out );
return eT(out); return eT(out);
} }
else else
if(is_supported_complex_double<eT>::value == true) if(is_supported_complex_double<eT>::value == true)
{ {
typedef typename std::complex<double> T; typedef typename std::complex<double> T;
T out; T out;
arma_atlas(cblas_zdotu_sub)(N, (const T*)X, 1, (const T*)Y, 1, &out); arma_wrapper(cblas_zdotu_sub)(N, (const T*)X, 1, (const T*)Y, 1, &out );
return eT(out); return eT(out);
} }
else else
{ {
return eT(0); return eT(0);
} }
} }
template<typename eT> template<typename eT>
skipping to change at line 95 skipping to change at line 95
const eT *X, const int incX, const eT *X, const int incX,
const eT beta, const eT beta,
eT *Y, const int incY eT *Y, const int incY
) )
{ {
arma_type_check((is_supported_blas_type<eT>::value == false)); arma_type_check((is_supported_blas_type<eT>::value == false));
if(is_float<eT>::value == true) if(is_float<eT>::value == true)
{ {
typedef float T; typedef float T;
arma_atlas(cblas_sgemv)(Order, TransA, M, N, (const T)tmp_real(alpha) , (const T*)A, lda, (const T*)X, incX, (const T)tmp_real(beta), (T*)Y, incY ); arma_wrapper(cblas_sgemv)(Order, TransA, M, N, (const T)tmp_real(alph a), (const T*)A, lda, (const T*)X, incX, (const T)tmp_real(beta), (T*)Y, in cY);
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
arma_atlas(cblas_dgemv)(Order, TransA, M, N, (const T)tmp_real(alpha) , (const T*)A, lda, (const T*)X, incX, (const T)tmp_real(beta), (T*)Y, incY ); arma_wrapper(cblas_dgemv)(Order, TransA, M, N, (const T)tmp_real(alph a), (const T*)A, lda, (const T*)X, incX, (const T)tmp_real(beta), (T*)Y, in cY);
} }
else else
if(is_supported_complex_float<eT>::value == true) if(is_supported_complex_float<eT>::value == true)
{ {
typedef std::complex<float> T; typedef std::complex<float> T;
arma_atlas(cblas_cgemv)(Order, TransA, M, N, (const T*)&alpha, (const T*)A, lda, (const T*)X, incX, (const T*)&beta, (T*)Y, incY); arma_wrapper(cblas_cgemv)(Order, TransA, M, N, (const T*)&alpha, (con st T*)A, lda, (const T*)X, incX, (const T*)&beta, (T*)Y, incY);
} }
else else
if(is_supported_complex_double<eT>::value == true) if(is_supported_complex_double<eT>::value == true)
{ {
typedef std::complex<double> T; typedef std::complex<double> T;
arma_atlas(cblas_zgemv)(Order, TransA, M, N, (const T*)&alpha, (const T*)A, lda, (const T*)X, incX, (const T*)&beta, (T*)Y, incY); arma_wrapper(cblas_zgemv)(Order, TransA, M, N, (const T*)&alpha, (con st T*)A, lda, (const T*)X, incX, (const T*)&beta, (T*)Y, incY);
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
cblas_gemm cblas_gemm
( (
const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA,
const enum CBLAS_TRANSPOSE TransB, const int M, const int N, const enum CBLAS_TRANSPOSE TransB, const int M, const int N,
const int K, const eT alpha, const eT *A, const int K, const eT alpha, const eT *A,
const int lda, const eT *B, const int ldb, const int lda, const eT *B, const int ldb,
const eT beta, eT *C, const int ldc const eT beta, eT *C, const int ldc
) )
{ {
arma_type_check((is_supported_blas_type<eT>::value == false)); arma_type_check((is_supported_blas_type<eT>::value == false));
if(is_float<eT>::value == true) if(is_float<eT>::value == true)
{ {
typedef float T; typedef float T;
arma_atlas(cblas_sgemm)(Order, TransA, TransB, M, N, K, (const T)tmp_ real(alpha), (const T*)A, lda, (const T*)B, ldb, (const T)tmp_real(beta), ( T*)C, ldc); arma_wrapper(cblas_sgemm)(Order, TransA, TransB, M, N, K, (const T)tm p_real(alpha), (const T*)A, lda, (const T*)B, ldb, (const T)tmp_real(beta), (T*)C, ldc);
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
arma_atlas(cblas_dgemm)(Order, TransA, TransB, M, N, K, (const T)tmp_ real(alpha), (const T*)A, lda, (const T*)B, ldb, (const T)tmp_real(beta), ( T*)C, ldc); arma_wrapper(cblas_dgemm)(Order, TransA, TransB, M, N, K, (const T)tm p_real(alpha), (const T*)A, lda, (const T*)B, ldb, (const T)tmp_real(beta), (T*)C, ldc);
} }
else else
if(is_supported_complex_float<eT>::value == true) if(is_supported_complex_float<eT>::value == true)
{ {
typedef std::complex<float> T; typedef std::complex<float> T;
arma_atlas(cblas_cgemm)(Order, TransA, TransB, M, N, K, (const T*)&al pha, (const T*)A, lda, (const T*)B, ldb, (const T*)&beta, (T*)C, ldc); arma_wrapper(cblas_cgemm)(Order, TransA, TransB, M, N, K, (const T*)& alpha, (const T*)A, lda, (const T*)B, ldb, (const T*)&beta, (T*)C, ldc);
} }
else else
if(is_supported_complex_double<eT>::value == true) if(is_supported_complex_double<eT>::value == true)
{ {
typedef std::complex<double> T; typedef std::complex<double> T;
arma_atlas(cblas_zgemm)(Order, TransA, TransB, M, N, K, (const T*)&al pha, (const T*)A, lda, (const T*)B, ldb, (const T*)&beta, (T*)C, ldc); arma_wrapper(cblas_zgemm)(Order, TransA, TransB, M, N, K, (const T*)& alpha, (const T*)A, lda, (const T*)B, ldb, (const T*)&beta, (T*)C, ldc);
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
cblas_syrk cblas_syrk
( (
const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CB LAS_TRANSPOSE Trans, const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CB LAS_TRANSPOSE Trans,
const int N, const int K, const eT alpha, const int N, const int K, const eT alpha,
const eT* A, const int lda, const eT beta, eT* C, const int ldc const eT* A, const int lda, const eT beta, eT* C, const int ldc
) )
{ {
arma_type_check((is_supported_blas_type<eT>::value == false)); arma_type_check((is_supported_blas_type<eT>::value == false));
if(is_float<eT>::value == true) if(is_float<eT>::value == true)
{ {
typedef float T; typedef float T;
arma_atlas(cblas_ssyrk)(Order, Uplo, Trans, N, K, (const T)alpha, (co nst T*)A, lda, (const T)beta, (T*)C, ldc); arma_wrapper(cblas_ssyrk)(Order, Uplo, Trans, N, K, (const T)alpha, ( const T*)A, lda, (const T)beta, (T*)C, ldc);
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
arma_atlas(cblas_dsyrk)(Order, Uplo, Trans, N, K, (const T)alpha, (co nst T*)A, lda, (const T)beta, (T*)C, ldc); arma_wrapper(cblas_dsyrk)(Order, Uplo, Trans, N, K, (const T)alpha, ( const T*)A, lda, (const T)beta, (T*)C, ldc);
} }
} }
template<typename T> template<typename T>
inline inline
void void
cblas_herk cblas_herk
( (
const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CB LAS_TRANSPOSE Trans, const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CB LAS_TRANSPOSE Trans,
const int N, const int K, const T alpha, const int N, const int K, const T alpha,
const std::complex<T>* A, const int lda, const T beta, std::complex<T>* C, const int ldc const std::complex<T>* A, const int lda, const T beta, std::complex<T>* C, const int ldc
) )
{ {
arma_type_check((is_supported_blas_type<T>::value == false)); arma_type_check((is_supported_blas_type<T>::value == false));
if(is_float<T>::value == true) if(is_float<T>::value == true)
{ {
typedef float TT; typedef float TT;
typedef std::complex<float> cx_TT; typedef std::complex<float> cx_TT;
arma_atlas(cblas_cherk)(Order, Uplo, Trans, N, K, (const TT)alpha, (c onst cx_TT*)A, lda, (const TT)beta, (cx_TT*)C, ldc); arma_wrapper(cblas_cherk)(Order, Uplo, Trans, N, K, (const TT)alpha, (const cx_TT*)A, lda, (const TT)beta, (cx_TT*)C, ldc);
} }
else else
if(is_double<T>::value == true) if(is_double<T>::value == true)
{ {
typedef double TT; typedef double TT;
typedef std::complex<double> cx_TT; typedef std::complex<double> cx_TT;
arma_atlas(cblas_zherk)(Order, Uplo, Trans, N, K, (const TT)alpha, (c onst cx_TT*)A, lda, (const TT)beta, (cx_TT*)C, ldc); arma_wrapper(cblas_zherk)(Order, Uplo, Trans, N, K, (const TT)alpha, (const cx_TT*)A, lda, (const TT)beta, (cx_TT*)C, ldc);
} }
} }
template<typename eT> template<typename eT>
inline inline
int int
clapack_getrf clapack_getrf
( (
const enum CBLAS_ORDER Order, const int M, const int N, const enum CBLAS_ORDER Order, const int M, const int N,
eT *A, const int lda, int *ipiv eT *A, const int lda, int *ipiv
) )
{ {
arma_type_check((is_supported_blas_type<eT>::value == false)); arma_type_check((is_supported_blas_type<eT>::value == false));
if(is_float<eT>::value == true) if(is_float<eT>::value == true)
{ {
typedef float T; typedef float T;
return arma_atlas(clapack_sgetrf)(Order, M, N, (T*)A, lda, ipiv); return arma_wrapper(clapack_sgetrf)(Order, M, N, (T*)A, lda, ipiv);
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
return arma_atlas(clapack_dgetrf)(Order, M, N, (T*)A, lda, ipiv); return arma_wrapper(clapack_dgetrf)(Order, M, N, (T*)A, lda, ipiv);
} }
else else
if(is_supported_complex_float<eT>::value == true) if(is_supported_complex_float<eT>::value == true)
{ {
typedef std::complex<float> T; typedef std::complex<float> T;
return arma_atlas(clapack_cgetrf)(Order, M, N, (T*)A, lda, ipiv); return arma_wrapper(clapack_cgetrf)(Order, M, N, (T*)A, lda, ipiv);
} }
else else
if(is_supported_complex_double<eT>::value == true) if(is_supported_complex_double<eT>::value == true)
{ {
typedef std::complex<double> T; typedef std::complex<double> T;
return arma_atlas(clapack_zgetrf)(Order, M, N, (T*)A, lda, ipiv); return arma_wrapper(clapack_zgetrf)(Order, M, N, (T*)A, lda, ipiv);
} }
else else
{ {
return -1; return -1;
} }
} }
template<typename eT> template<typename eT>
inline inline
int int
skipping to change at line 264 skipping to change at line 264
( (
const enum CBLAS_ORDER Order, const int N, eT *A, const enum CBLAS_ORDER Order, const int N, eT *A,
const int lda, const int *ipiv const int lda, const int *ipiv
) )
{ {
arma_type_check((is_supported_blas_type<eT>::value == false)); arma_type_check((is_supported_blas_type<eT>::value == false));
if(is_float<eT>::value == true) if(is_float<eT>::value == true)
{ {
typedef float T; typedef float T;
return arma_atlas(clapack_sgetri)(Order, N, (T*)A, lda, ipiv); return arma_wrapper(clapack_sgetri)(Order, N, (T*)A, lda, ipiv);
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
return arma_atlas(clapack_dgetri)(Order, N, (T*)A, lda, ipiv); return arma_wrapper(clapack_dgetri)(Order, N, (T*)A, lda, ipiv);
} }
else else
if(is_supported_complex_float<eT>::value == true) if(is_supported_complex_float<eT>::value == true)
{ {
typedef std::complex<float> T; typedef std::complex<float> T;
return arma_atlas(clapack_cgetri)(Order, N, (T*)A, lda, ipiv); return arma_wrapper(clapack_cgetri)(Order, N, (T*)A, lda, ipiv);
} }
else else
if(is_supported_complex_double<eT>::value == true) if(is_supported_complex_double<eT>::value == true)
{ {
typedef std::complex<double> T; typedef std::complex<double> T;
return arma_atlas(clapack_zgetri)(Order, N, (T*)A, lda, ipiv); return arma_wrapper(clapack_zgetri)(Order, N, (T*)A, lda, ipiv);
} }
else else
{ {
return -1; return -1;
} }
} }
template<typename eT> template<typename eT>
inline inline
int int
skipping to change at line 306 skipping to change at line 306
const int N, const int NRHS, const int N, const int NRHS,
eT* A, const int lda, int* ipiv, eT* A, const int lda, int* ipiv,
eT* B, const int ldb eT* B, const int ldb
) )
{ {
arma_type_check((is_supported_blas_type<eT>::value == false)); arma_type_check((is_supported_blas_type<eT>::value == false));
if(is_float<eT>::value == true) if(is_float<eT>::value == true)
{ {
typedef float T; typedef float T;
return arma_atlas(clapack_sgesv)(Order, N, NRHS, (T*)A, lda, ipiv, (T *)B, ldb); return arma_wrapper(clapack_sgesv)(Order, N, NRHS, (T*)A, lda, ipiv, (T*)B, ldb);
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
return arma_atlas(clapack_dgesv)(Order, N, NRHS, (T*)A, lda, ipiv, (T *)B, ldb); return arma_wrapper(clapack_dgesv)(Order, N, NRHS, (T*)A, lda, ipiv, (T*)B, ldb);
} }
else else
if(is_supported_complex_float<eT>::value == true) if(is_supported_complex_float<eT>::value == true)
{ {
typedef std::complex<float> T; typedef std::complex<float> T;
return arma_atlas(clapack_cgesv)(Order, N, NRHS, (T*)A, lda, ipiv, (T *)B, ldb); return arma_wrapper(clapack_cgesv)(Order, N, NRHS, (T*)A, lda, ipiv, (T*)B, ldb);
} }
else else
if(is_supported_complex_double<eT>::value == true) if(is_supported_complex_double<eT>::value == true)
{ {
typedef std::complex<double> T; typedef std::complex<double> T;
return arma_atlas(clapack_zgesv)(Order, N, NRHS, (T*)A, lda, ipiv, (T *)B, ldb); return arma_wrapper(clapack_zgesv)(Order, N, NRHS, (T*)A, lda, ipiv, (T*)B, ldb);
} }
else else
{ {
return -1; return -1;
} }
} }
} }
#endif #endif
 End of changes. 28 change blocks. 
28 lines changed or deleted 28 lines changed or added


 auxlib_meat.hpp   auxlib_meat.hpp 
// Copyright (C) 2008-2014 Conrad Sanderson // Copyright (C) 2008-2015 Conrad Sanderson
// Copyright (C) 2008-2014 NICTA (www.nicta.com.au) // Copyright (C) 2008-2015 NICTA (www.nicta.com.au)
// Copyright (C) 2009 Edmund Highcock // Copyright (C) 2009 Edmund Highcock
// Copyright (C) 2011 James Sanders // Copyright (C) 2011 James Sanders
// Copyright (C) 2011 Stanislav Funiak // Copyright (C) 2011 Stanislav Funiak
// Copyright (C) 2012 Eric Jon Sundstrom // Copyright (C) 2012 Eric Jon Sundstrom
// Copyright (C) 2012 Michael McNeil Forbes // Copyright (C) 2012 Michael McNeil Forbes
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
skipping to change at line 239 skipping to change at line 239
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
if(out.is_empty()) if(out.is_empty())
{ {
return true; return true;
} }
#if defined(ARMA_USE_ATLAS) #if defined(ARMA_USE_ATLAS)
{ {
arma_debug_assert_atlas_size(out);
podarray<int> ipiv(out.n_rows); podarray<int> ipiv(out.n_rows);
int info = atlas::clapack_getrf(atlas::CblasColMajor, out.n_rows, out.n _cols, out.memptr(), out.n_rows, ipiv.memptr()); int info = atlas::clapack_getrf(atlas::CblasColMajor, out.n_rows, out.n _cols, out.memptr(), out.n_rows, ipiv.memptr());
if(info == 0) if(info == 0)
{ {
info = atlas::clapack_getri(atlas::CblasColMajor, out.n_rows, out.mem ptr(), out.n_rows, ipiv.memptr()); info = atlas::clapack_getri(atlas::CblasColMajor, out.n_rows, out.mem ptr(), out.n_rows, ipiv.memptr());
} }
return (info == 0); return (info == 0);
} }
#elif defined(ARMA_USE_LAPACK) #elif defined(ARMA_USE_LAPACK)
{ {
arma_debug_assert_blas_size(out);
blas_int n_rows = out.n_rows; blas_int n_rows = out.n_rows;
blas_int lwork = (std::max)(blas_int(podarray_prealloc_n_elem::val), n _rows); blas_int lwork = (std::max)(blas_int(podarray_prealloc_n_elem::val), n _rows);
blas_int info = 0; blas_int info = 0;
podarray<blas_int> ipiv(out.n_rows); podarray<blas_int> ipiv(out.n_rows);
if(n_rows > 16) if(n_rows > 16)
{ {
eT work_query[2]; eT work_query[2];
blas_int lwork_query = -1; blas_int lwork_query = -1;
skipping to change at line 319 skipping to change at line 323
if(out.is_empty()) if(out.is_empty())
{ {
return true; return true;
} }
bool status; bool status;
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
arma_debug_assert_blas_size(out);
char uplo = (layout == 0) ? 'U' : 'L'; char uplo = (layout == 0) ? 'U' : 'L';
char diag = 'N'; char diag = 'N';
blas_int n = blas_int(out.n_rows); blas_int n = blas_int(out.n_rows);
blas_int info = 0; blas_int info = 0;
lapack::trtri(&uplo, &diag, &n, out.memptr(), &n, &info); lapack::trtri(&uplo, &diag, &n, out.memptr(), &n, &info);
status = (info == 0); status = (info == 0);
} }
#else #else
skipping to change at line 373 skipping to change at line 379
if(out.is_empty()) if(out.is_empty())
{ {
return true; return true;
} }
bool status; bool status;
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
arma_debug_assert_blas_size(out);
char uplo = (layout == 0) ? 'U' : 'L'; char uplo = (layout == 0) ? 'U' : 'L';
blas_int n = blas_int(out.n_rows); blas_int n = blas_int(out.n_rows);
blas_int lwork = (std::max)(blas_int(podarray_prealloc_n_elem::val), 2* n); blas_int lwork = (std::max)(blas_int(podarray_prealloc_n_elem::val), 2* n);
blas_int info = 0; blas_int info = 0;
podarray<blas_int> ipiv; podarray<blas_int> ipiv;
ipiv.set_size(out.n_rows); ipiv.set_size(out.n_rows);
podarray<eT> work; podarray<eT> work;
work.set_size( uword(lwork) ); work.set_size( uword(lwork) );
skipping to change at line 428 skipping to change at line 436
if(out.is_empty()) if(out.is_empty())
{ {
return true; return true;
} }
bool status; bool status;
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
arma_debug_assert_blas_size(out);
char uplo = (layout == 0) ? 'U' : 'L'; char uplo = (layout == 0) ? 'U' : 'L';
blas_int n = blas_int(out.n_rows); blas_int n = blas_int(out.n_rows);
blas_int info = 0; blas_int info = 0;
lapack::potrf(&uplo, &n, out.memptr(), &n, &info); lapack::potrf(&uplo, &n, out.memptr(), &n, &info);
status = (info == 0); status = (info == 0);
if(status == true) if(status == true)
{ {
skipping to change at line 597 skipping to change at line 607
Mat<eT>& tmp = (make_copy == true) ? X_copy : const_cast< Mat<eT>& >(X); Mat<eT>& tmp = (make_copy == true) ? X_copy : const_cast< Mat<eT>& >(X);
if(tmp.is_empty()) if(tmp.is_empty())
{ {
return eT(1); return eT(1);
} }
#if defined(ARMA_USE_ATLAS) #if defined(ARMA_USE_ATLAS)
{ {
arma_debug_assert_atlas_size(tmp);
podarray<int> ipiv(tmp.n_rows); podarray<int> ipiv(tmp.n_rows);
//const int info = //const int info =
atlas::clapack_getrf(atlas::CblasColMajor, tmp.n_rows, tmp.n_cols, tmp. memptr(), tmp.n_rows, ipiv.memptr()); atlas::clapack_getrf(atlas::CblasColMajor, tmp.n_rows, tmp.n_cols, tmp. memptr(), tmp.n_rows, ipiv.memptr());
// on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero // on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero
eT val = tmp.at(0,0); eT val = tmp.at(0,0);
for(uword i=1; i < tmp.n_rows; ++i) for(uword i=1; i < tmp.n_rows; ++i)
{ {
val *= tmp.at(i,i); val *= tmp.at(i,i);
skipping to change at line 622 skipping to change at line 634
if( int(i) != ipiv.mem[i] ) // NOTE: no adjustment required, as the clapack version of getrf() assumes counting from 0 if( int(i) != ipiv.mem[i] ) // NOTE: no adjustment required, as the clapack version of getrf() assumes counting from 0
{ {
sign *= -1; sign *= -1;
} }
} }
return ( (sign < 0) ? -val : val ); return ( (sign < 0) ? -val : val );
} }
#elif defined(ARMA_USE_LAPACK) #elif defined(ARMA_USE_LAPACK)
{ {
arma_debug_assert_blas_size(tmp);
podarray<blas_int> ipiv(tmp.n_rows); podarray<blas_int> ipiv(tmp.n_rows);
blas_int info = 0; blas_int info = 0;
blas_int n_rows = blas_int(tmp.n_rows); blas_int n_rows = blas_int(tmp.n_rows);
blas_int n_cols = blas_int(tmp.n_cols); blas_int n_cols = blas_int(tmp.n_cols);
lapack::getrf(&n_rows, &n_cols, tmp.memptr(), &n_rows, ipiv.memptr(), & info); lapack::getrf(&n_rows, &n_cols, tmp.memptr(), &n_rows, ipiv.memptr(), & info);
// on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero // on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero
eT val = tmp.at(0,0); eT val = tmp.at(0,0);
skipping to change at line 681 skipping to change at line 695
Mat<eT> tmp(X.get_ref()); Mat<eT> tmp(X.get_ref());
arma_debug_check( (tmp.is_square() == false), "log_det(): given matrix is not square" ); arma_debug_check( (tmp.is_square() == false), "log_det(): given matrix is not square" );
if(tmp.is_empty()) if(tmp.is_empty())
{ {
out_val = eT(0); out_val = eT(0);
out_sign = T(1); out_sign = T(1);
return true; return true;
} }
arma_debug_assert_atlas_size(tmp);
podarray<int> ipiv(tmp.n_rows); podarray<int> ipiv(tmp.n_rows);
const int info = atlas::clapack_getrf(atlas::CblasColMajor, tmp.n_rows, tmp.n_cols, tmp.memptr(), tmp.n_rows, ipiv.memptr()); const int info = atlas::clapack_getrf(atlas::CblasColMajor, tmp.n_rows, tmp.n_cols, tmp.memptr(), tmp.n_rows, ipiv.memptr());
// on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero // on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero
sword sign = (is_complex<eT>::value == false) ? ( (access::tmp_real( tm p.at(0,0) ) < T(0)) ? -1 : +1 ) : +1; sword sign = (is_complex<eT>::value == false) ? ( (access::tmp_real( tm p.at(0,0) ) < T(0)) ? -1 : +1 ) : +1;
eT val = (is_complex<eT>::value == false) ? std::log( (access::tmp_re al( tmp.at(0,0) ) < T(0)) ? tmp.at(0,0)*T(-1) : tmp.at(0,0) ) : std::log( t mp.at(0,0) ); eT val = (is_complex<eT>::value == false) ? std::log( (access::tmp_re al( tmp.at(0,0) ) < T(0)) ? tmp.at(0,0)*T(-1) : tmp.at(0,0) ) : std::log( t mp.at(0,0) );
for(uword i=1; i < tmp.n_rows; ++i) for(uword i=1; i < tmp.n_rows; ++i)
skipping to change at line 723 skipping to change at line 739
Mat<eT> tmp(X.get_ref()); Mat<eT> tmp(X.get_ref());
arma_debug_check( (tmp.is_square() == false), "log_det(): given matrix is not square" ); arma_debug_check( (tmp.is_square() == false), "log_det(): given matrix is not square" );
if(tmp.is_empty()) if(tmp.is_empty())
{ {
out_val = eT(0); out_val = eT(0);
out_sign = T(1); out_sign = T(1);
return true; return true;
} }
arma_debug_assert_blas_size(tmp);
podarray<blas_int> ipiv(tmp.n_rows); podarray<blas_int> ipiv(tmp.n_rows);
blas_int info = 0; blas_int info = 0;
blas_int n_rows = blas_int(tmp.n_rows); blas_int n_rows = blas_int(tmp.n_rows);
blas_int n_cols = blas_int(tmp.n_cols); blas_int n_cols = blas_int(tmp.n_cols);
lapack::getrf(&n_rows, &n_cols, tmp.memptr(), &n_rows, ipiv.memptr(), & info); lapack::getrf(&n_rows, &n_cols, tmp.memptr(), &n_rows, ipiv.memptr(), & info);
// on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero // on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero
skipping to change at line 798 skipping to change at line 816
ipiv.reset(); ipiv.reset();
return true; return true;
} }
#if defined(ARMA_USE_ATLAS) || defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_ATLAS) || defined(ARMA_USE_LAPACK)
{ {
bool status; bool status;
#if defined(ARMA_USE_ATLAS) #if defined(ARMA_USE_ATLAS)
{ {
arma_debug_assert_atlas_size(U);
ipiv.set_size( (std::min)(U_n_rows, U_n_cols) ); ipiv.set_size( (std::min)(U_n_rows, U_n_cols) );
int info = atlas::clapack_getrf(atlas::CblasColMajor, U_n_rows, U_n_c ols, U.memptr(), U_n_rows, ipiv.memptr()); int info = atlas::clapack_getrf(atlas::CblasColMajor, U_n_rows, U_n_c ols, U.memptr(), U_n_rows, ipiv.memptr());
status = (info == 0); status = (info == 0);
} }
#elif defined(ARMA_USE_LAPACK) #elif defined(ARMA_USE_LAPACK)
{ {
arma_debug_assert_blas_size(U);
ipiv.set_size( (std::min)(U_n_rows, U_n_cols) ); ipiv.set_size( (std::min)(U_n_rows, U_n_cols) );
blas_int info = 0; blas_int info = 0;
blas_int n_rows = U_n_rows; blas_int n_rows = U_n_rows;
blas_int n_cols = U_n_cols; blas_int n_cols = U_n_cols;
lapack::getrf(&n_rows, &n_cols, U.memptr(), &n_rows, ipiv.memptr(), & info); lapack::getrf(&n_rows, &n_cols, U.memptr(), &n_rows, ipiv.memptr(), & info);
// take into account that Fortran counts from 1 // take into account that Fortran counts from 1
skipping to change at line 993 skipping to change at line 1015
Mat<eT> A(X.get_ref()); Mat<eT> A(X.get_ref());
arma_debug_check( (A.is_square() == false), "eig_sym(): given matrix is not square"); arma_debug_check( (A.is_square() == false), "eig_sym(): given matrix is not square");
if(A.is_empty()) if(A.is_empty())
{ {
eigval.reset(); eigval.reset();
return true; return true;
} }
arma_debug_assert_blas_size(A);
eigval.set_size(A.n_rows); eigval.set_size(A.n_rows);
char jobz = 'N'; char jobz = 'N';
char uplo = 'U'; char uplo = 'U';
blas_int N = blas_int(A.n_rows); blas_int N = blas_int(A.n_rows);
blas_int lwork = 3 * ( (std::max)(blas_int(1), 3*N-1) ); blas_int lwork = 3 * ( (std::max)(blas_int(1), 3*N-1) );
blas_int info = 0; blas_int info = 0;
podarray<eT> work( static_cast<uword>(lwork) ); podarray<eT> work( static_cast<uword>(lwork) );
skipping to change at line 1040 skipping to change at line 1064
Mat<eT> A(X.get_ref()); Mat<eT> A(X.get_ref());
arma_debug_check( (A.is_square() == false), "eig_sym(): given matrix is not square"); arma_debug_check( (A.is_square() == false), "eig_sym(): given matrix is not square");
if(A.is_empty()) if(A.is_empty())
{ {
eigval.reset(); eigval.reset();
return true; return true;
} }
arma_debug_assert_blas_size(A);
eigval.set_size(A.n_rows); eigval.set_size(A.n_rows);
char jobz = 'N'; char jobz = 'N';
char uplo = 'U'; char uplo = 'U';
blas_int N = blas_int(A.n_rows); blas_int N = blas_int(A.n_rows);
blas_int lwork = 3 * ( (std::max)(blas_int(1), 2*N-1) ); blas_int lwork = 3 * ( (std::max)(blas_int(1), 2*N-1) );
blas_int info = 0; blas_int info = 0;
podarray<eT> work( static_cast<uword>(lwork) ); podarray<eT> work( static_cast<uword>(lwork) );
skipping to change at line 1088 skipping to change at line 1114
arma_debug_check( (eigvec.is_square() == false), "eig_sym(): given matr ix is not square" ); arma_debug_check( (eigvec.is_square() == false), "eig_sym(): given matr ix is not square" );
if(eigvec.is_empty()) if(eigvec.is_empty())
{ {
eigval.reset(); eigval.reset();
eigvec.reset(); eigvec.reset();
return true; return true;
} }
arma_debug_assert_blas_size(eigvec);
eigval.set_size(eigvec.n_rows); eigval.set_size(eigvec.n_rows);
char jobz = 'V'; char jobz = 'V';
char uplo = 'U'; char uplo = 'U';
blas_int N = blas_int(eigvec.n_rows); blas_int N = blas_int(eigvec.n_rows);
blas_int lwork = 3 * ( (std::max)(blas_int(1), 3*N-1) ); blas_int lwork = 3 * ( (std::max)(blas_int(1), 3*N-1) );
blas_int info = 0; blas_int info = 0;
podarray<eT> work( static_cast<uword>(lwork) ); podarray<eT> work( static_cast<uword>(lwork) );
skipping to change at line 1137 skipping to change at line 1165
arma_debug_check( (eigvec.is_square() == false), "eig_sym(): given matr ix is not square" ); arma_debug_check( (eigvec.is_square() == false), "eig_sym(): given matr ix is not square" );
if(eigvec.is_empty()) if(eigvec.is_empty())
{ {
eigval.reset(); eigval.reset();
eigvec.reset(); eigvec.reset();
return true; return true;
} }
arma_debug_assert_blas_size(eigvec);
eigval.set_size(eigvec.n_rows); eigval.set_size(eigvec.n_rows);
char jobz = 'V'; char jobz = 'V';
char uplo = 'U'; char uplo = 'U';
blas_int N = blas_int(eigvec.n_rows); blas_int N = blas_int(eigvec.n_rows);
blas_int lwork = 3 * ( (std::max)(blas_int(1), 2*N-1) ); blas_int lwork = 3 * ( (std::max)(blas_int(1), 2*N-1) );
blas_int info = 0; blas_int info = 0;
podarray<eT> work( static_cast<uword>(lwork) ); podarray<eT> work( static_cast<uword>(lwork) );
skipping to change at line 1186 skipping to change at line 1216
arma_debug_check( (eigvec.is_square() == false), "eig_sym(): given matr ix is not square" ); arma_debug_check( (eigvec.is_square() == false), "eig_sym(): given matr ix is not square" );
if(eigvec.is_empty()) if(eigvec.is_empty())
{ {
eigval.reset(); eigval.reset();
eigvec.reset(); eigvec.reset();
return true; return true;
} }
arma_debug_assert_blas_size(eigvec);
eigval.set_size(eigvec.n_rows); eigval.set_size(eigvec.n_rows);
char jobz = 'V'; char jobz = 'V';
char uplo = 'U'; char uplo = 'U';
blas_int N = blas_int(eigvec.n_rows); blas_int N = blas_int(eigvec.n_rows);
blas_int lwork = 2 * (1 + 6*N + 2*(N*N)); blas_int lwork = 2 * (1 + 6*N + 2*(N*N));
blas_int liwork = 3 * (3 + 5*N); blas_int liwork = 3 * (3 + 5*N);
blas_int info = 0; blas_int info = 0;
skipping to change at line 1238 skipping to change at line 1270
arma_debug_check( (eigvec.is_square() == false), "eig_sym(): given matr ix is not square" ); arma_debug_check( (eigvec.is_square() == false), "eig_sym(): given matr ix is not square" );
if(eigvec.is_empty()) if(eigvec.is_empty())
{ {
eigval.reset(); eigval.reset();
eigvec.reset(); eigvec.reset();
return true; return true;
} }
arma_debug_assert_blas_size(eigvec);
eigval.set_size(eigvec.n_rows); eigval.set_size(eigvec.n_rows);
char jobz = 'V'; char jobz = 'V';
char uplo = 'U'; char uplo = 'U';
blas_int N = blas_int(eigvec.n_rows); blas_int N = blas_int(eigvec.n_rows);
blas_int lwork = 2 * (2*N + N*N); blas_int lwork = 2 * (2*N + N*N);
blas_int lrwork = 2 * (1 + 5*N + 2*(N*N)); blas_int lrwork = 2 * (1 + 5*N + 2*(N*N));
blas_int liwork = 3 * (3 + 5*N); blas_int liwork = 3 * (3 + 5*N);
blas_int info = 0; blas_int info = 0;
skipping to change at line 1329 skipping to change at line 1363
arma_debug_check( (A.is_square() == false), "eig_gen(): given matrix is not square" ); arma_debug_check( (A.is_square() == false), "eig_gen(): given matrix is not square" );
if(A.is_empty()) if(A.is_empty())
{ {
eigval.reset(); eigval.reset();
l_eigvec.reset(); l_eigvec.reset();
r_eigvec.reset(); r_eigvec.reset();
return true; return true;
} }
if(A.is_finite() == false) { return false; } // workaround for a bug
in LAPACK 3.5
arma_debug_assert_blas_size(A);
const uword A_n_rows = A.n_rows; const uword A_n_rows = A.n_rows;
eigval.set_size(A_n_rows); eigval.set_size(A_n_rows);
l_eigvec.set_size( ((jobvl == 'V') ? A_n_rows : 1), A_n_rows ); l_eigvec.set_size( ((jobvl == 'V') ? A_n_rows : 1), A_n_rows );
r_eigvec.set_size( ((jobvr == 'V') ? A_n_rows : 1), A_n_rows ); r_eigvec.set_size( ((jobvr == 'V') ? A_n_rows : 1), A_n_rows );
blas_int N = blas_int(A_n_rows); blas_int N = blas_int(A_n_rows);
blas_int ldvl = blas_int(l_eigvec.n_rows); blas_int ldvl = blas_int(l_eigvec.n_rows);
blas_int ldvr = blas_int(r_eigvec.n_rows); blas_int ldvr = blas_int(r_eigvec.n_rows);
skipping to change at line 1433 skipping to change at line 1471
arma_debug_check( (A.is_square() == false), "eig_gen(): given matrix is not square" ); arma_debug_check( (A.is_square() == false), "eig_gen(): given matrix is not square" );
if(A.is_empty()) if(A.is_empty())
{ {
eigval.reset(); eigval.reset();
l_eigvec.reset(); l_eigvec.reset();
r_eigvec.reset(); r_eigvec.reset();
return true; return true;
} }
if(A.is_finite() == false) { return false; } // workaround for a bug
in LAPACK 3.5
arma_debug_assert_blas_size(A);
const uword A_n_rows = A.n_rows; const uword A_n_rows = A.n_rows;
eigval.set_size(A_n_rows); eigval.set_size(A_n_rows);
l_eigvec.set_size( ((jobvl == 'V') ? A_n_rows : 1), A_n_rows ); l_eigvec.set_size( ((jobvl == 'V') ? A_n_rows : 1), A_n_rows );
r_eigvec.set_size( ((jobvr == 'V') ? A_n_rows : 1), A_n_rows ); r_eigvec.set_size( ((jobvr == 'V') ? A_n_rows : 1), A_n_rows );
blas_int N = blas_int(A_n_rows); blas_int N = blas_int(A_n_rows);
blas_int ldvl = blas_int(l_eigvec.n_rows); blas_int ldvl = blas_int(l_eigvec.n_rows);
blas_int ldvr = blas_int(r_eigvec.n_rows); blas_int ldvr = blas_int(r_eigvec.n_rows);
skipping to change at line 1531 skipping to change at line 1573
arma_debug_check( (A.n_rows != B.n_rows), "eig_pair(): given matrices m ust have the same size" ); arma_debug_check( (A.n_rows != B.n_rows), "eig_pair(): given matrices m ust have the same size" );
if(A.is_empty()) if(A.is_empty())
{ {
eigval.reset(); eigval.reset();
l_eigvec.reset(); l_eigvec.reset();
r_eigvec.reset(); r_eigvec.reset();
return true; return true;
} }
arma_debug_assert_blas_size(A);
const uword A_n_rows = A.n_rows; const uword A_n_rows = A.n_rows;
eigval.set_size(A_n_rows); eigval.set_size(A_n_rows);
l_eigvec.set_size( ((jobvl == 'V') ? A_n_rows : 1), A_n_rows ); l_eigvec.set_size( ((jobvl == 'V') ? A_n_rows : 1), A_n_rows );
r_eigvec.set_size( ((jobvr == 'V') ? A_n_rows : 1), A_n_rows ); r_eigvec.set_size( ((jobvr == 'V') ? A_n_rows : 1), A_n_rows );
blas_int N = blas_int(A_n_rows); blas_int N = blas_int(A_n_rows);
blas_int ldvl = blas_int(l_eigvec.n_rows); blas_int ldvl = blas_int(l_eigvec.n_rows);
blas_int ldvr = blas_int(r_eigvec.n_rows); blas_int ldvr = blas_int(r_eigvec.n_rows);
skipping to change at line 1685 skipping to change at line 1729
arma_debug_check( (A.n_rows != B.n_rows), "eig_pair(): given matrices m ust have the same size" ); arma_debug_check( (A.n_rows != B.n_rows), "eig_pair(): given matrices m ust have the same size" );
if(A.is_empty()) if(A.is_empty())
{ {
eigval.reset(); eigval.reset();
l_eigvec.reset(); l_eigvec.reset();
r_eigvec.reset(); r_eigvec.reset();
return true; return true;
} }
arma_debug_assert_blas_size(A);
const uword A_n_rows = A.n_rows; const uword A_n_rows = A.n_rows;
podarray<eT> alpha(A_n_rows); podarray<eT> alpha(A_n_rows);
podarray<eT> beta(A_n_rows); podarray<eT> beta(A_n_rows);
l_eigvec.set_size( ((jobvl == 'V') ? A_n_rows : 1), A_n_rows ); l_eigvec.set_size( ((jobvl == 'V') ? A_n_rows : 1), A_n_rows );
r_eigvec.set_size( ((jobvr == 'V') ? A_n_rows : 1), A_n_rows ); r_eigvec.set_size( ((jobvr == 'V') ? A_n_rows : 1), A_n_rows );
blas_int N = blas_int(A_n_rows); blas_int N = blas_int(A_n_rows);
blas_int ldvl = blas_int(l_eigvec.n_rows); blas_int ldvl = blas_int(l_eigvec.n_rows);
skipping to change at line 1776 skipping to change at line 1822
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
out = X.get_ref(); out = X.get_ref();
arma_debug_check( (out.is_square() == false), "chol(): given matrix is not square" ); arma_debug_check( (out.is_square() == false), "chol(): given matrix is not square" );
if(out.is_empty()) { return true; } if(out.is_empty()) { return true; }
arma_debug_assert_blas_size(out);
const uword out_n_rows = out.n_rows; const uword out_n_rows = out.n_rows;
char uplo = (layout == 0) ? 'U' : 'L'; char uplo = (layout == 0) ? 'U' : 'L';
blas_int n = out_n_rows; blas_int n = out_n_rows;
blas_int info = 0; blas_int info = 0;
lapack::potrf(&uplo, &n, out.memptr(), &n, &info); lapack::potrf(&uplo, &n, out.memptr(), &n, &info);
if(layout == 0) if(layout == 0)
{ {
skipping to change at line 1837 skipping to change at line 1885
const uword R_n_rows = R.n_rows; const uword R_n_rows = R.n_rows;
const uword R_n_cols = R.n_cols; const uword R_n_cols = R.n_cols;
if(R.is_empty()) if(R.is_empty())
{ {
Q.eye(R_n_rows, R_n_rows); Q.eye(R_n_rows, R_n_rows);
return true; return true;
} }
arma_debug_assert_blas_size(R);
blas_int m = static_cast<blas_int>(R_n_rows); blas_int m = static_cast<blas_int>(R_n_rows);
blas_int n = static_cast<blas_int>(R_n_cols); blas_int n = static_cast<blas_int>(R_n_cols);
blas_int lwork = 0; blas_int lwork = 0;
blas_int lwork_min = (std::max)(blas_int(1), (std::max)(m,n)); // take into account requirements of geqrf() _and_ orgqr()/ungqr() blas_int lwork_min = (std::max)(blas_int(1), (std::max)(m,n)); // take into account requirements of geqrf() _and_ orgqr()/ungqr()
blas_int k = (std::min)(m,n); blas_int k = (std::min)(m,n);
blas_int info = 0; blas_int info = 0;
podarray<eT> tau( static_cast<uword>(k) ); podarray<eT> tau( static_cast<uword>(k) );
eT work_query[2]; eT work_query[2];
skipping to change at line 1953 skipping to change at line 2003
return auxlib::qr(Q, R, Q); return auxlib::qr(Q, R, Q);
} }
if(Q.is_empty()) if(Q.is_empty())
{ {
Q.set_size(Q_n_rows, 0 ); Q.set_size(Q_n_rows, 0 );
R.set_size(0, Q_n_cols); R.set_size(0, Q_n_cols);
return true; return true;
} }
arma_debug_assert_blas_size(Q);
blas_int m = static_cast<blas_int>(Q_n_rows); blas_int m = static_cast<blas_int>(Q_n_rows);
blas_int n = static_cast<blas_int>(Q_n_cols); blas_int n = static_cast<blas_int>(Q_n_cols);
blas_int lwork = 0; blas_int lwork = 0;
blas_int lwork_min = (std::max)(blas_int(1), (std::max)(m,n)); // take into account requirements of geqrf() _and_ orgqr()/ungqr() blas_int lwork_min = (std::max)(blas_int(1), (std::max)(m,n)); // take into account requirements of geqrf() _and_ orgqr()/ungqr()
blas_int k = (std::min)(m,n); blas_int k = (std::min)(m,n);
blas_int info = 0; blas_int info = 0;
podarray<eT> tau( static_cast<uword>(k) ); podarray<eT> tau( static_cast<uword>(k) );
eT work_query[2]; eT work_query[2];
skipping to change at line 2049 skipping to change at line 2101
X_n_rows = A.n_rows; X_n_rows = A.n_rows;
X_n_cols = A.n_cols; X_n_cols = A.n_cols;
if(A.is_empty()) if(A.is_empty())
{ {
S.reset(); S.reset();
return true; return true;
} }
arma_debug_assert_blas_size(A);
Mat<eT> U(1, 1); Mat<eT> U(1, 1);
Mat<eT> V(1, A.n_cols); Mat<eT> V(1, A.n_cols);
char jobu = 'N'; char jobu = 'N';
char jobvt = 'N'; char jobvt = 'N';
blas_int m = A.n_rows; blas_int m = A.n_rows;
blas_int n = A.n_cols; blas_int n = A.n_cols;
blas_int min_mn = (std::min)(m,n); blas_int min_mn = (std::min)(m,n);
blas_int lda = A.n_rows; blas_int lda = A.n_rows;
skipping to change at line 2125 skipping to change at line 2179
X_n_rows = A.n_rows; X_n_rows = A.n_rows;
X_n_cols = A.n_cols; X_n_cols = A.n_cols;
if(A.is_empty()) if(A.is_empty())
{ {
S.reset(); S.reset();
return true; return true;
} }
arma_debug_assert_blas_size(A);
Mat<eT> U(1, 1); Mat<eT> U(1, 1);
Mat<eT> V(1, A.n_cols); Mat<eT> V(1, A.n_cols);
char jobu = 'N'; char jobu = 'N';
char jobvt = 'N'; char jobvt = 'N';
blas_int m = A.n_rows; blas_int m = A.n_rows;
blas_int n = A.n_cols; blas_int n = A.n_cols;
blas_int min_mn = (std::min)(m,n); blas_int min_mn = (std::min)(m,n);
blas_int lda = A.n_rows; blas_int lda = A.n_rows;
skipping to change at line 2240 skipping to change at line 2296
Mat<eT> A(X.get_ref()); Mat<eT> A(X.get_ref());
if(A.is_empty()) if(A.is_empty())
{ {
U.eye(A.n_rows, A.n_rows); U.eye(A.n_rows, A.n_rows);
S.reset(); S.reset();
V.eye(A.n_cols, A.n_cols); V.eye(A.n_cols, A.n_cols);
return true; return true;
} }
arma_debug_assert_blas_size(A);
U.set_size(A.n_rows, A.n_rows); U.set_size(A.n_rows, A.n_rows);
V.set_size(A.n_cols, A.n_cols); V.set_size(A.n_cols, A.n_cols);
char jobu = 'A'; char jobu = 'A';
char jobvt = 'A'; char jobvt = 'A';
blas_int m = blas_int(A.n_rows); blas_int m = blas_int(A.n_rows);
blas_int n = blas_int(A.n_cols); blas_int n = blas_int(A.n_cols);
blas_int min_mn = (std::min)(m,n); blas_int min_mn = (std::min)(m,n);
blas_int lda = blas_int(A.n_rows); blas_int lda = blas_int(A.n_rows);
skipping to change at line 2318 skipping to change at line 2376
Mat<eT> A(X.get_ref()); Mat<eT> A(X.get_ref());
if(A.is_empty()) if(A.is_empty())
{ {
U.eye(A.n_rows, A.n_rows); U.eye(A.n_rows, A.n_rows);
S.reset(); S.reset();
V.eye(A.n_cols, A.n_cols); V.eye(A.n_cols, A.n_cols);
return true; return true;
} }
arma_debug_assert_blas_size(A);
U.set_size(A.n_rows, A.n_rows); U.set_size(A.n_rows, A.n_rows);
V.set_size(A.n_cols, A.n_cols); V.set_size(A.n_cols, A.n_cols);
char jobu = 'A'; char jobu = 'A';
char jobvt = 'A'; char jobvt = 'A';
blas_int m = blas_int(A.n_rows); blas_int m = blas_int(A.n_rows);
blas_int n = blas_int(A.n_cols); blas_int n = blas_int(A.n_cols);
blas_int min_mn = (std::min)(m,n); blas_int min_mn = (std::min)(m,n);
blas_int lda = blas_int(A.n_rows); blas_int lda = blas_int(A.n_rows);
skipping to change at line 2404 skipping to change at line 2464
inline inline
bool bool
auxlib::svd_econ(Mat<eT>& U, Col<eT>& S, Mat<eT>& V, const Base<eT,T1>& X, const char mode) auxlib::svd_econ(Mat<eT>& U, Col<eT>& S, Mat<eT>& V, const Base<eT,T1>& X, const char mode)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
Mat<eT> A(X.get_ref()); Mat<eT> A(X.get_ref());
arma_debug_assert_blas_size(A);
blas_int m = blas_int(A.n_rows); blas_int m = blas_int(A.n_rows);
blas_int n = blas_int(A.n_cols); blas_int n = blas_int(A.n_cols);
blas_int min_mn = (std::min)(m,n); blas_int min_mn = (std::min)(m,n);
blas_int lda = blas_int(A.n_rows); blas_int lda = blas_int(A.n_rows);
S.set_size( static_cast<uword>(min_mn) ); S.set_size( static_cast<uword>(min_mn) );
blas_int ldu = 0; blas_int ldu = 0;
blas_int ldvt = 0; blas_int ldvt = 0;
skipping to change at line 2542 skipping to change at line 2604
auxlib::svd_econ(Mat< std::complex<T> >& U, Col<T>& S, Mat< std::complex<T> >& V, const Base< std::complex<T>, T1>& X, const char mode) auxlib::svd_econ(Mat< std::complex<T> >& U, Col<T>& S, Mat< std::complex<T> >& V, const Base< std::complex<T>, T1>& X, const char mode)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
typedef std::complex<T> eT; typedef std::complex<T> eT;
Mat<eT> A(X.get_ref()); Mat<eT> A(X.get_ref());
arma_debug_assert_blas_size(A);
blas_int m = blas_int(A.n_rows); blas_int m = blas_int(A.n_rows);
blas_int n = blas_int(A.n_cols); blas_int n = blas_int(A.n_cols);
blas_int min_mn = (std::min)(m,n); blas_int min_mn = (std::min)(m,n);
blas_int lda = blas_int(A.n_rows); blas_int lda = blas_int(A.n_rows);
S.set_size( static_cast<uword>(min_mn) ); S.set_size( static_cast<uword>(min_mn) );
blas_int ldu = 0; blas_int ldu = 0;
blas_int ldvt = 0; blas_int ldvt = 0;
skipping to change at line 2691 skipping to change at line 2755
X_n_rows = A.n_rows; X_n_rows = A.n_rows;
X_n_cols = A.n_cols; X_n_cols = A.n_cols;
if(A.is_empty()) if(A.is_empty())
{ {
S.reset(); S.reset();
return true; return true;
} }
arma_debug_assert_blas_size(A);
Mat<eT> U(1, 1); Mat<eT> U(1, 1);
Mat<eT> V(1, 1); Mat<eT> V(1, 1);
char jobz = 'N'; char jobz = 'N';
blas_int m = blas_int(A.n_rows); blas_int m = blas_int(A.n_rows);
blas_int n = blas_int(A.n_cols); blas_int n = blas_int(A.n_cols);
blas_int min_mn = (std::min)(m,n); blas_int min_mn = (std::min)(m,n);
blas_int lda = blas_int(A.n_rows); blas_int lda = blas_int(A.n_rows);
blas_int ldu = blas_int(U.n_rows); blas_int ldu = blas_int(U.n_rows);
skipping to change at line 2760 skipping to change at line 2826
X_n_rows = A.n_rows; X_n_rows = A.n_rows;
X_n_cols = A.n_cols; X_n_cols = A.n_cols;
if(A.is_empty()) if(A.is_empty())
{ {
S.reset(); S.reset();
return true; return true;
} }
arma_debug_assert_blas_size(A);
Mat<eT> U(1, 1); Mat<eT> U(1, 1);
Mat<eT> V(1, 1); Mat<eT> V(1, 1);
char jobz = 'N'; char jobz = 'N';
blas_int m = blas_int(A.n_rows); blas_int m = blas_int(A.n_rows);
blas_int n = blas_int(A.n_cols); blas_int n = blas_int(A.n_cols);
blas_int min_mn = (std::min)(m,n); blas_int min_mn = (std::min)(m,n);
blas_int lda = blas_int(A.n_rows); blas_int lda = blas_int(A.n_rows);
blas_int ldu = blas_int(U.n_rows); blas_int ldu = blas_int(U.n_rows);
skipping to change at line 2844 skipping to change at line 2912
Mat<eT> A(X.get_ref()); Mat<eT> A(X.get_ref());
if(A.is_empty()) if(A.is_empty())
{ {
U.eye(A.n_rows, A.n_rows); U.eye(A.n_rows, A.n_rows);
S.reset(); S.reset();
V.eye(A.n_cols, A.n_cols); V.eye(A.n_cols, A.n_cols);
return true; return true;
} }
arma_debug_assert_blas_size(A);
U.set_size(A.n_rows, A.n_rows); U.set_size(A.n_rows, A.n_rows);
V.set_size(A.n_cols, A.n_cols); V.set_size(A.n_cols, A.n_cols);
char jobz = 'A'; char jobz = 'A';
blas_int m = blas_int(A.n_rows); blas_int m = blas_int(A.n_rows);
blas_int n = blas_int(A.n_cols); blas_int n = blas_int(A.n_cols);
blas_int min_mn = (std::min)(m,n); blas_int min_mn = (std::min)(m,n);
blas_int max_mn = (std::max)(m,n); blas_int max_mn = (std::max)(m,n);
blas_int lda = blas_int(A.n_rows); blas_int lda = blas_int(A.n_rows);
skipping to change at line 2916 skipping to change at line 2986
Mat<eT> A(X.get_ref()); Mat<eT> A(X.get_ref());
if(A.is_empty()) if(A.is_empty())
{ {
U.eye(A.n_rows, A.n_rows); U.eye(A.n_rows, A.n_rows);
S.reset(); S.reset();
V.eye(A.n_cols, A.n_cols); V.eye(A.n_cols, A.n_cols);
return true; return true;
} }
arma_debug_assert_blas_size(A);
U.set_size(A.n_rows, A.n_rows); U.set_size(A.n_rows, A.n_rows);
V.set_size(A.n_cols, A.n_cols); V.set_size(A.n_cols, A.n_cols);
char jobz = 'A'; char jobz = 'A';
blas_int m = blas_int(A.n_rows); blas_int m = blas_int(A.n_rows);
blas_int n = blas_int(A.n_cols); blas_int n = blas_int(A.n_cols);
blas_int min_mn = (std::min)(m,n); blas_int min_mn = (std::min)(m,n);
blas_int max_mn = (std::max)(m,n); blas_int max_mn = (std::max)(m,n);
blas_int lda = blas_int(A.n_rows); blas_int lda = blas_int(A.n_rows);
skipping to change at line 2974 skipping to change at line 3046
inline inline
bool bool
auxlib::svd_dc_econ(Mat<eT>& U, Col<eT>& S, Mat<eT>& V, const Base<eT,T1>& X) auxlib::svd_dc_econ(Mat<eT>& U, Col<eT>& S, Mat<eT>& V, const Base<eT,T1>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
Mat<eT> A(X.get_ref()); Mat<eT> A(X.get_ref());
arma_debug_assert_blas_size(A);
char jobz = 'S'; char jobz = 'S';
blas_int m = blas_int(A.n_rows); blas_int m = blas_int(A.n_rows);
blas_int n = blas_int(A.n_cols); blas_int n = blas_int(A.n_cols);
blas_int min_mn = (std::min)(m,n); blas_int min_mn = (std::min)(m,n);
blas_int max_mn = (std::max)(m,n); blas_int max_mn = (std::max)(m,n);
blas_int lda = blas_int(A.n_rows); blas_int lda = blas_int(A.n_rows);
blas_int ldu = m; blas_int ldu = m;
blas_int ldvt = min_mn; blas_int ldvt = min_mn;
blas_int lwork1 = 3*min_mn*min_mn + (std::max)( max_mn, 4*min_mn*min_mn + 4*min_mn ); blas_int lwork1 = 3*min_mn*min_mn + (std::max)( max_mn, 4*min_mn*min_mn + 4*min_mn );
skipping to change at line 3047 skipping to change at line 3121
arma_extra_debug_print("auxlib::svd_dc_econ(): redirecting to auxlib::s vd_econ(), as use of lapack::cx_gesdd() is disabled"); arma_extra_debug_print("auxlib::svd_dc_econ(): redirecting to auxlib::s vd_econ(), as use of lapack::cx_gesdd() is disabled");
return auxlib::svd_econ(U, S, V, X, 'b'); return auxlib::svd_econ(U, S, V, X, 'b');
} }
#elif defined(ARMA_USE_LAPACK) #elif defined(ARMA_USE_LAPACK)
{ {
typedef std::complex<T> eT; typedef std::complex<T> eT;
Mat<eT> A(X.get_ref()); Mat<eT> A(X.get_ref());
arma_debug_assert_blas_size(A);
char jobz = 'S'; char jobz = 'S';
blas_int m = blas_int(A.n_rows); blas_int m = blas_int(A.n_rows);
blas_int n = blas_int(A.n_cols); blas_int n = blas_int(A.n_cols);
blas_int min_mn = (std::min)(m,n); blas_int min_mn = (std::min)(m,n);
blas_int max_mn = (std::max)(m,n); blas_int max_mn = (std::max)(m,n);
blas_int lda = blas_int(A.n_rows); blas_int lda = blas_int(A.n_rows);
blas_int ldu = m; blas_int ldu = m;
blas_int ldvt = min_mn; blas_int ldvt = min_mn;
blas_int lwork = 2 * (min_mn*min_mn + 2*min_mn + max_mn); blas_int lwork = 2 * (min_mn*min_mn + 2*min_mn + max_mn);
skipping to change at line 3163 skipping to change at line 3239
arma_debug_check( (A_n_rows != B_n_rows), "solve(): number of rows in t he given objects must be the same" ); arma_debug_check( (A_n_rows != B_n_rows), "solve(): number of rows in t he given objects must be the same" );
if(A.is_empty() || out.is_empty()) if(A.is_empty() || out.is_empty())
{ {
out.zeros(A.n_cols, B_n_cols); out.zeros(A.n_cols, B_n_cols);
return true; return true;
} }
#if defined(ARMA_USE_ATLAS) #if defined(ARMA_USE_ATLAS)
{ {
arma_debug_assert_atlas_size(A);
podarray<int> ipiv(A_n_rows + 2); // +2 for paranoia: old versions o f Atlas might be trashing memory podarray<int> ipiv(A_n_rows + 2); // +2 for paranoia: old versions o f Atlas might be trashing memory
int info = atlas::clapack_gesv<eT>(atlas::CblasColMajor, A_n_rows, B_ n_cols, A.memptr(), A_n_rows, ipiv.memptr(), out.memptr(), A_n_rows); int info = atlas::clapack_gesv<eT>(atlas::CblasColMajor, A_n_rows, B_ n_cols, A.memptr(), A_n_rows, ipiv.memptr(), out.memptr(), A_n_rows);
return (info == 0); return (info == 0);
} }
#elif defined(ARMA_USE_LAPACK) #elif defined(ARMA_USE_LAPACK)
{ {
arma_debug_assert_blas_size(A);
blas_int n = blas_int(A_n_rows); // assuming A is square blas_int n = blas_int(A_n_rows); // assuming A is square
blas_int lda = blas_int(A_n_rows); blas_int lda = blas_int(A_n_rows);
blas_int ldb = blas_int(A_n_rows); blas_int ldb = blas_int(A_n_rows);
blas_int nrhs = blas_int(B_n_cols); blas_int nrhs = blas_int(B_n_cols);
blas_int info = 0; blas_int info = 0;
podarray<blas_int> ipiv(A_n_rows + 2); // +2 for paranoia: some vers ions of Lapack might be trashing memory podarray<blas_int> ipiv(A_n_rows + 2); // +2 for paranoia: some vers ions of Lapack might be trashing memory
arma_extra_debug_print("lapack::gesv()"); arma_extra_debug_print("lapack::gesv()");
lapack::gesv<eT>(&n, &nrhs, A.memptr(), &lda, ipiv.memptr(), out.memp tr(), &ldb, &info); lapack::gesv<eT>(&n, &nrhs, A.memptr(), &lda, ipiv.memptr(), out.memp tr(), &ldb, &info);
skipping to change at line 3226 skipping to change at line 3306
arma_debug_check( (A_n_rows != B_n_rows), "solve(): number of rows in t he given objects must be the same" ); arma_debug_check( (A_n_rows != B_n_rows), "solve(): number of rows in t he given objects must be the same" );
out.set_size(A_n_cols, B_n_cols); out.set_size(A_n_cols, B_n_cols);
if(A.is_empty() || tmp.is_empty()) if(A.is_empty() || tmp.is_empty())
{ {
out.zeros(); out.zeros();
return true; return true;
} }
arma_debug_assert_blas_size(A,tmp);
char trans = 'N'; char trans = 'N';
blas_int m = blas_int(A_n_rows); blas_int m = blas_int(A_n_rows);
blas_int n = blas_int(A_n_cols); blas_int n = blas_int(A_n_cols);
blas_int lda = blas_int(A_n_rows); blas_int lda = blas_int(A_n_rows);
blas_int ldb = blas_int(A_n_rows); blas_int ldb = blas_int(A_n_rows);
blas_int nrhs = blas_int(B_n_cols); blas_int nrhs = blas_int(B_n_cols);
blas_int lwork = 3 * ( (std::max)(blas_int(1), n + (std::max)(n, nrhs) ) ); blas_int lwork = 3 * ( (std::max)(blas_int(1), n + (std::max)(n, nrhs) ) );
blas_int info = 0; blas_int info = 0;
skipping to change at line 3295 skipping to change at line 3377
arma_debug_check( (A_n_rows != B_n_rows), "solve(): number of rows in t he given objects must be the same" ); arma_debug_check( (A_n_rows != B_n_rows), "solve(): number of rows in t he given objects must be the same" );
// B could be an alias of "out", hence we need to check whether B is em pty before setting the size of "out" // B could be an alias of "out", hence we need to check whether B is em pty before setting the size of "out"
if(A.is_empty() || B.is_empty()) if(A.is_empty() || B.is_empty())
{ {
out.zeros(A_n_cols, B_n_cols); out.zeros(A_n_cols, B_n_cols);
return true; return true;
} }
arma_debug_assert_blas_size(A,B);
char trans = 'N'; char trans = 'N';
blas_int m = blas_int(A_n_rows); blas_int m = blas_int(A_n_rows);
blas_int n = blas_int(A_n_cols); blas_int n = blas_int(A_n_cols);
blas_int lda = blas_int(A_n_rows); blas_int lda = blas_int(A_n_rows);
blas_int ldb = blas_int(A_n_cols); blas_int ldb = blas_int(A_n_cols);
blas_int nrhs = blas_int(B_n_cols); blas_int nrhs = blas_int(B_n_cols);
blas_int lwork = 3 * ( (std::max)(blas_int(1), m + (std::max)(m,nrhs)) ); blas_int lwork = 3 * ( (std::max)(blas_int(1), m + (std::max)(m,nrhs)) );
blas_int info = 0; blas_int info = 0;
skipping to change at line 3366 skipping to change at line 3450
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
if(A.is_empty() || B.is_empty()) if(A.is_empty() || B.is_empty())
{ {
out.zeros(A.n_cols, B.n_cols); out.zeros(A.n_cols, B.n_cols);
return true; return true;
} }
arma_debug_assert_blas_size(A,B);
out = B; out = B;
char uplo = (layout == 0) ? 'U' : 'L'; char uplo = (layout == 0) ? 'U' : 'L';
char trans = 'N'; char trans = 'N';
char diag = 'N'; char diag = 'N';
blas_int n = blas_int(A.n_rows); blas_int n = blas_int(A.n_rows);
blas_int nrhs = blas_int(B.n_cols); blas_int nrhs = blas_int(B.n_cols);
blas_int info = 0; blas_int info = 0;
lapack::trtrs<eT>(&uplo, &trans, &diag, &n, &nrhs, A.memptr(), &n, out. memptr(), &n, &info); lapack::trtrs<eT>(&uplo, &trans, &diag, &n, &nrhs, A.memptr(), &n, out. memptr(), &n, &info);
skipping to change at line 3412 skipping to change at line 3498
{ {
arma_debug_check( (A.is_square() == false), "schur_dec(): given matrix is not square" ); arma_debug_check( (A.is_square() == false), "schur_dec(): given matrix is not square" );
if(A.is_empty()) if(A.is_empty())
{ {
Z.reset(); Z.reset();
T.reset(); T.reset();
return true; return true;
} }
arma_debug_assert_blas_size(A);
const uword A_n_rows = A.n_rows; const uword A_n_rows = A.n_rows;
Z.set_size(A_n_rows, A_n_rows); Z.set_size(A_n_rows, A_n_rows);
T = A; T = A;
char jobvs = 'V'; // get Schur vectors (Z) char jobvs = 'V'; // get Schur vectors (Z)
char sort = 'N'; // do not sort eigenvalues/vecto rs char sort = 'N'; // do not sort eigenvalues/vecto rs
blas_int* select = 0; // pointer to sorting function blas_int* select = 0; // pointer to sorting function
blas_int n = blas_int(A_n_rows); blas_int n = blas_int(A_n_rows);
blas_int sdim = 0; // output for sorting blas_int sdim = 0; // output for sorting
skipping to change at line 3465 skipping to change at line 3553
{ {
arma_debug_check( (A.is_square() == false), "schur_dec(): matrix A is n ot square" ); arma_debug_check( (A.is_square() == false), "schur_dec(): matrix A is n ot square" );
if(A.is_empty()) if(A.is_empty())
{ {
Z.reset(); Z.reset();
T.reset(); T.reset();
return true; return true;
} }
arma_debug_assert_blas_size(A);
typedef std::complex<cT> eT; typedef std::complex<cT> eT;
const uword A_n_rows = A.n_rows; const uword A_n_rows = A.n_rows;
Z.set_size(A_n_rows, A_n_rows); Z.set_size(A_n_rows, A_n_rows);
T = A; T = A;
char jobvs = 'V'; // get Schur vectors (Z) char jobvs = 'V'; // get Schur vectors (Z)
char sort = 'N'; // do not sort eigenvalues/vect ors char sort = 'N'; // do not sort eigenvalues/vect ors
blas_int* select = 0; // pointer to sorting function blas_int* select = 0; // pointer to sorting function
 End of changes. 44 change blocks. 
2 lines changed or deleted 94 lines changed or added


 compiler_setup.hpp   compiler_setup.hpp 
skipping to change at line 50 skipping to change at line 50
#if defined(ARMA_BLAS_UNDERSCORE) #if defined(ARMA_BLAS_UNDERSCORE)
#define arma_fortran2_noprefix(function) function##_ #define arma_fortran2_noprefix(function) function##_
#define arma_fortran2_prefix(function) wrapper_##function##_ #define arma_fortran2_prefix(function) wrapper_##function##_
#else #else
#define arma_fortran2_noprefix(function) function #define arma_fortran2_noprefix(function) function
#define arma_fortran2_prefix(function) wrapper_##function #define arma_fortran2_prefix(function) wrapper_##function
#endif #endif
#if defined(ARMA_USE_WRAPPER) #if defined(ARMA_USE_WRAPPER)
#define arma_fortran(function) arma_fortran2_prefix(function) #define arma_fortran(function) arma_fortran2_prefix(function)
#define arma_atlas(function) wrapper_##function #define arma_wrapper(function) wrapper_##function
#else #else
#define arma_fortran(function) arma_fortran2_noprefix(function) #define arma_fortran(function) arma_fortran2_noprefix(function)
#define arma_atlas(function) function #define arma_wrapper(function) function
#endif #endif
#define arma_fortran_prefix(function) arma_fortran2_prefix(function) #define arma_fortran_prefix(function) arma_fortran2_prefix(function)
#define arma_fortran_noprefix(function) arma_fortran2_noprefix(function) #define arma_fortran_noprefix(function) arma_fortran2_noprefix(function)
#undef ARMA_INCFILE_WRAP #undef ARMA_INCFILE_WRAP
#define ARMA_INCFILE_WRAP(x) <x> #define ARMA_INCFILE_WRAP(x) <x>
#if defined(__CYGWIN__)
#if defined(ARMA_USE_CXX11)
#undef ARMA_USE_CXX11
#undef ARMA_USE_EXTERN_CXX11_RNG
#pragma message ("WARNING: disabled use of C++11 features in Armadillo,
due to incomplete support for C++11 by Cygwin")
#endif
#endif
#if defined(ARMA_USE_CXX11) #if defined(ARMA_USE_CXX11)
#undef ARMA_USE_U64S64 #undef ARMA_USE_U64S64
#define ARMA_USE_U64S64 #define ARMA_USE_U64S64
#if !defined(ARMA_32BIT_WORD)
#undef ARMA_64BIT_WORD
#define ARMA_64BIT_WORD
#endif
#endif #endif
#if defined(ARMA_64BIT_WORD) #if defined(ARMA_64BIT_WORD)
#undef ARMA_USE_U64S64 #undef ARMA_USE_U64S64
#define ARMA_USE_U64S64 #define ARMA_USE_U64S64
#endif #endif
#undef ARMA_HAVE_GETTIMEOFDAY #undef ARMA_HAVE_GETTIMEOFDAY
#undef ARMA_HAVE_SNPRINTF #undef ARMA_HAVE_SNPRINTF
#undef ARMA_HAVE_ISFINITE #undef ARMA_HAVE_ISFINITE
 End of changes. 4 change blocks. 
2 lines changed or deleted 16 lines changed or added


 config.hpp   config.hpp 
// Copyright (C) 2008-2015 Conrad Sanderson // Copyright (C) 2008-2015 Conrad Sanderson
// Copyright (C) 2013 Ryan Curtin // Copyright (C) 2013-2015 Ryan Curtin
// Copyright (C) 2008-2015 NICTA (www.nicta.com.au) // Copyright (C) 2008-2015 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#if !defined(ARMA_USE_LAPACK) #if !defined(ARMA_USE_LAPACK)
#define ARMA_USE_LAPACK #define ARMA_USE_LAPACK
//// Comment out the above line if you don't have LAPACK or a high-speed re placement for LAPACK, //// Comment out the above line if you don't have LAPACK or a high-speed re placement for LAPACK,
//// such as Intel MKL, AMD ACML, or the Accelerate framework. //// such as Intel MKL, AMD ACML, or the Accelerate framework.
skipping to change at line 27 skipping to change at line 27
#define ARMA_USE_BLAS #define ARMA_USE_BLAS
//// Comment out the above line if you don't have BLAS or a high-speed repl acement for BLAS, //// Comment out the above line if you don't have BLAS or a high-speed repl acement for BLAS,
//// such as OpenBLAS, GotoBLAS, Intel MKL, AMD ACML, or the Accelerate fra mework. //// such as OpenBLAS, GotoBLAS, Intel MKL, AMD ACML, or the Accelerate fra mework.
//// BLAS is used for matrix multiplication. //// BLAS is used for matrix multiplication.
//// Without BLAS, matrix multiplication will still work, but might be slow er. //// Without BLAS, matrix multiplication will still work, but might be slow er.
#endif #endif
#if !defined(ARMA_USE_ARPACK) #if !defined(ARMA_USE_ARPACK)
/* #undef ARMA_USE_ARPACK */ /* #undef ARMA_USE_ARPACK */
//// Uncomment the above line if you have ARPACK or a high-speed replacemen t for ARPACK. //// Uncomment the above line if you have ARPACK or a high-speed replacemen t for ARPACK.
//// ARPACK is required for eigendecompositions of sparse matrices, eg. eig //// ARPACK is required for eigendecompositions of sparse matrices, eg. eig
s_sym() s_sym(), svds()
#endif
#if !defined(ARMA_USE_SUPERLU)
/* #undef ARMA_USE_SUPERLU */
//// Uncomment the above line if you have SuperLU.
//// SuperLU is used for solving sparse linear systems via spsolve()
//// Caveat: only SuperLU version 4.3 can be used!
#endif
#if !defined(ARMA_SUPERLU_INCLUDE_DIR)
#define ARMA_SUPERLU_INCLUDE_DIR /
//// If you're using SuperLU and want to explicitly include the SuperLU hea
ders,
//// uncomment the above define and specify the appropriate include directo
ry.
//// Make sure the directory has a trailing /
#endif #endif
#define ARMA_USE_WRAPPER #define ARMA_USE_WRAPPER
//// Comment out the above line if you're getting linking errors when compi ling your programs, //// Comment out the above line if you're getting linking errors when compi ling your programs,
//// or if you prefer to directly link with LAPACK, BLAS or ARPACK instead of the Armadillo runtime library. //// or if you prefer to directly link with LAPACK, BLAS + etc instead of t he Armadillo runtime library.
//// You will then need to link your programs directly with -llapack -lblas instead of -larmadillo //// You will then need to link your programs directly with -llapack -lblas instead of -larmadillo
// #define ARMA_BLAS_CAPITALS // #define ARMA_BLAS_CAPITALS
//// Uncomment the above line if your BLAS and LAPACK libraries have capita lised function names (eg. ACML on 64-bit Windows) //// Uncomment the above line if your BLAS and LAPACK libraries have capita lised function names (eg. ACML on 64-bit Windows)
#define ARMA_BLAS_UNDERSCORE #define ARMA_BLAS_UNDERSCORE
//// Uncomment the above line if your BLAS and LAPACK libraries have functi on names with a trailing underscore. //// Uncomment the above line if your BLAS and LAPACK libraries have functi on names with a trailing underscore.
//// Conversely, comment it out if the function names don't have a trailing underscore. //// Conversely, comment it out if the function names don't have a trailing underscore.
// #define ARMA_BLAS_LONG // #define ARMA_BLAS_LONG
skipping to change at line 60 skipping to change at line 74
// #define ARMA_USE_MKL_ALLOC // #define ARMA_USE_MKL_ALLOC
//// Uncomment the above line if you want to use Intel MKL mkl_malloc() and mkl_free() instead of standard malloc() and free() //// Uncomment the above line if you want to use Intel MKL mkl_malloc() and mkl_free() instead of standard malloc() and free()
#define ARMA_USE_ATLAS #define ARMA_USE_ATLAS
#define ARMA_ATLAS_INCLUDE_DIR /usr/include/ #define ARMA_ATLAS_INCLUDE_DIR /usr/include/
//// If you're using ATLAS and the compiler can't find cblas.h and/or clapa ck.h //// If you're using ATLAS and the compiler can't find cblas.h and/or clapa ck.h
//// uncomment the above define and specify the appropriate include directo ry. //// uncomment the above define and specify the appropriate include directo ry.
//// Make sure the directory has a trailing / //// Make sure the directory has a trailing /
#if !defined(ARMA_64BIT_WORD)
// #define ARMA_64BIT_WORD
//// Uncomment the above line if you require matrices/vectors capable of ho
lding more than 4 billion elements.
//// Your machine and compiler must have support for 64 bit integers (eg. v
ia "long" or "long long")
#endif
#if !defined(ARMA_USE_CXX11) #if !defined(ARMA_USE_CXX11)
// #define ARMA_USE_CXX11 // #define ARMA_USE_CXX11
//// Uncomment the above line if you have a C++ compiler that supports the //// Uncomment the above line to forcefully enable use of C++11 features (e
C++11 standard g. initialiser lists).
//// This will enable additional features, such as use of initialiser lists //// Note that ARMA_USE_CXX11 is automatically enabled when a C++11 compile
#endif r is detected
#if (__cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__)
#undef ARMA_USE_CXX11
#define ARMA_USE_CXX11
#endif #endif
#if !defined(ARMA_USE_U64S64) #if !defined(ARMA_64BIT_WORD)
// #define ARMA_USE_U64S64 // #define ARMA_64BIT_WORD
//// Uncomment the above line if you require u64 and s64 integer types. //// Uncomment the above line if you require matrices/vectors capable of ho
//// Your machine and compiler must have support for 64 bit integers (eg. v lding more than 4 billion elements.
ia "long" or "long long"). //// Your machine and compiler must have support for 64 bit integers (eg. v
//// Note that ARMA_USE_U64S64 is automatically enabled when ARMA_64BIT_WOR ia "long" or "long long")
D or ARMA_USE_CXX11 are enabled //// Note that ARMA_64BIT_WORD is automatically enabled when a C++11 compil
er is detected
#endif #endif
#if !defined(ARMA_USE_HDF5) #if !defined(ARMA_USE_HDF5)
// #define ARMA_USE_HDF5 // #define ARMA_USE_HDF5
//// Uncomment the above line to allow the ability to save and load matrice s stored in HDF5 format; //// Uncomment the above line to allow the ability to save and load matrice s stored in HDF5 format;
//// the hdf5.h header file must be available on your system, //// the hdf5.h header file must be available on your system,
//// and you will need to link with the hdf5 library (eg. -lhdf5) //// and you will need to link with the hdf5 library (eg. -lhdf5)
#endif #endif
/* #undef ARMA_USE_HDF5_ALT */ /* #undef ARMA_USE_HDF5_ALT */
skipping to change at line 149 skipping to change at line 152
#endif #endif
#if defined(ARMA_DONT_USE_BLAS) #if defined(ARMA_DONT_USE_BLAS)
#undef ARMA_USE_BLAS #undef ARMA_USE_BLAS
#endif #endif
#if defined(ARMA_DONT_USE_ARPACK) #if defined(ARMA_DONT_USE_ARPACK)
#undef ARMA_USE_ARPACK #undef ARMA_USE_ARPACK
#endif #endif
#if defined(ARMA_DONT_USE_SUPERLU)
#undef ARMA_USE_SUPERLU
#undef ARMA_SUPERLU_INCLUDE_DIR
#endif
#if defined(ARMA_DONT_USE_ATLAS) #if defined(ARMA_DONT_USE_ATLAS)
#undef ARMA_USE_ATLAS #undef ARMA_USE_ATLAS
#undef ARMA_ATLAS_INCLUDE_DIR #undef ARMA_ATLAS_INCLUDE_DIR
#endif #endif
#if defined(ARMA_DONT_USE_WRAPPER) #if defined(ARMA_DONT_USE_WRAPPER)
#undef ARMA_USE_WRAPPER #undef ARMA_USE_WRAPPER
#undef ARMA_USE_HDF5_ALT #undef ARMA_USE_HDF5_ALT
#endif #endif
skipping to change at line 176 skipping to change at line 184
#if !defined(ARMA_USE_EXTERN_CXX11_RNG) #if !defined(ARMA_USE_EXTERN_CXX11_RNG)
/* #undef ARMA_USE_EXTERN_CXX11_RNG */ /* #undef ARMA_USE_EXTERN_CXX11_RNG */
#endif #endif
#endif #endif
#endif #endif
#if defined(ARMA_DONT_USE_EXTERN_CXX11_RNG) #if defined(ARMA_DONT_USE_EXTERN_CXX11_RNG)
#undef ARMA_USE_EXTERN_CXX11_RNG #undef ARMA_USE_EXTERN_CXX11_RNG
#endif #endif
#if defined(ARMA_32BIT_WORD)
#undef ARMA_64BIT_WORD
#endif
#if defined(ARMA_DONT_USE_HDF5) #if defined(ARMA_DONT_USE_HDF5)
#undef ARMA_USE_HDF5 #undef ARMA_USE_HDF5
#endif #endif
 End of changes. 8 change blocks. 
27 lines changed or deleted 41 lines changed or added


 debug.hpp   debug.hpp 
// Copyright (C) 2008-2014 Conrad Sanderson // Copyright (C) 2008-2015 Conrad Sanderson
// Copyright (C) 2008-2014 NICTA (www.nicta.com.au) // Copyright (C) 2008-2015 NICTA (www.nicta.com.au)
// Copyright (C) 2011 Stanislav Funiak // Copyright (C) 2011 Stanislav Funiak
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup debug //! \addtogroup debug
//! @{ //! @{
template<typename T> template<typename T>
skipping to change at line 959 skipping to change at line 959
inline inline
void void
arma_assert_mul_size(const subview<eT1>& A, const subview<eT2>& B, const ch ar* x) arma_assert_mul_size(const subview<eT1>& A, const subview<eT2>& B, const ch ar* x)
{ {
if(A.n_cols != B.n_rows) if(A.n_cols != B.n_rows)
{ {
arma_stop( arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_ cols, x) ); arma_stop( arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_ cols, x) );
} }
} }
template<typename T1>
arma_hot
inline
void
arma_assert_blas_size(const T1& A)
{
if(sizeof(uword) >= sizeof(blas_int))
{
bool overflow;
overflow = (A.n_rows > ARMA_MAX_BLAS_INT);
overflow = (A.n_cols > ARMA_MAX_BLAS_INT) || overflow;
if(overflow)
{
arma_bad("integer overflow: matrix dimensions are too large for integ
er type used by BLAS and LAPACK");
}
}
}
template<typename T1, typename T2>
arma_hot
inline
void
arma_assert_blas_size(const T1& A, const T2& B)
{
if(sizeof(uword) >= sizeof(blas_int))
{
bool overflow;
overflow = (A.n_rows > ARMA_MAX_BLAS_INT);
overflow = (A.n_cols > ARMA_MAX_BLAS_INT) || overflow;
overflow = (B.n_rows > ARMA_MAX_BLAS_INT) || overflow;
overflow = (B.n_cols > ARMA_MAX_BLAS_INT) || overflow;
if(overflow)
{
arma_bad("integer overflow: matrix dimensions are too large for integ
er type used by BLAS and LAPACK");
}
}
}
template<typename T1>
arma_hot
inline
void
arma_assert_atlas_size(const T1& A)
{
if(sizeof(uword) >= sizeof(int))
{
bool overflow;
overflow = (A.n_rows > INT_MAX);
overflow = (A.n_cols > INT_MAX) || overflow;
if(overflow)
{
arma_bad("integer overflow: matrix dimensions are too large for integ
er type used by ATLAS");
}
}
}
template<typename T1, typename T2>
arma_hot
inline
void
arma_assert_atlas_size(const T1& A, const T2& B)
{
if(sizeof(uword) >= sizeof(int))
{
bool overflow;
overflow = (A.n_rows > INT_MAX);
overflow = (A.n_cols > INT_MAX) || overflow;
overflow = (B.n_rows > INT_MAX) || overflow;
overflow = (B.n_cols > INT_MAX) || overflow;
if(overflow)
{
arma_bad("integer overflow: matrix dimensions are too large for integ
er type used by ATLAS");
}
}
}
// //
// macros // macros
// #define ARMA_STRING1(x) #x // #define ARMA_STRING1(x) #x
// #define ARMA_STRING2(x) ARMA_STRING1(x) // #define ARMA_STRING2(x) ARMA_STRING1(x)
// #define ARMA_FILELINE __FILE__ ": " ARMA_STRING2(__LINE__) // #define ARMA_FILELINE __FILE__ ": " ARMA_STRING2(__LINE__)
#if defined(ARMA_NO_DEBUG) #if defined(ARMA_NO_DEBUG)
#undef ARMA_EXTRA_DEBUG #undef ARMA_EXTRA_DEBUG
#define arma_debug_print true ? (void)0 : arma_print #define arma_debug_print true ? (void)0 : arma_print
#define arma_debug_warn true ? (void)0 : arma_warn #define arma_debug_warn true ? (void)0 : arma_warn
#define arma_debug_check true ? (void)0 : arma_check #define arma_debug_check true ? (void)0 : arma_check
#define arma_debug_set_error true ? (void)0 : arma_set_error #define arma_debug_set_error true ? (void)0 : arma_set_erro
#define arma_debug_assert_same_size true ? (void)0 : arma_assert_sam r
e_size #define arma_debug_assert_same_size true ? (void)0 : arma_assert_s
#define arma_debug_assert_mul_size true ? (void)0 : arma_assert_mul ame_size
_size #define arma_debug_assert_mul_size true ? (void)0 : arma_assert_m
#define arma_debug_assert_trans_mul_size true ? (void)0 : arma_assert_tra ul_size
ns_mul_size #define arma_debug_assert_trans_mul_size true ? (void)0 : arma_assert_t
#define arma_debug_assert_cube_as_mat true ? (void)0 : arma_assert_cub rans_mul_size
e_as_mat #define arma_debug_assert_cube_as_mat true ? (void)0 : arma_assert_c
ube_as_mat
#define arma_debug_assert_blas_size true ? (void)0 : arma_assert_b
las_size
#define arma_debug_assert_atlas_size true ? (void)0 : arma_assert_a
tlas_size
#else #else
#define arma_debug_print arma_print #define arma_debug_print arma_print
#define arma_debug_warn arma_warn #define arma_debug_warn arma_warn
#define arma_debug_check arma_check #define arma_debug_check arma_check
#define arma_debug_set_error arma_set_error #define arma_debug_set_error arma_set_error
#define arma_debug_assert_same_size arma_assert_same_size #define arma_debug_assert_same_size arma_assert_same_size
#define arma_debug_assert_mul_size arma_assert_mul_size #define arma_debug_assert_mul_size arma_assert_mul_size
#define arma_debug_assert_trans_mul_size arma_assert_trans_mul_size #define arma_debug_assert_trans_mul_size arma_assert_trans_mul_size
#define arma_debug_assert_cube_as_mat arma_assert_cube_as_mat #define arma_debug_assert_cube_as_mat arma_assert_cube_as_mat
#define arma_debug_assert_blas_size arma_assert_blas_size
#define arma_debug_assert_atlas_size arma_assert_atlas_size
#endif #endif
#if defined(ARMA_EXTRA_DEBUG) #if defined(ARMA_EXTRA_DEBUG)
#define arma_extra_debug_sigprint arma_sigprint(ARMA_FNSIG); arma_b ktprint #define arma_extra_debug_sigprint arma_sigprint(ARMA_FNSIG); arma_b ktprint
#define arma_extra_debug_sigprint_this arma_sigprint(ARMA_FNSIG); arma_t hisprint #define arma_extra_debug_sigprint_this arma_sigprint(ARMA_FNSIG); arma_t hisprint
#define arma_extra_debug_print arma_print #define arma_extra_debug_print arma_print
#define arma_extra_debug_warn arma_warn #define arma_extra_debug_warn arma_warn
#define arma_extra_debug_check arma_check #define arma_extra_debug_check arma_check
skipping to change at line 1045 skipping to change at line 1133
out << "@ Armadillo " out << "@ Armadillo "
<< arma_version::major << '.' << arma_version::minor << '.' << arma_version::patch << arma_version::major << '.' << arma_version::minor << '.' << arma_version::patch
<< " (" << nickname << ")\n"; << " (" << nickname << ")\n";
out << "@ arma_config::use_wrapper = " << arma_config::use_wrapper << '\n'; out << "@ arma_config::use_wrapper = " << arma_config::use_wrapper << '\n';
out << "@ arma_config::use_cxx11 = " << arma_config::use_cxx11 << '\n'; out << "@ arma_config::use_cxx11 = " << arma_config::use_cxx11 << '\n';
out << "@ arma_config::openmp = " << arma_config::openmp << '\n'; out << "@ arma_config::openmp = " << arma_config::openmp << '\n';
out << "@ arma_config::lapack = " << arma_config::lapack << '\n'; out << "@ arma_config::lapack = " << arma_config::lapack << '\n';
out << "@ arma_config::blas = " << arma_config::blas << '\n'; out << "@ arma_config::blas = " << arma_config::blas << '\n';
out << "@ arma_config::arpack = " << arma_config::arpack << '\n'; out << "@ arma_config::arpack = " << arma_config::arpack << '\n';
out << "@ arma_config::superlu = " << arma_config::superlu << '\n';
out << "@ arma_config::atlas = " << arma_config::atlas << '\n'; out << "@ arma_config::atlas = " << arma_config::atlas << '\n';
out << "@ arma_config::hdf5 = " << arma_config::hdf5 << '\n'; out << "@ arma_config::hdf5 = " << arma_config::hdf5 << '\n';
out << "@ arma_config::good_comp = " << arma_config::good_comp << '\n'; out << "@ arma_config::good_comp = " << arma_config::good_comp << '\n';
out << "@ arma_config::extra_code = " << arma_config::extra_code << '\n'; out << "@ arma_config::extra_code = " << arma_config::extra_code << '\n';
out << "@ arma_config::mat_prealloc = " << arma_config::mat_preallo c << '\n'; out << "@ arma_config::mat_prealloc = " << arma_config::mat_preallo c << '\n';
out << "@ sizeof(void*) = " << sizeof(void*) << '\n'; out << "@ sizeof(void*) = " << sizeof(void*) << '\n';
out << "@ sizeof(uword) = " << sizeof(uword) << '\n';
out << "@ sizeof(int) = " << sizeof(int) << '\n'; out << "@ sizeof(int) = " << sizeof(int) << '\n';
out << "@ sizeof(long) = " << sizeof(long) << '\n'; out << "@ sizeof(long) = " << sizeof(long) << '\n';
out << "@ sizeof(uword) = " << sizeof(uword) << '\n';
out << "@ sizeof(blas_int) = " << sizeof(blas_int) << '\n'; out << "@ sizeof(blas_int) = " << sizeof(blas_int) << '\n';
out << "@ little_endian = " << little_endian << '\n'; out << "@ little_endian = " << little_endian << '\n';
out << "@ ---" << std::endl; out << "@ ---" << std::endl;
} }
}; };
static arma_first_extra_debug_message arma_first_extra_debug_message_ru n; static arma_first_extra_debug_message arma_first_extra_debug_message_ru n;
} }
 End of changes. 7 change blocks. 
15 lines changed or deleted 111 lines changed or added


 diagview_meat.hpp   diagview_meat.hpp 
skipping to change at line 174 skipping to change at line 174
Mat<eT>& d_m = const_cast< Mat<eT>& >(d.m); Mat<eT>& d_m = const_cast< Mat<eT>& >(d.m);
const uword d_n_elem = d.n_elem; const uword d_n_elem = d.n_elem;
const uword d_row_offset = d.row_offset; const uword d_row_offset = d.row_offset;
const uword d_col_offset = d.col_offset; const uword d_col_offset = d.col_offset;
const Proxy<T1> P( o.get_ref() ); const Proxy<T1> P( o.get_ref() );
arma_debug_check arma_debug_check
( (
( (d.n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_co ls() != 1)) ), ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_co ls() != 1)) ),
"diagview: given object has incompatible size" "diagview: given object has incompatible size"
); );
const bool is_alias = P.is_alias(d_m); const bool is_alias = P.is_alias(d_m);
arma_extra_debug_warn(is_alias, "aliasing detected"); arma_extra_debug_warn(is_alias, "aliasing detected");
if( (is_Mat<typename Proxy<T1>::stored_type>::value == true) || (Proxy<T1 >::prefer_at_accessor == true) || (is_alias == true) ) if( (is_Mat<typename Proxy<T1>::stored_type>::value == true) || (Proxy<T1 >::prefer_at_accessor == true) || (is_alias == true) )
{ {
const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, is_alias); const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, is_alias);
skipping to change at line 245 skipping to change at line 245
Mat<eT>& d_m = const_cast< Mat<eT>& >(d.m); Mat<eT>& d_m = const_cast< Mat<eT>& >(d.m);
const uword d_n_elem = d.n_elem; const uword d_n_elem = d.n_elem;
const uword d_row_offset = d.row_offset; const uword d_row_offset = d.row_offset;
const uword d_col_offset = d.col_offset; const uword d_col_offset = d.col_offset;
const Proxy<T1> P( o.get_ref() ); const Proxy<T1> P( o.get_ref() );
arma_debug_check arma_debug_check
( (
( (d.n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_co ls() != 1)) ), ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_co ls() != 1)) ),
"diagview: given object has incompatible size" "diagview: given object has incompatible size"
); );
const bool is_alias = P.is_alias(d_m); const bool is_alias = P.is_alias(d_m);
arma_extra_debug_warn(is_alias, "aliasing detected"); arma_extra_debug_warn(is_alias, "aliasing detected");
if( (is_Mat<typename Proxy<T1>::stored_type>::value == true) || (Proxy<T1 >::prefer_at_accessor == true) || (is_alias == true) ) if( (is_Mat<typename Proxy<T1>::stored_type>::value == true) || (Proxy<T1 >::prefer_at_accessor == true) || (is_alias == true) )
{ {
const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, is_alias); const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, is_alias);
skipping to change at line 316 skipping to change at line 316
Mat<eT>& d_m = const_cast< Mat<eT>& >(d.m); Mat<eT>& d_m = const_cast< Mat<eT>& >(d.m);
const uword d_n_elem = d.n_elem; const uword d_n_elem = d.n_elem;
const uword d_row_offset = d.row_offset; const uword d_row_offset = d.row_offset;
const uword d_col_offset = d.col_offset; const uword d_col_offset = d.col_offset;
const Proxy<T1> P( o.get_ref() ); const Proxy<T1> P( o.get_ref() );
arma_debug_check arma_debug_check
( (
( (d.n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_co ls() != 1)) ), ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_co ls() != 1)) ),
"diagview: given object has incompatible size" "diagview: given object has incompatible size"
); );
const bool is_alias = P.is_alias(d_m); const bool is_alias = P.is_alias(d_m);
arma_extra_debug_warn(is_alias, "aliasing detected"); arma_extra_debug_warn(is_alias, "aliasing detected");
if( (is_Mat<typename Proxy<T1>::stored_type>::value == true) || (Proxy<T1 >::prefer_at_accessor == true) || (is_alias == true) ) if( (is_Mat<typename Proxy<T1>::stored_type>::value == true) || (Proxy<T1 >::prefer_at_accessor == true) || (is_alias == true) )
{ {
const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, is_alias); const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, is_alias);
skipping to change at line 387 skipping to change at line 387
Mat<eT>& d_m = const_cast< Mat<eT>& >(d.m); Mat<eT>& d_m = const_cast< Mat<eT>& >(d.m);
const uword d_n_elem = d.n_elem; const uword d_n_elem = d.n_elem;
const uword d_row_offset = d.row_offset; const uword d_row_offset = d.row_offset;
const uword d_col_offset = d.col_offset; const uword d_col_offset = d.col_offset;
const Proxy<T1> P( o.get_ref() ); const Proxy<T1> P( o.get_ref() );
arma_debug_check arma_debug_check
( (
( (d.n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_co ls() != 1)) ), ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_co ls() != 1)) ),
"diagview: given object has incompatible size" "diagview: given object has incompatible size"
); );
const bool is_alias = P.is_alias(d_m); const bool is_alias = P.is_alias(d_m);
arma_extra_debug_warn(is_alias, "aliasing detected"); arma_extra_debug_warn(is_alias, "aliasing detected");
if( (is_Mat<typename Proxy<T1>::stored_type>::value == true) || (Proxy<T1 >::prefer_at_accessor == true) || (is_alias == true) ) if( (is_Mat<typename Proxy<T1>::stored_type>::value == true) || (Proxy<T1 >::prefer_at_accessor == true) || (is_alias == true) )
{ {
const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, is_alias); const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, is_alias);
skipping to change at line 458 skipping to change at line 458
Mat<eT>& d_m = const_cast< Mat<eT>& >(d.m); Mat<eT>& d_m = const_cast< Mat<eT>& >(d.m);
const uword d_n_elem = d.n_elem; const uword d_n_elem = d.n_elem;
const uword d_row_offset = d.row_offset; const uword d_row_offset = d.row_offset;
const uword d_col_offset = d.col_offset; const uword d_col_offset = d.col_offset;
const Proxy<T1> P( o.get_ref() ); const Proxy<T1> P( o.get_ref() );
arma_debug_check arma_debug_check
( (
( (d.n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_co ls() != 1)) ), ( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_co ls() != 1)) ),
"diagview: given object has incompatible size" "diagview: given object has incompatible size"
); );
const bool is_alias = P.is_alias(d_m); const bool is_alias = P.is_alias(d_m);
arma_extra_debug_warn(is_alias, "aliasing detected"); arma_extra_debug_warn(is_alias, "aliasing detected");
if( (is_Mat<typename Proxy<T1>::stored_type>::value == true) || (Proxy<T1 >::prefer_at_accessor == true) || (is_alias == true) ) if( (is_Mat<typename Proxy<T1>::stored_type>::value == true) || (Proxy<T1 >::prefer_at_accessor == true) || (is_alias == true) )
{ {
const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, is_alias); const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, is_alias);
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added


 diskio_meat.hpp   diskio_meat.hpp 
skipping to change at line 1520 skipping to change at line 1520
//! Load a matrix in text format (human readable), //! Load a matrix in text format (human readable),
//! with a header that indicates the matrix type as well as its dimensions //! with a header that indicates the matrix type as well as its dimensions
template<typename eT> template<typename eT>
inline inline
bool bool
diskio::load_arma_ascii(Mat<eT>& x, std::istream& f, std::string& err_msg) diskio::load_arma_ascii(Mat<eT>& x, std::istream& f, std::string& err_msg)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
std::streampos pos = f.tellg();
bool load_okay = true; bool load_okay = true;
std::string f_header; std::string f_header;
uword f_n_rows; uword f_n_rows;
uword f_n_cols; uword f_n_cols;
f >> f_header; f >> f_header;
f >> f_n_rows; f >> f_n_rows;
f >> f_n_cols; f >> f_n_cols;
skipping to change at line 1568 skipping to change at line 1570
} }
load_okay = f.good(); load_okay = f.good();
} }
else else
{ {
load_okay = false; load_okay = false;
err_msg = "incorrect header in "; err_msg = "incorrect header in ";
} }
// allow automatic conversion of u32/s32 matrices into u64/s64 matrices
if(load_okay == false)
{
if( (sizeof(eT) == 8) && is_same_type<uword,eT>::yes )
{
Mat<u32> tmp;
std::string junk;
f.clear();
f.seekg(pos);
load_okay = diskio::load_arma_ascii(tmp, f, junk);
if(load_okay) { x = conv_to< Mat<eT> >::from(tmp); }
}
else
if( (sizeof(eT) == 8) && is_same_type<sword,eT>::yes )
{
Mat<s32> tmp;
std::string junk;
f.clear();
f.seekg(pos);
load_okay = diskio::load_arma_ascii(tmp, f, junk);
if(load_okay) { x = conv_to< Mat<eT> >::from(tmp); }
}
}
return load_okay; return load_okay;
} }
//! Load a matrix in CSV text format (human readable) //! Load a matrix in CSV text format (human readable)
template<typename eT> template<typename eT>
inline inline
bool bool
diskio::load_csv_ascii(Mat<eT>& x, const std::string& name, std::string& er r_msg) diskio::load_csv_ascii(Mat<eT>& x, const std::string& name, std::string& er r_msg)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
skipping to change at line 1726 skipping to change at line 1759
return load_okay; return load_okay;
} }
template<typename eT> template<typename eT>
inline inline
bool bool
diskio::load_arma_binary(Mat<eT>& x, std::istream& f, std::string& err_msg) diskio::load_arma_binary(Mat<eT>& x, std::istream& f, std::string& err_msg)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
std::streampos pos = f.tellg();
bool load_okay = true; bool load_okay = true;
std::string f_header; std::string f_header;
uword f_n_rows; uword f_n_rows;
uword f_n_cols; uword f_n_cols;
f >> f_header; f >> f_header;
f >> f_n_rows; f >> f_n_rows;
f >> f_n_cols; f >> f_n_cols;
skipping to change at line 1752 skipping to change at line 1787
f.read( reinterpret_cast<char *>(x.memptr()), std::streamsize(x.n_elem* sizeof(eT)) ); f.read( reinterpret_cast<char *>(x.memptr()), std::streamsize(x.n_elem* sizeof(eT)) );
load_okay = f.good(); load_okay = f.good();
} }
else else
{ {
load_okay = false; load_okay = false;
err_msg = "incorrect header in "; err_msg = "incorrect header in ";
} }
// allow automatic conversion of u32/s32 matrices into u64/s64 matrices
if(load_okay == false)
{
if( (sizeof(eT) == 8) && is_same_type<uword,eT>::yes )
{
Mat<u32> tmp;
std::string junk;
f.clear();
f.seekg(pos);
load_okay = diskio::load_arma_binary(tmp, f, junk);
if(load_okay) { x = conv_to< Mat<eT> >::from(tmp); }
}
else
if( (sizeof(eT) == 8) && is_same_type<sword,eT>::yes )
{
Mat<s32> tmp;
std::string junk;
f.clear();
f.seekg(pos);
load_okay = diskio::load_arma_binary(tmp, f, junk);
if(load_okay) { x = conv_to< Mat<eT> >::from(tmp); }
}
}
return load_okay; return load_okay;
} }
inline inline
void void
diskio::pnm_skip_comments(std::istream& f) diskio::pnm_skip_comments(std::istream& f)
{ {
while( isspace(f.peek()) ) while( isspace(f.peek()) )
{ {
while( isspace(f.peek()) ) while( isspace(f.peek()) )
skipping to change at line 2908 skipping to change at line 2974
f >> f_n_nz; f >> f_n_nz;
//f.seekg(1, ios::cur); // NOTE: this may not be portable, as on a Win dows machine a newline could be two characters //f.seekg(1, ios::cur); // NOTE: this may not be portable, as on a Win dows machine a newline could be two characters
f.get(); f.get();
x.set_size(f_n_rows, f_n_cols); x.set_size(f_n_rows, f_n_cols);
x.mem_resize(f_n_nz); x.mem_resize(f_n_nz);
f.read( reinterpret_cast<char*>(access::rwp(x.values)), std::strea msize(x.n_nonzero*sizeof(eT)) ); f.read( reinterpret_cast<char*>(access::rwp(x.values)), std::strea msize(x.n_nonzero*sizeof(eT)) );
std::streampos pos = f.tellg();
f.read( reinterpret_cast<char*>(access::rwp(x.row_indices)), std::strea msize(x.n_nonzero*sizeof(uword)) ); f.read( reinterpret_cast<char*>(access::rwp(x.row_indices)), std::strea msize(x.n_nonzero*sizeof(uword)) );
f.read( reinterpret_cast<char*>(access::rwp(x.col_ptrs)), std::strea msize((x.n_cols+1)*sizeof(uword)) ); f.read( reinterpret_cast<char*>(access::rwp(x.col_ptrs)), std::strea msize((x.n_cols+1)*sizeof(uword)) );
bool check1 = true; bool check1 = true; for(uword i=0; i < x.n_nonzero; ++i) { if(x.value
s[i] == eT(0)) { check1 = false; break; } }
bool check2 = true; for(uword i=0; i < x.n_cols; ++i) { if(x.col_p
trs[i+1] < x.col_ptrs[i]) { check2 = false; break; } }
bool check3 = (x.col_ptrs[x.n_cols] == x.n_nonzero);
for(uword i=0; i < x.n_nonzero; ++i) if((check1 == true) && ((check2 == false) || (check3 == false)))
{ {
if(x.values[i] == eT(0)) { check1 = false; break; } if(sizeof(uword) == 8)
} {
arma_extra_debug_print("detected inconsistent data while loading; r
e-reading integer parts as u32");
bool check2 = true; // inconstency could be due to a different uword size used during s
aving,
// so try loading the row_indices and col_ptrs under the assumption
of 32 bit unsigned integers
for(uword i=0; i < x.n_cols; ++i) f.clear();
{ f.seekg(pos);
if(x.col_ptrs[i+1] < x.col_ptrs[i]) { check2 = false; break; }
} podarray<u32> tmp_a(x.n_nonzero ); tmp_a.zeros();
podarray<u32> tmp_b(x.n_cols + 1); tmp_b.zeros();
f.read( reinterpret_cast<char*>(tmp_a.memptr()), std::streamsize( x
.n_nonzero * sizeof(u32)) );
f.read( reinterpret_cast<char*>(tmp_b.memptr()), std::streamsize((x
.n_cols + 1) * sizeof(u32)) );
check2 = true; for(uword i=0; i < x.n_cols; ++i) { if(tmp_b[i+1]
< tmp_b[i]) { check2 = false; break; } }
check3 = (tmp_b[x.n_cols] == x.n_nonzero);
const bool check3 = (x.col_ptrs[x.n_cols] == x.n_nonzero); load_okay = f.good();
if( load_okay && (check2 == true) && (check3 == true) )
{
arma_extra_debug_print("reading integer parts as u32 succeeded");
arrayops::convert(access::rwp(x.row_indices), tmp_a.memptr(), x.n
_nonzero );
arrayops::convert(access::rwp(x.col_ptrs), tmp_b.memptr(), x.n
_cols + 1);
}
else
{
arma_extra_debug_print("reading integer parts as u32 failed");
}
}
}
if((check1 == false) || (check2 == false) || (check3 == false)) if((check1 == false) || (check2 == false) || (check3 == false))
{ {
load_okay = false; load_okay = false;
err_msg = "inconsistent data in "; err_msg = "inconsistent data in ";
} }
else else
{ {
load_okay = f.good(); load_okay = f.good();
} }
skipping to change at line 3401 skipping to change at line 3495
//! Load a cube in text format (human readable), //! Load a cube in text format (human readable),
//! with a header that indicates the cube type as well as its dimensions //! with a header that indicates the cube type as well as its dimensions
template<typename eT> template<typename eT>
inline inline
bool bool
diskio::load_arma_ascii(Cube<eT>& x, std::istream& f, std::string& err_msg) diskio::load_arma_ascii(Cube<eT>& x, std::istream& f, std::string& err_msg)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
std::streampos pos = f.tellg();
bool load_okay = true; bool load_okay = true;
std::string f_header; std::string f_header;
uword f_n_rows; uword f_n_rows;
uword f_n_cols; uword f_n_cols;
uword f_n_slices; uword f_n_slices;
f >> f_header; f >> f_header;
f >> f_n_rows; f >> f_n_rows;
f >> f_n_cols; f >> f_n_cols;
skipping to change at line 3436 skipping to change at line 3532
} }
load_okay = f.good(); load_okay = f.good();
} }
else else
{ {
load_okay = false; load_okay = false;
err_msg = "incorrect header in "; err_msg = "incorrect header in ";
} }
// allow automatic conversion of u32/s32 cubes into u64/s64 cubes
if(load_okay == false)
{
if( (sizeof(eT) == 8) && is_same_type<uword,eT>::yes )
{
Cube<u32> tmp;
std::string junk;
f.clear();
f.seekg(pos);
load_okay = diskio::load_arma_ascii(tmp, f, junk);
if(load_okay) { x = conv_to< Cube<eT> >::from(tmp); }
}
else
if( (sizeof(eT) == 8) && is_same_type<sword,eT>::yes )
{
Cube<s32> tmp;
std::string junk;
f.clear();
f.seekg(pos);
load_okay = diskio::load_arma_ascii(tmp, f, junk);
if(load_okay) { x = conv_to< Cube<eT> >::from(tmp); }
}
}
return load_okay; return load_okay;
} }
//! Load a cube in binary format, //! Load a cube in binary format,
//! with a header that indicates the cube type as well as its dimensions //! with a header that indicates the cube type as well as its dimensions
template<typename eT> template<typename eT>
inline inline
bool bool
diskio::load_arma_binary(Cube<eT>& x, const std::string& name, std::string& err_msg) diskio::load_arma_binary(Cube<eT>& x, const std::string& name, std::string& err_msg)
{ {
skipping to change at line 3469 skipping to change at line 3596
return load_okay; return load_okay;
} }
template<typename eT> template<typename eT>
inline inline
bool bool
diskio::load_arma_binary(Cube<eT>& x, std::istream& f, std::string& err_msg ) diskio::load_arma_binary(Cube<eT>& x, std::istream& f, std::string& err_msg )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
std::streampos pos = f.tellg();
bool load_okay = true; bool load_okay = true;
std::string f_header; std::string f_header;
uword f_n_rows; uword f_n_rows;
uword f_n_cols; uword f_n_cols;
uword f_n_slices; uword f_n_slices;
f >> f_header; f >> f_header;
f >> f_n_rows; f >> f_n_rows;
f >> f_n_cols; f >> f_n_cols;
skipping to change at line 3497 skipping to change at line 3626
f.read( reinterpret_cast<char *>(x.memptr()), std::streamsize(x.n_elem* sizeof(eT)) ); f.read( reinterpret_cast<char *>(x.memptr()), std::streamsize(x.n_elem* sizeof(eT)) );
load_okay = f.good(); load_okay = f.good();
} }
else else
{ {
load_okay = false; load_okay = false;
err_msg = "incorrect header in "; err_msg = "incorrect header in ";
} }
// allow automatic conversion of u32/s32 cubes into u64/s64 cubes
if(load_okay == false)
{
if( (sizeof(eT) == 8) && is_same_type<uword,eT>::yes )
{
Cube<u32> tmp;
std::string junk;
f.clear();
f.seekg(pos);
load_okay = diskio::load_arma_binary(tmp, f, junk);
if(load_okay) { x = conv_to< Cube<eT> >::from(tmp); }
}
else
if( (sizeof(eT) == 8) && is_same_type<sword,eT>::yes )
{
Cube<s32> tmp;
std::string junk;
f.clear();
f.seekg(pos);
load_okay = diskio::load_arma_binary(tmp, f, junk);
if(load_okay) { x = conv_to< Cube<eT> >::from(tmp); }
}
}
return load_okay; return load_okay;
} }
//! Load a HDF5 file as a cube //! Load a HDF5 file as a cube
template<typename eT> template<typename eT>
inline inline
bool bool
diskio::load_hdf5_binary(Cube<eT>& x, const std::string& name, std::string& err_msg) diskio::load_hdf5_binary(Cube<eT>& x, const std::string& name, std::string& err_msg)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
 End of changes. 15 change blocks. 
10 lines changed or deleted 180 lines changed or added


 field_meat.hpp   field_meat.hpp 
skipping to change at line 1451 skipping to change at line 1451
} }
//! internal field construction; if the requested size is small enough, mem ory from the stack is used. otherwise memory is allocated via 'new' //! internal field construction; if the requested size is small enough, mem ory from the stack is used. otherwise memory is allocated via 'new'
template<typename oT> template<typename oT>
inline inline
void void
field<oT>::init(const uword n_rows_in, const uword n_cols_in, const uword n _slices_in) field<oT>::init(const uword n_rows_in, const uword n_cols_in, const uword n _slices_in)
{ {
arma_extra_debug_sigprint( arma_boost::format("n_rows_in = %d, n_cols_in = %d, n_slices_in = %d") % n_rows_in % n_cols_in % n_slices_in ); arma_extra_debug_sigprint( arma_boost::format("n_rows_in = %d, n_cols_in = %d, n_slices_in = %d") % n_rows_in % n_cols_in % n_slices_in );
#if (defined(ARMA_USE_CXX11) || defined(ARMA_64BIT_WORD))
const char* error_message = "field::init(): requested size is too large
";
#else
const char* error_message = "field::init(): requested size is too large
; suggest to compile in C++11 mode or enable ARMA_64BIT_WORD";
#endif
arma_debug_check arma_debug_check
( (
( (
( (n_rows_in > 0x0FFF) || (n_cols_in > 0x0FFF) || (n_slices_in > 0xFF ) ) ( (n_rows_in > 0x0FFF) || (n_cols_in > 0x0FFF) || (n_slices_in > 0xFF ) )
? ( (float(n_rows_in) * float(n_cols_in) * float(n_slices_in)) > fl oat(ARMA_MAX_UWORD) ) ? ( (double(n_rows_in) * double(n_cols_in) * double(n_slices_in)) > double(ARMA_MAX_UWORD) )
: false : false
), ),
"field::init(): requested size is too large; suggest to enable ARMA_64B IT_WORD" error_message
); );
const uword n_elem_new = n_rows_in * n_cols_in * n_slices_in; const uword n_elem_new = n_rows_in * n_cols_in * n_slices_in;
if(n_elem == n_elem_new) if(n_elem == n_elem_new)
{ {
// delete_objects(); // delete_objects();
// create_objects(); // create_objects();
access::rw(n_rows) = n_rows_in; access::rw(n_rows) = n_rows_in;
access::rw(n_cols) = n_cols_in; access::rw(n_cols) = n_cols_in;
 End of changes. 3 change blocks. 
2 lines changed or deleted 10 lines changed or added


 fn_eigs_gen.hpp   fn_eigs_gen.hpp 
skipping to change at line 21 skipping to change at line 21
//! eigenvalues of general sparse matrix X //! eigenvalues of general sparse matrix X
template<typename T1> template<typename T1>
inline inline
Col< std::complex<typename T1::pod_type> > Col< std::complex<typename T1::pod_type> >
eigs_gen eigs_gen
( (
const SpBase<typename T1::elem_type, T1>& X, const SpBase<typename T1::elem_type, T1>& X,
const uword n_eigvals, const uword n_eigvals,
const char* form = "lm", const char* form = "lm",
const typename T1::elem_type tol = 0.0, const typename T1::pod_type tol = 0.0,
const typename arma_blas_type_only<typename T1::elem_type>::result* junk = 0 const typename arma_blas_type_only<typename T1::elem_type>::result* junk = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk); arma_ignore(junk);
typedef typename T1::pod_type T; typedef typename T1::pod_type T;
Mat< std::complex<T> > eigvec; Mat< std::complex<T> > eigvec;
Col< std::complex<T> > eigval; Col< std::complex<T> > eigval;
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 fn_elem.hpp   fn_elem.hpp 
skipping to change at line 242 skipping to change at line 242
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return eOpCube<T1, eop_exp10>(A.get_ref()); return eOpCube<T1, eop_exp10>(A.get_ref());
} }
// //
// abs // abs
template<typename T1> template<typename T1>
arma_inline arma_inline
typename enable_if2< is_arma_type<T1>::value, const eOp<T1, eop_abs> >::res typename enable_if2< (is_arma_type<T1>::value && is_cx<typename T1::elem_ty
ult pe>::no), const eOp<T1, eop_abs> >::result
abs(const T1& X, const typename arma_not_cx<typename T1::elem_type>::result abs(const T1& X)
* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
return eOp<T1, eop_abs>(X); return eOp<T1, eop_abs>(X);
} }
template<typename T1> template<typename T1>
arma_inline arma_inline
const eOpCube<T1, eop_abs> const eOpCube<T1, eop_abs>
abs(const BaseCube<typename T1::elem_type,T1>& X, const typename arma_not_c x<typename T1::elem_type>::result* junk = 0) abs(const BaseCube<typename T1::elem_type,T1>& X, const typename arma_not_c x<typename T1::elem_type>::result* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk); arma_ignore(junk);
return eOpCube<T1, eop_abs>(X.get_ref()); return eOpCube<T1, eop_abs>(X.get_ref());
} }
template<typename T1> template<typename T1>
inline inline
const mtOp<typename T1::pod_type, T1, op_abs> typename enable_if2< (is_arma_type<T1>::value && is_cx<typename T1::elem_ty
abs(const Base<std::complex<typename T1::pod_type>, T1>& X, const typename pe>::yes), const mtOp<typename T1::pod_type, T1, op_abs> >::result
arma_cx_only<typename T1::elem_type>::result* junk = 0) abs(const T1& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk); return mtOp<typename T1::pod_type, T1, op_abs>(X);
return mtOp<typename T1::pod_type, T1, op_abs>( X.get_ref() );
} }
template<typename T1> template<typename T1>
inline inline
const mtOpCube<typename T1::pod_type, T1, op_abs> const mtOpCube<typename T1::pod_type, T1, op_abs>
abs(const BaseCube< std::complex<typename T1::pod_type>,T1>& X, const typen ame arma_cx_only<typename T1::elem_type>::result* junk = 0) abs(const BaseCube< std::complex<typename T1::pod_type>,T1>& X, const typen ame arma_cx_only<typename T1::elem_type>::result* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk); arma_ignore(junk);
 End of changes. 4 change blocks. 
12 lines changed or deleted 7 lines changed or added


 fn_join.hpp   fn_join.hpp 
// Copyright (C) 2010-2013 Conrad Sanderson // Copyright (C) 2010-2015 Conrad Sanderson
// Copyright (C) 2010-2013 NICTA (www.nicta.com.au) // Copyright (C) 2010-2015 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup fn_join //! \addtogroup fn_join
//! @{ //! @{
template<typename T1, typename T2> template<typename T1, typename T2>
inline inline
skipping to change at line 61 skipping to change at line 61
template<typename T1, typename T2> template<typename T1, typename T2>
inline inline
const GlueCube<T1, T2, glue_join> const GlueCube<T1, T2, glue_join>
join_slices(const BaseCube<typename T1::elem_type,T1>& A, const BaseCube<ty pename T1::elem_type,T2>& B) join_slices(const BaseCube<typename T1::elem_type,T1>& A, const BaseCube<ty pename T1::elem_type,T2>& B)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return GlueCube<T1, T2, glue_join>(A.get_ref(), B.get_ref()); return GlueCube<T1, T2, glue_join>(A.get_ref(), B.get_ref());
} }
//
// for sparse matrices
template<typename T1, typename T2>
inline
const SpGlue<T1, T2, spglue_join_cols>
join_cols(const SpBase<typename T1::elem_type,T1>& A, const SpBase<typename
T1::elem_type,T2>& B)
{
arma_extra_debug_sigprint();
return SpGlue<T1, T2, spglue_join_cols>(A.get_ref(), B.get_ref());
}
template<typename T1, typename T2>
inline
const SpGlue<T1, T2, spglue_join_cols>
join_vert(const SpBase<typename T1::elem_type,T1>& A, const SpBase<typename
T1::elem_type,T2>& B)
{
arma_extra_debug_sigprint();
return SpGlue<T1, T2, spglue_join_cols>(A.get_ref(), B.get_ref());
}
template<typename T1, typename T2>
inline
const SpGlue<T1, T2, spglue_join_rows>
join_rows(const SpBase<typename T1::elem_type,T1>& A, const SpBase<typename
T1::elem_type,T2>& B)
{
arma_extra_debug_sigprint();
return SpGlue<T1, T2, spglue_join_rows>(A.get_ref(), B.get_ref());
}
template<typename T1, typename T2>
inline
const SpGlue<T1, T2, spglue_join_rows>
join_horiz(const SpBase<typename T1::elem_type,T1>& A, const SpBase<typenam
e T1::elem_type,T2>& B)
{
arma_extra_debug_sigprint();
return SpGlue<T1, T2, spglue_join_rows>(A.get_ref(), B.get_ref());
}
//! @} //! @}
 End of changes. 2 change blocks. 
2 lines changed or deleted 49 lines changed or added


 fn_repmat.hpp   fn_repmat.hpp 
// Copyright (C) 2009-2010 Conrad Sanderson // Copyright (C) 2009-2015 Conrad Sanderson
// Copyright (C) 2009-2010 NICTA (www.nicta.com.au) // Copyright (C) 2009-2015 NICTA (www.nicta.com.au)
// Copyright (C) 2009-2010 Dimitrios Bouzas // Copyright (C) 2009-2010 Dimitrios Bouzas
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup fn_repmat //! \addtogroup fn_repmat
//! @{ //! @{
//! \brief
//! delayed 'repeat matrix' construction of a matrix
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_repmat> const Op<T1, op_repmat>
repmat(const Base<typename T1::elem_type,T1>& A, const uword r, const uword c) repmat(const Base<typename T1::elem_type,T1>& A, const uword r, const uword c)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return Op<T1, op_repmat>(A.get_ref(), r, c); return Op<T1, op_repmat>(A.get_ref(), r, c);
} }
template<typename T1>
arma_inline
const SpOp<T1, spop_repmat>
repmat(const SpBase<typename T1::elem_type,T1>& A, const uword r, const uwo
rd c)
{
arma_extra_debug_sigprint();
return SpOp<T1, spop_repmat>(A.get_ref(), r, c);
}
//! @} //! @}
 End of changes. 3 change blocks. 
4 lines changed or deleted 13 lines changed or added


 fn_sort_index.hpp   fn_sort_index.hpp 
// Copyright (C) 2009-2014 Conrad Sanderson // Copyright (C) 2009-2015 Conrad Sanderson
// Copyright (C) 2009-2014 NICTA (www.nicta.com.au) // Copyright (C) 2009-2015 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup fn_sort_index //! \addtogroup fn_sort_index
//! @{ //! @{
template<typename T1, typename T2>
struct arma_sort_index_packet
{
T1 val;
T2 index;
};
class arma_sort_index_helper_ascend
{
public:
template<typename T1, typename T2>
arma_inline
bool
operator() (const arma_sort_index_packet<T1,T2>& A, const arma_sort_index
_packet<T1,T2>& B) const
{
return (A.val < B.val);
}
};
class arma_sort_index_helper_descend
{
public:
template<typename T1, typename T2>
arma_inline
bool
operator() (const arma_sort_index_packet<T1,T2>& A, const arma_sort_index
_packet<T1,T2>& B) const
{
return (A.val > B.val);
}
};
template<typename umat_elem_type, typename eT, const uword sort_type, const
uword sort_stable>
void
inline
sort_index_helper(umat_elem_type* out_mem, const eT* in_mem, const uword n_
elem, typename arma_not_cx<eT>::result* junk = 0)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
std::vector< arma_sort_index_packet<eT, umat_elem_type> > packet_vec(n_el
em);
for(uword i=0; i<n_elem; ++i)
{
packet_vec[i].val = in_mem[i];
packet_vec[i].index = i;
}
if(sort_type == 0)
{
// ascend
arma_sort_index_helper_ascend comparator;
if(sort_stable == 0)
{
std::sort( packet_vec.begin(), packet_vec.end(), comparator );
}
else
{
std::stable_sort( packet_vec.begin(), packet_vec.end(), comparator );
}
}
else
{
// descend
arma_sort_index_helper_descend comparator;
if(sort_stable == 0)
{
std::sort( packet_vec.begin(), packet_vec.end(), comparator );
}
else
{
std::stable_sort( packet_vec.begin(), packet_vec.end(), comparator );
}
}
for(uword i=0; i<n_elem; ++i)
{
out_mem[i] = packet_vec[i].index;
}
}
template<typename umat_elem_type, typename eT, const uword sort_type, const
uword sort_stable>
void
inline
sort_index_helper(umat_elem_type* out_mem, const eT* in_mem, const uword n_
elem, typename arma_cx_only<eT>::result* junk = 0)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
typedef typename get_pod_type<eT>::result T;
std::vector< arma_sort_index_packet<T, umat_elem_type> > packet_vec(n_ele
m);
for(uword i=0; i<n_elem; ++i)
{
packet_vec[i].val = std::abs(in_mem[i]);
packet_vec[i].index = i;
}
if(sort_type == 0)
{
// ascend
arma_sort_index_helper_ascend comparator;
if(sort_stable == 0)
{
std::sort( packet_vec.begin(), packet_vec.end(), comparator );
}
else
{
std::stable_sort( packet_vec.begin(), packet_vec.end(), comparator );
}
}
else
{
// descend
arma_sort_index_helper_descend comparator;
if(sort_stable == 0)
{
std::sort( packet_vec.begin(), packet_vec.end(), comparator );
}
else
{
std::stable_sort( packet_vec.begin(), packet_vec.end(), comparator );
}
}
for(uword i=0; i<n_elem; ++i)
{
out_mem[i] = packet_vec[i].index;
}
}
//! kept for compatibility with old code //! kept for compatibility with old code
template<typename T1> template<typename T1>
inline inline
umat const mtOp<uword,T1,op_sort_index>
sort_index sort_index
( (
const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T1>& X,
const uword sort_type = 0 const uword sort_type = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; arma_debug_check( (sort_type > 1), "sort_index(): sort_type must be 0 or
typedef typename umat::elem_type out_elem_type; 1");
const unwrap<T1> tmp(X.get_ref()); return mtOp<uword,T1,op_sort_index>(X.get_ref(), sort_type, uword(0));
const Mat<eT>& A = tmp.M;
umat out;
if(A.is_empty() == false)
{
arma_debug_check( (A.is_vec() == false), "sort_index(): currently only
handles vectors");
out.set_size(A.n_rows, A.n_cols);
if(sort_type == 0)
{
sort_index_helper<out_elem_type, eT, 0, 0>(out.memptr(), A.mem, A.n_e
lem);
}
else
{
sort_index_helper<out_elem_type, eT, 1, 0>(out.memptr(), A.mem, A.n_e
lem);
}
}
return out;
} }
//! kept for compatibility with old code //! kept for compatibility with old code
template<typename T1> template<typename T1>
inline inline
umat const mtOp<uword,T1,op_stable_sort_index>
stable_sort_index stable_sort_index
( (
const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T1>& X,
const uword sort_type = 0 const uword sort_type = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; arma_debug_check( (sort_type > 1), "stable_sort_index(): sort_type must b
typedef typename umat::elem_type out_elem_type; e 0 or 1");
const unwrap<T1> tmp(X.get_ref());
const Mat<eT>& A = tmp.M;
umat out;
if(A.is_empty() == false) return mtOp<uword,T1,op_stable_sort_index>(X.get_ref(), sort_type, uword(
{ 0));
arma_debug_check( (A.is_vec() == false), "stable_sort_index(): currentl
y only handles vectors");
out.set_size(A.n_rows, A.n_cols);
if(sort_type == 0)
{
sort_index_helper<out_elem_type, eT, 0, 1>(out.memptr(), A.mem, A.n_e
lem);
}
else
{
sort_index_helper<out_elem_type, eT, 1, 1>(out.memptr(), A.mem, A.n_e
lem);
}
}
return out;
} }
template<typename T1, typename T2> template<typename T1, typename T2>
inline inline
typename typename
enable_if2 enable_if2
< <
( (is_arma_type<T1>::value == true) && (is_same_type<T2, char>::value == true) ), ( (is_arma_type<T1>::value == true) && (is_same_type<T2, char>::value == true) ),
umat const mtOp<uword,T1,op_sort_index>
>::result >::result
sort_index sort_index
( (
const T1& X, const T1& X,
const T2* sort_direction const T2* sort_direction
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT;
typedef typename umat::elem_type out_elem_type;
const char sig = (sort_direction != NULL) ? sort_direction[0] : char(0); const char sig = (sort_direction != NULL) ? sort_direction[0] : char(0);
arma_debug_check( ((sig != 'a') && (sig != 'd')), "sort_index(): unknown sort direction" ); arma_debug_check( ((sig != 'a') && (sig != 'd')), "sort_index(): unknown sort direction" );
const unwrap<T1> tmp(X); return mtOp<uword,T1,op_sort_index>(X, ((sig == 'a') ? uword(0) : uword(1
const Mat<eT>& A = tmp.M; )), uword(0));
umat out;
if(A.is_empty() == false)
{
arma_debug_check( (A.is_vec() == false), "sort_index(): currently only
handles vectors");
out.set_size(A.n_rows, A.n_cols);
if(sig == 'a')
{
sort_index_helper<out_elem_type, eT, 0, 0>(out.memptr(), A.mem, A.n_e
lem);
}
else
{
sort_index_helper<out_elem_type, eT, 1, 0>(out.memptr(), A.mem, A.n_e
lem);
}
}
return out;
} }
template<typename T1, typename T2> template<typename T1, typename T2>
inline inline
typename typename
enable_if2 enable_if2
< <
( (is_arma_type<T1>::value == true) && (is_same_type<T2, char>::value == true) ), ( (is_arma_type<T1>::value == true) && (is_same_type<T2, char>::value == true) ),
umat const mtOp<uword,T1,op_stable_sort_index>
>::result >::result
stable_sort_index stable_sort_index
( (
const T1& X, const T1& X,
const T2* sort_direction const T2* sort_direction
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT;
typedef typename umat::elem_type out_elem_type;
const char sig = (sort_direction != NULL) ? sort_direction[0] : char(0); const char sig = (sort_direction != NULL) ? sort_direction[0] : char(0);
arma_debug_check( ((sig != 'a') && (sig != 'd')), "stable_sort_index(): u nknown sort direction" ); arma_debug_check( ((sig != 'a') && (sig != 'd')), "stable_sort_index(): u nknown sort direction" );
const unwrap<T1> tmp(X); return mtOp<uword,T1,op_stable_sort_index>(X, ((sig == 'a') ? uword(0) :
const Mat<eT>& A = tmp.M; uword(1)), uword(0));
umat out;
if(A.is_empty() == false)
{
arma_debug_check( (A.is_vec() == false), "stable_sort_index(): currentl
y only handles vectors");
out.set_size(A.n_rows, A.n_cols);
if(sig == 'a')
{
sort_index_helper<out_elem_type, eT, 0, 1>(out.memptr(), A.mem, A.n_e
lem);
}
else
{
sort_index_helper<out_elem_type, eT, 1, 1>(out.memptr(), A.mem, A.n_e
lem);
}
}
return out;
} }
//! @} //! @}
 End of changes. 14 change blocks. 
265 lines changed or deleted 17 lines changed or added


 forward_bones.hpp   forward_bones.hpp 
// Copyright (C) 2008-2014 Conrad Sanderson // Copyright (C) 2008-2015 Conrad Sanderson
// Copyright (C) 2008-2014 NICTA (www.nicta.com.au) // Copyright (C) 2008-2015 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
using std::cout; using std::cout;
using std::cerr; using std::cerr;
using std::endl; using std::endl;
using std::ios; using std::ios;
using std::size_t; using std::size_t;
skipping to change at line 41 skipping to change at line 41
template<typename eT> class subview_cube; template<typename eT> class subview_cube;
template<typename oT> class subview_field; template<typename oT> class subview_field;
template<typename eT> class SpValProxy; template<typename eT> class SpValProxy;
template<typename eT> class SpMat; template<typename eT> class SpMat;
template<typename eT> class SpCol; template<typename eT> class SpCol;
template<typename eT> class SpRow; template<typename eT> class SpRow;
template<typename eT> class SpSubview; template<typename eT> class SpSubview;
template<typename eT> class diagview; template<typename eT> class diagview;
template<typename eT> class spdiagview;
template<typename eT, typename T1> class subview_elem1; template<typename eT, typename T1> class subview_elem1;
template<typename eT, typename T1, typename T2> class subview_elem2; template<typename eT, typename T1, typename T2> class subview_elem2;
template<typename parent, unsigned int mode> class subview_eac h1; template<typename parent, unsigned int mode> class subview_eac h1;
template<typename parent, unsigned int mode, typename TB> class subview_eac h2; template<typename parent, unsigned int mode, typename TB> class subview_eac h2;
class SizeMat; class SizeMat;
class SizeCube; class SizeCube;
skipping to change at line 80 skipping to change at line 81
class op_clamp; class op_clamp;
class op_cumsum_vec; class op_cumsum_vec;
class op_shuffle; class op_shuffle;
class op_sort; class op_sort;
class op_find; class op_find;
class op_find_simple; class op_find_simple;
class op_flipud; class op_flipud;
class op_fliplr; class op_fliplr;
class op_real; class op_real;
class op_imag; class op_imag;
class op_nonzeros;
class op_sort_index;
class op_stable_sort_index;
class eop_conj; class eop_conj;
class glue_times; class glue_times;
class glue_times_diag; class glue_times_diag;
class glue_rel_lt; class glue_rel_lt;
class glue_rel_gt; class glue_rel_gt;
class glue_rel_lteq; class glue_rel_lteq;
class glue_rel_gteq; class glue_rel_gteq;
skipping to change at line 235 skipping to change at line 239
static const fill_class<fill_none > none; static const fill_class<fill_none > none;
static const fill_class<fill_zeros> zeros; static const fill_class<fill_zeros> zeros;
static const fill_class<fill_ones > ones; static const fill_class<fill_ones > ones;
static const fill_class<fill_eye > eye; static const fill_class<fill_eye > eye;
static const fill_class<fill_randu> randu; static const fill_class<fill_randu> randu;
static const fill_class<fill_randn> randn; static const fill_class<fill_randn> randn;
} }
//! @} //! @}
//! \addtogroup fn_spsolve
//! @{
struct spsolve_opts_base
{
const unsigned int id;
inline spsolve_opts_base(const unsigned int in_id) : id(in_id) {}
};
struct spsolve_opts_none : public spsolve_opts_base
{
inline spsolve_opts_none() : spsolve_opts_base(0) {}
};
struct superlu_opts : public spsolve_opts_base
{
typedef enum {NATURAL, MMD_ATA, MMD_AT_PLUS_A, COLAMD} permutation_type;
typedef enum {REF_NONE, REF_SINGLE, REF_DOUBLE, REF_EXTRA} refine_type;
bool equilibrate;
bool symmetric;
double pivot_thresh;
permutation_type permutation;
refine_type refine;
inline superlu_opts()
: spsolve_opts_base(1)
{
equilibrate = true;
symmetric = false;
pivot_thresh = 1.0;
permutation = COLAMD;
refine = REF_NONE;
}
};
//! @}
 End of changes. 4 change blocks. 
2 lines changed or deleted 6 lines changed or added


 gmm_diag_meat.hpp   gmm_diag_meat.hpp 
skipping to change at line 1339 skipping to change at line 1339
void void
gmm_diag<eT>::generate_initial_means(const Mat<eT>& X, const gmm_seed_mode& seed_mode) gmm_diag<eT>::generate_initial_means(const Mat<eT>& X, const gmm_seed_mode& seed_mode)
{ {
const uword N_dims = means.n_rows; const uword N_dims = means.n_rows;
const uword N_gaus = means.n_cols; const uword N_gaus = means.n_cols;
if( (seed_mode == static_subset) || (seed_mode == random_subset) ) if( (seed_mode == static_subset) || (seed_mode == random_subset) )
{ {
uvec initial_indices; uvec initial_indices;
if(seed_mode == static_subset) { initial_indices = linspace<uvec> if(seed_mode == static_subset) { initial_indices = linspace<uvec>
(0, X.n_cols-1, N_gaus); } (0, X.n_cols-1, N_gaus); }
else if(seed_mode == random_subset) { initial_indices = sort_index(ran else if(seed_mode == random_subset) { initial_indices = uvec(sort_inde
du<vec>(X.n_cols)).rows(0,N_gaus-1); } x(randu<vec>(X.n_cols))).rows(0,N_gaus-1); }
// not using randi() here as on some primitive systems it produces vect ors with non-unique values // not using randi() here as on some primitive systems it produces vect ors with non-unique values
// initial_indices.print("initial_indices:"); // initial_indices.print("initial_indices:");
access::rw(means) = X.cols(initial_indices); access::rw(means) = X.cols(initial_indices);
} }
else else
if( (seed_mode == static_spread) || (seed_mode == random_spread) ) if( (seed_mode == static_spread) || (seed_mode == random_spread) )
{ {
 End of changes. 1 change blocks. 
4 lines changed or deleted 4 lines changed or added


 mtOp_bones.hpp   mtOp_bones.hpp 
skipping to change at line 24 skipping to change at line 24
class mtOp : public Base<out_eT, mtOp<out_eT, T1, op_type> > class mtOp : public Base<out_eT, mtOp<out_eT, T1, op_type> >
{ {
public: public:
typedef out_eT elem_type; typedef out_eT elem_type;
typedef typename get_pod_type<out_eT>::result pod_type; typedef typename get_pod_type<out_eT>::result pod_type;
typedef typename T1::elem_type in_eT; typedef typename T1::elem_type in_eT;
static const bool is_row = \ static const bool is_row = \
(T1::is_row && (is_op_mixed_elem<op_type>::value || is_same_type<op_ty pe, op_clamp>::value || is_same_type<op_type, op_real>::value || is_same_ty pe<op_type, op_imag>::value)); (T1::is_row && (is_op_mixed_elem<op_type>::value || is_same_type<op_ty pe, op_clamp>::value || is_same_type<op_type, op_real>::value || is_same_ty pe<op_type, op_imag>::value || is_same_type<op_type, op_abs>::value));
static const bool is_col = \ static const bool is_col = \
(T1::is_col && (is_op_mixed_elem<op_type>::value || is_same_type<op_ty pe, op_clamp>::value || is_same_type<op_type, op_real>::value || is_same_ty pe<op_type, op_imag>::value)) (T1::is_col && (is_op_mixed_elem<op_type>::value || is_same_type<op_ty pe, op_clamp>::value || is_same_type<op_type, op_real>::value || is_same_ty pe<op_type, op_imag>::value || is_same_type<op_type, op_abs>::value))
|| (is_same_type<op_type, op_find_simple>::value) || (is_same_type<op_type, op_find_simple>::value)
|| (is_same_type<op_type, op_find>::value); || (is_same_type<op_type, op_find>::value)
|| (is_same_type<op_type, op_sort_index>::value)
|| (is_same_type<op_type, op_stable_sort_index>::value);
inline explicit mtOp(const T1& in_m); inline explicit mtOp(const T1& in_m);
inline mtOp(const T1& in_m, const in_eT in_aux); inline mtOp(const T1& in_m, const in_eT in_aux);
inline mtOp(const T1& in_m, const uword in_aux_uword_a, const uw ord in_aux_uword_b); inline mtOp(const T1& in_m, const uword in_aux_uword_a, const uw ord in_aux_uword_b);
inline mtOp(const T1& in_m, const in_eT in_aux, const uw ord in_aux_uword_a, const uword in_aux_uword_b); inline mtOp(const T1& in_m, const in_eT in_aux, const uw ord in_aux_uword_a, const uword in_aux_uword_b);
inline mtOp(const char junk, const T1& in_m, const out_eT in_aux ); inline mtOp(const char junk, const T1& in_m, const out_eT in_aux );
inline mtOp(const mtOp_dual_aux_indicator&, const T1& in_m, cons t in_eT in_aux_a, const out_eT in_aux_b); inline mtOp(const mtOp_dual_aux_indicator&, const T1& in_m, cons t in_eT in_aux_a, const out_eT in_aux_b);
 End of changes. 3 change blocks. 
3 lines changed or deleted 5 lines changed or added


 mul_gemm.hpp   mul_gemm.hpp 
skipping to change at line 273 skipping to change at line 273
(do_trans_B) ? C.n_cols : ( (do_trans_A) ? A.n_rows : A.n_cols ), (do_trans_B) ? C.n_cols : ( (do_trans_A) ? A.n_rows : A.n_cols ),
(use_beta) ? beta : eT(0), (use_beta) ? beta : eT(0),
C.memptr(), C.memptr(),
C.n_rows C.n_rows
); );
} }
#elif defined(ARMA_USE_BLAS) #elif defined(ARMA_USE_BLAS)
{ {
arma_extra_debug_print("blas::gemm()"); arma_extra_debug_print("blas::gemm()");
arma_debug_assert_blas_size(A,B);
const char trans_A = (do_trans_A) ? ( is_cx<eT>::yes ? 'C' : 'T' ) : 'N'; const char trans_A = (do_trans_A) ? ( is_cx<eT>::yes ? 'C' : 'T' ) : 'N';
const char trans_B = (do_trans_B) ? ( is_cx<eT>::yes ? 'C' : 'T' ) : 'N'; const char trans_B = (do_trans_B) ? ( is_cx<eT>::yes ? 'C' : 'T' ) : 'N';
const blas_int m = C.n_rows; const blas_int m = C.n_rows;
const blas_int n = C.n_cols; const blas_int n = C.n_cols;
const blas_int k = (do_trans_A) ? A.n_rows : A.n_cols; const blas_int k = (do_trans_A) ? A.n_rows : A.n_cols;
const eT local_alpha = (use_alpha) ? alpha : eT(1); const eT local_alpha = (use_alpha) ? alpha : eT(1);
const blas_int lda = (do_trans_A) ? k : m; const blas_int lda = (do_trans_A) ? k : m;
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added


 mul_gemv.hpp   mul_gemv.hpp 
skipping to change at line 339 skipping to change at line 339
(use_beta) ? beta : eT(0), (use_beta) ? beta : eT(0),
y, y,
1 1
); );
} }
} }
#elif defined(ARMA_USE_BLAS) #elif defined(ARMA_USE_BLAS)
{ {
arma_extra_debug_print("blas::gemv()"); arma_extra_debug_print("blas::gemv()");
arma_debug_assert_blas_size(A);
const char trans_A = (do_trans_A) ? ( is_cx<eT>::yes ? 'C' : 'T' ) : 'N'; const char trans_A = (do_trans_A) ? ( is_cx<eT>::yes ? 'C' : 'T' ) : 'N';
const blas_int m = A.n_rows; const blas_int m = A.n_rows;
const blas_int n = A.n_cols; const blas_int n = A.n_cols;
const eT local_alpha = (use_alpha) ? alpha : eT(1); const eT local_alpha = (use_alpha) ? alpha : eT(1);
//const blas_int lda = A.n_rows; //const blas_int lda = A.n_rows;
const blas_int inc = 1; const blas_int inc = 1;
const eT local_beta = (use_beta) ? beta : eT(0); const eT local_beta = (use_beta) ? beta : eT(0);
arma_extra_debug_print( arma_boost::format("blas::gemv(): trans_A = %c") % trans_A ); arma_extra_debug_print( arma_boost::format("blas::gemv(): trans_A = %c") % trans_A );
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added


 op_shuffle_meat.hpp   op_shuffle_meat.hpp 
skipping to change at line 32 skipping to change at line 32
const Mat<eT>& X = tmp.M; const Mat<eT>& X = tmp.M;
if(X.is_empty()) { out.copy_size(X); return; } if(X.is_empty()) { out.copy_size(X); return; }
const uword dim = in.aux_uword_a; const uword dim = in.aux_uword_a;
arma_debug_check( (dim > 1), "shuffle(): dim must be 0 or 1" ); arma_debug_check( (dim > 1), "shuffle(): dim must be 0 or 1" );
const uword N = (dim == 0) ? X.n_rows : X.n_cols; const uword N = (dim == 0) ? X.n_rows : X.n_cols;
// see "fn_sort_index.hpp" for the definition of "arma_sort_index_packet" // see op_sort_index_bones.hpp for the definition of arma_sort_index_pack et
// and the associated comparison functor // and the associated comparison functor
std::vector< arma_sort_index_packet<int,uword> > packet_vec(N); std::vector< arma_sort_index_packet<int,uword> > packet_vec(N);
for(uword i=0; i<N; ++i) for(uword i=0; i<N; ++i)
{ {
packet_vec[i].val = int(arma_rng::randi<int>()); packet_vec[i].val = int(arma_rng::randi<int>());
packet_vec[i].index = i; packet_vec[i].index = i;
} }
arma_sort_index_helper_ascend comparator; arma_sort_index_helper_ascend comparator;
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 sp_auxlib_bones.hpp   sp_auxlib_bones.hpp 
// Copyright (C) 2013-2014 Ryan Curtin // Copyright (C) 2013-2015 Ryan Curtin
// Copyright (C) 2013-2014 Conrad Sanderson // Copyright (C) 2013-2015 Conrad Sanderson
// Copyright (C) 2013-2014 NICTA // Copyright (C) 2013-2015 NICTA
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup sp_auxlib //! \addtogroup sp_auxlib
//! @{ //! @{
//! wrapper for accesing external functions for sparse matrices defined in ARPACK //! wrapper for accesing external functions for sparse matrices defined in ARPACK
class sp_auxlib class sp_auxlib
skipping to change at line 39 skipping to change at line 39
// //
// eigs_gen() via ARPACK // eigs_gen() via ARPACK
template<typename T, typename T1> template<typename T, typename T1>
inline static bool eigs_gen(Col< std::complex<T> >& eigval, Mat< std::com plex<T> >& eigvec, const SpBase<T, T1>& X, const uword n_eigvals, const cha r* form_str, const T default_tol); inline static bool eigs_gen(Col< std::complex<T> >& eigval, Mat< std::com plex<T> >& eigvec, const SpBase<T, T1>& X, const uword n_eigvals, const cha r* form_str, const T default_tol);
template<typename T, typename T1> template<typename T, typename T1>
inline static bool eigs_gen(Col< std::complex<T> >& eigval, Mat< std::com plex<T> >& eigvec, const SpBase< std::complex<T>, T1>& X, const uword n_eig vals, const char* form_str, const T default_tol); inline static bool eigs_gen(Col< std::complex<T> >& eigval, Mat< std::com plex<T> >& eigvec, const SpBase< std::complex<T>, T1>& X, const uword n_eig vals, const char* form_str, const T default_tol);
//
// spsolve() via SuperLU
template<typename T1, typename T2>
inline static bool spsolve(Mat<typename T1::elem_type>& out, const SpBase
<typename T1::elem_type, T1>& A, const Base<typename T1::elem_type, T2>& B,
const superlu_opts& user_opts);
#if defined(ARMA_USE_SUPERLU)
template<typename eT>
inline static bool convert_to_supermatrix(superlu::SuperMatrix& out, co
nst SpMat<eT>& A);
template<typename eT>
inline static bool convert_to_supermatrix(superlu::SuperMatrix& out, co
nst Mat<eT>& A);
inline static void destroy_supermatrix(superlu::SuperMatrix& out);
#endif
private: private:
// calls arpack saupd()/naupd() because the code is so similar for each // calls arpack saupd()/naupd() because the code is so similar for each
// all of the extra variables are later used by seupd()/neupd(), but thos e // all of the extra variables are later used by seupd()/neupd(), but thos e
// functions are very different and we can't combine their code // functions are very different and we can't combine their code
template<typename eT, typename T, typename T1> template<typename eT, typename T, typename T1>
inline static void run_aupd inline static void run_aupd
( (
const uword n_eigvals, char* which, const SpProxy<T1>& p, const bool sy m, const uword n_eigvals, char* which, const SpProxy<T1>& p, const bool sy m,
 End of changes. 2 change blocks. 
3 lines changed or deleted 23 lines changed or added


 sp_auxlib_meat.hpp   sp_auxlib_meat.hpp 
// Copyright (C) 2013-2014 Ryan Curtin // Copyright (C) 2013-2015 Ryan Curtin
// Copyright (C) 2013-2014 Conrad Sanderson // Copyright (C) 2013-2015 Conrad Sanderson
// Copyright (C) 2013-2014 NICTA // Copyright (C) 2013-2015 NICTA
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup sp_auxlib //! \addtogroup sp_auxlib
//! @{ //! @{
inline inline
sp_auxlib::form_type sp_auxlib::form_type
skipping to change at line 410 skipping to change at line 410
arma_ignore(n_eigvals); arma_ignore(n_eigvals);
arma_ignore(form_str); arma_ignore(form_str);
arma_ignore(default_tol); arma_ignore(default_tol);
arma_stop("eigs_gen(): use of ARPACK needs to be enabled"); arma_stop("eigs_gen(): use of ARPACK needs to be enabled");
return false; return false;
} }
#endif #endif
} }
template<typename T1, typename T2>
inline
bool
sp_auxlib::spsolve(Mat<typename T1::elem_type>& X, const SpBase<typename T1
::elem_type, T1>& A_expr, const Base<typename T1::elem_type, T2>& B_expr, c
onst superlu_opts& user_opts)
{
arma_extra_debug_sigprint();
#if defined(ARMA_USE_SUPERLU)
{
// The goal is to solve the system A*X = B for the matrix X.
// The first thing we need to do is create SuperMatrix structures to ca
ll
// the SuperLU functions with. SuperLU will overwrite the B matrix wit
h
// the output matrix, so we'll unwrap B into X temporarily.
typedef typename T1::elem_type eT;
const unwrap_spmat<T1> tmp1(A_expr.get_ref());
const SpMat<eT>& A = tmp1.M;
X = B_expr.get_ref();
if(A.n_rows > A.n_cols)
{
arma_stop("spsolve(): solving over-determined systems currently not s
upported");
X.reset();
return false;
}
else if(A.n_rows < A.n_cols)
{
arma_stop("spsolve(): solving under-determined systems currently not
supported");
X.reset();
return false;
}
arma_debug_check( (A.n_rows != X.n_rows), "spsolve(): number of rows in
the given objects must be the same" );
if(A.is_empty() || X.is_empty())
{
X.zeros(A.n_cols, X.n_cols);
return true;
}
if(arma_config::debug)
{
bool overflow;
overflow = (A.n_nonzero > INT_MAX);
overflow = (A.n_rows > INT_MAX) || overflow;
overflow = (A.n_cols > INT_MAX) || overflow;
overflow = (X.n_rows > INT_MAX) || overflow;
overflow = (X.n_cols > INT_MAX) || overflow;
if(overflow)
{
arma_bad("spsolve(): integer overflow: matrix dimensions are too la
rge for integer type used by SuperLU");
}
}
superlu::SuperMatrix x; arrayops::inplace_set(reinterpret_cast<char*>(
&x), char(0), sizeof(superlu::SuperMatrix));
superlu::SuperMatrix a; arrayops::inplace_set(reinterpret_cast<char*>(
&a), char(0), sizeof(superlu::SuperMatrix));
const bool status_x = convert_to_supermatrix(x, X);
const bool status_a = convert_to_supermatrix(a, A);
if( (status_x == false) || (status_a == false) )
{
destroy_supermatrix(a);
destroy_supermatrix(x);
X.reset();
return false;
}
superlu::SuperMatrix l; arrayops::inplace_set(reinterpret_cast<char*>(
&l), char(0), sizeof(superlu::SuperMatrix));
superlu::SuperMatrix u; arrayops::inplace_set(reinterpret_cast<char*>(
&u), char(0), sizeof(superlu::SuperMatrix));
// Use default options.
superlu::superlu_options_t options;
superlu::set_default_opts(&options);
// process user_opts
if(user_opts.equilibrate == true) { options.Equil = superlu::YES; }
if(user_opts.equilibrate == false) { options.Equil = superlu::NO; }
if(user_opts.symmetric == true) { options.SymmetricMode = superlu::YE
S; }
if(user_opts.symmetric == false) { options.SymmetricMode = superlu::NO
; }
options.DiagPivotThresh = user_opts.pivot_thresh;
if(user_opts.permutation == superlu_opts::NATURAL) { options.Col
Perm = superlu::NATURAL; }
if(user_opts.permutation == superlu_opts::MMD_ATA) { options.Col
Perm = superlu::MMD_ATA; }
if(user_opts.permutation == superlu_opts::MMD_AT_PLUS_A) { options.Col
Perm = superlu::MMD_AT_PLUS_A; }
if(user_opts.permutation == superlu_opts::COLAMD) { options.Col
Perm = superlu::COLAMD; }
if(user_opts.refine == superlu_opts::REF_NONE) { options.IterRefine
= superlu::NOREFINE; }
if(user_opts.refine == superlu_opts::REF_SINGLE) { options.IterRefine
= superlu::SLU_SINGLE; }
if(user_opts.refine == superlu_opts::REF_DOUBLE) { options.IterRefine
= superlu::SLU_DOUBLE; }
if(user_opts.refine == superlu_opts::REF_EXTRA) { options.IterRefine
= superlu::SLU_EXTRA; }
// paranoia: use SuperLU's memory allocation, in case it reallocs
int* perm_c = (int*) superlu::malloc( (A.n_cols+1) * sizeof(int)); //
extra paranoia: increase array length by 1
int* perm_r = (int*) superlu::malloc( (A.n_rows+1) * sizeof(int));
arrayops::inplace_set(perm_c, 0, A.n_cols+1);
arrayops::inplace_set(perm_r, 0, A.n_rows+1);
superlu::SuperLUStat_t stat;
superlu::init_stat(&stat);
int info = 0; // Return code.
superlu::gssv<eT>(&options, &a, perm_c, perm_r, &l, &u, &x, &stat, &inf
o);
// Process the return code.
if( (info > 0) && (info <= int(A.n_cols)) )
{
std::stringstream tmp;
tmp << "spsolve(): could not solve system; LU factorisation completed
, but detected zero in U(" << (info-1) << ',' << (info-1) << ')';
arma_debug_warn(true, tmp.str());
}
else
if(info > int(A.n_cols))
{
std::stringstream tmp;
tmp << "spsolve(): memory allocation failure: could not allocate " <<
(info - int(A.n_cols)) << " bytes";
arma_debug_warn(true, tmp.str());
}
else
if(info < 0)
{
std::stringstream tmp;
tmp << "spsolve(): unknown SuperLU error code from gssv(): " << info;
arma_debug_warn(true, tmp.str());
}
superlu::free_stat(&stat);
superlu::free(perm_c);
superlu::free(perm_r);
// No need to extract the matrix, since it's still using the same memor
y.
destroy_supermatrix(u);
destroy_supermatrix(l);
destroy_supermatrix(a);
destroy_supermatrix(x);
return (info == 0);
}
#else
{
arma_ignore(X);
arma_ignore(A_expr);
arma_ignore(B_expr);
arma_stop("spsolve(): use of SuperLU needs to be enabled");
return false;
}
#endif
}
#if defined(ARMA_USE_SUPERLU)
template<typename eT>
inline
bool
sp_auxlib::convert_to_supermatrix(superlu::SuperMatrix& out, const SpMat<
eT>& A)
{
arma_extra_debug_sigprint();
// We store in column-major CSC.
out.Stype = superlu::SLU_NC;
if(is_float<eT>::value)
{
out.Dtype = superlu::SLU_S;
}
else
if(is_double<eT>::value)
{
out.Dtype = superlu::SLU_D;
}
else
if(is_supported_complex_float<eT>::value)
{
out.Dtype = superlu::SLU_C;
}
else
if(is_supported_complex_double<eT>::value)
{
out.Dtype = superlu::SLU_Z;
}
out.Mtype = superlu::SLU_GE; // Just a general matrix. We don't know m
ore now.
// We have to actually create the object which stores the data.
// This gets cleaned by destroy_supermatrix().
// We have to use SuperLU's stupid memory allocation routines since the
y are
// not guaranteed to be new and delete. See the comments in superlu_bo
nes.hpp
superlu::NCformat* nc = (superlu::NCformat*)superlu::malloc(sizeof(supe
rlu::NCformat));
if(nc == NULL) { return false; }
nc->nnz = A.n_nonzero;
nc->nzval = (void*) superlu::malloc(sizeof(eT) *
A.n_nonzero );
nc->colptr = (superlu::int_t*)superlu::malloc(sizeof(superlu::int_t) *
(A.n_cols + 1));
nc->rowind = (superlu::int_t*)superlu::malloc(sizeof(superlu::int_t) *
A.n_nonzero );
if( (nc->nzval == NULL) || (nc->colptr == NULL) || (nc->rowind == NULL)
) { return false; }
// Fill the matrix.
arrayops::copy((eT*) nc->nzval, A.values, A.n_nonzero);
// // These have to be copied by hand, because the types may differ.
// for (uword i = 0; i <= A.n_cols; ++i) { nc->colptr[i] = (int_t) A.c
ol_ptrs[i]; }
// for (uword i = 0; i < A.n_nonzero; ++i) { nc->rowind[i] = (int_t) A.
row_indices[i]; }
arrayops::convert(nc->colptr, A.col_ptrs, A.n_cols+1 );
arrayops::convert(nc->rowind, A.row_indices, A.n_nonzero);
out.nrow = A.n_rows;
out.ncol = A.n_cols;
out.Store = (void*) nc;
return true;
}
template<typename eT>
inline
bool
sp_auxlib::convert_to_supermatrix(superlu::SuperMatrix& out, const Mat<eT
>& A)
{
arma_extra_debug_sigprint();
// This is being stored as a dense matrix.
out.Stype = superlu::SLU_DN;
if(is_float<eT>::value)
{
out.Dtype = superlu::SLU_S;
}
else
if(is_double<eT>::value)
{
out.Dtype = superlu::SLU_D;
}
else
if(is_supported_complex_float<eT>::value)
{
out.Dtype = superlu::SLU_C;
}
else
if(is_supported_complex_double<eT>::value)
{
out.Dtype = superlu::SLU_Z;
}
out.Mtype = superlu::SLU_GE;
// We have to create the object that stores the data.
superlu::DNformat* dn = (superlu::DNformat*)superlu::malloc(sizeof(supe
rlu::DNformat));
if(dn == NULL) { return false; }
dn->lda = A.n_rows;
dn->nzval = (void*) A.memptr(); // re-use memory instead of copying
out.nrow = A.n_rows;
out.ncol = A.n_cols;
out.Store = (void*) dn;
return true;
}
inline
void
sp_auxlib::destroy_supermatrix(superlu::SuperMatrix& out)
{
arma_extra_debug_sigprint();
// Clean up.
if(out.Stype == superlu::SLU_NC)
{
superlu::destroy_compcol_mat(&out);
}
else
if(out.Stype == superlu::SLU_DN)
{
// superlu::destroy_dense_mat(&out);
// since dn->nzval is set to re-use memory from a Mat object (which m
anages its own memory),
// we cannot simply call superlu::destroy_dense_mat().
// Only the out.Store structure can be freed.
superlu::DNformat* dn = (superlu::DNformat*) out.Store;
if(dn != NULL) { superlu::free(dn); }
}
else
if(out.Stype == superlu::SLU_SC)
{
superlu::destroy_supernode_mat(&out);
}
else
{
// Uh, crap.
std::stringstream tmp;
tmp << "sp_auxlib::destroy_supermatrix(): unhandled Stype" << std::en
dl;
tmp << "Stype val: " << out.Stype << std::endl;
tmp << "Stype name: ";
if(out.Stype == superlu::SLU_NC) { tmp << "SLU_NC"; }
if(out.Stype == superlu::SLU_NCP) { tmp << "SLU_NCP"; }
if(out.Stype == superlu::SLU_NR) { tmp << "SLU_NR"; }
if(out.Stype == superlu::SLU_SC) { tmp << "SLU_SC"; }
if(out.Stype == superlu::SLU_SCP) { tmp << "SLU_SCP"; }
if(out.Stype == superlu::SLU_SR) { tmp << "SLU_SR"; }
if(out.Stype == superlu::SLU_DN) { tmp << "SLU_DN"; }
if(out.Stype == superlu::SLU_NR_loc) { tmp << "SLU_NR_loc"; }
arma_debug_warn(true, tmp.str());
arma_bad("sp_auxlib::destroy_supermatrix(): internal error");
}
}
#endif
template<typename eT, typename T, typename T1> template<typename eT, typename T, typename T1>
inline inline
void void
sp_auxlib::run_aupd sp_auxlib::run_aupd
( (
const uword n_eigvals, char* which, const SpProxy<T1>& p, const bool sym, const uword n_eigvals, char* which, const SpProxy<T1>& p, const bool sym,
blas_int& n, eT& tol, blas_int& n, eT& tol,
podarray<T>& resid, blas_int& ncv, podarray<T>& v, blas_int& ldv, podarray<T>& resid, blas_int& ncv, podarray<T>& v, blas_int& ldv,
podarray<blas_int>& iparam, podarray<blas_int>& ipntr, podarray<blas_int>& iparam, podarray<blas_int>& ipntr,
podarray<T>& workd, podarray<T>& workl, blas_int& lworkl, podarray<eT>& r work, podarray<T>& workd, podarray<T>& workl, blas_int& lworkl, podarray<eT>& r work,
 End of changes. 2 change blocks. 
3 lines changed or deleted 374 lines changed or added


 spop_misc_bones.hpp   spop_misc_bones.hpp 
// Copyright (C) 2012 Conrad Sanderson // Copyright (C) 2012-2015 Conrad Sanderson
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup spop_misc //! \addtogroup spop_misc
//! @{ //! @{
class spop_scalar_times class spop_scalar_times
{ {
public: public:
template<typename T1> template<typename T1>
arma_hot inline static void apply(SpMat<typename T1::elem_type>& out, con st SpOp<T1, spop_scalar_times>& in); inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T 1, spop_scalar_times>& in);
}; };
class spop_square class spop_square
{ {
public: public:
template<typename T1> template<typename T1>
arma_hot inline static void apply(SpMat<typename T1::elem_type>& out, con st SpOp<T1, spop_square>& in); inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T 1, spop_square>& in);
}; };
class spop_sqrt class spop_sqrt
{ {
public: public:
template<typename T1> template<typename T1>
arma_hot inline static void apply(SpMat<typename T1::elem_type>& out, con st SpOp<T1, spop_sqrt>& in); inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T 1, spop_sqrt>& in);
}; };
class spop_abs class spop_abs
{ {
public: public:
template<typename T1> template<typename T1>
arma_hot inline static void apply(SpMat<typename T1::elem_type>& out, con st SpOp<T1, spop_abs>& in); inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T 1, spop_abs>& in);
}; };
class spop_cx_abs class spop_cx_abs
{ {
public: public:
template<typename T1> template<typename T1>
arma_hot inline static void apply(SpMat<typename T1::pod_type>& out, cons inline static void apply(SpMat<typename T1::pod_type>& out, const mtSpOp<
t mtSpOp<typename T1::pod_type, T1, spop_cx_abs>& in); typename T1::pod_type, T1, spop_cx_abs>& in);
};
class spop_repmat
{
public:
template<typename T1>
inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T
1, spop_repmat>& in);
template<typename eT>
inline static void apply_noalias(SpMat<eT>& out, const SpMat<eT>& X, cons
t uword copies_per_row, const uword copies_per_col);
}; };
//! @} //! @}
 End of changes. 6 change blocks. 
7 lines changed or deleted 20 lines changed or added


 spop_misc_meat.hpp   spop_misc_meat.hpp 
// Copyright (C) 2012 Conrad Sanderson // Copyright (C) 2012-2015 Conrad Sanderson
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup spop_misc //! \addtogroup spop_misc
//! @{ //! @{
namespace priv namespace priv
{ {
skipping to change at line 122 skipping to change at line 122
template<typename T1> template<typename T1>
inline inline
void void
spop_cx_abs::apply(SpMat<typename T1::pod_type>& out, const mtSpOp<typename T1::pod_type, T1, spop_cx_abs>& in) spop_cx_abs::apply(SpMat<typename T1::pod_type>& out, const mtSpOp<typename T1::pod_type, T1, spop_cx_abs>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
out.init_xform_mt(in.m, priv::functor_cx_abs()); out.init_xform_mt(in.m, priv::functor_cx_abs());
} }
template<typename T1>
inline
void
spop_repmat::apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_
repmat>& in)
{
arma_extra_debug_sigprint();
typedef typename T1::elem_type eT;
const unwrap_spmat<T1> tmp(in.m);
const SpMat<eT>& X = tmp.M;
const uword copies_per_row = in.aux_uword_a;
const uword copies_per_col = in.aux_uword_b;
if(&out != &X)
{
spop_repmat::apply_noalias(out, X, copies_per_row, copies_per_col);
}
else
{
SpMat<eT> out2;
spop_repmat::apply_noalias(out2, X, copies_per_row, copies_per_col);
out.steal_mem(out2);
}
}
template<typename eT>
inline
void
spop_repmat::apply_noalias(SpMat<eT>& out, const SpMat<eT>& X, const uword
copies_per_row, const uword copies_per_col)
{
arma_extra_debug_sigprint();
// out.set_size(X.n_rows * copies_per_row, X.n_cols * copies_per_col);
//
// const uword out_n_rows = out.n_rows;
// const uword out_n_cols = out.n_cols;
//
// if( (out_n_rows > 0) && (out_n_cols > 0) )
// {
// for(uword col = 0; col < out_n_cols; col += X.n_cols)
// for(uword row = 0; row < out_n_rows; row += X.n_rows)
// {
// out.submat(row, col, row+X.n_rows-1, col+X.n_cols-1) = X;
// }
// }
SpMat<eT> tmp(X.n_rows * copies_per_row, X.n_cols);
if(tmp.n_elem > 0)
{
for(uword row = 0; row < tmp.n_rows; row += X.n_rows)
{
tmp.submat(row, 0, row+X.n_rows-1, X.n_cols-1) = X;
}
}
out.set_size(X.n_rows * copies_per_row, X.n_cols * copies_per_col);
const uword out_n_rows = out.n_rows;
const uword out_n_cols = out.n_cols;
if( (out_n_rows > 0) && (out_n_cols > 0) )
{
for(uword col = 0; col < out_n_cols; col += X.n_cols)
{
out.submat(0, col, out_n_rows-1, col+X.n_cols-1) = tmp;
}
}
}
//! @} //! @}
 End of changes. 2 change blocks. 
1 lines changed or deleted 77 lines changed or added


 typedef_elem.hpp   typedef_elem.hpp 
// Copyright (C) 2008-2013 Conrad Sanderson // Copyright (C) 2008-2015 Conrad Sanderson
// Copyright (C) 2008-2013 NICTA (www.nicta.com.au) // Copyright (C) 2008-2015 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup typedef_elem //! \addtogroup typedef_elem
//! @{ //! @{
#if UCHAR_MAX >= 0xff #if UCHAR_MAX >= 0xff
typedef unsigned char u8; typedef unsigned char u8;
skipping to change at line 58 skipping to change at line 58
typedef unsigned long long u64; typedef unsigned long long u64;
typedef long long s64; typedef long long s64;
#elif ULONG_MAX >= 0xffffffffffffffff #elif ULONG_MAX >= 0xffffffffffffffff
typedef unsigned long u64; typedef unsigned long u64;
typedef long s64; typedef long s64;
#define ARMA_U64_IS_LONG #define ARMA_U64_IS_LONG
#elif defined(UINT64_MAX) #elif defined(UINT64_MAX)
typedef uint64_t u64; typedef uint64_t u64;
typedef int64_t s64; typedef int64_t s64;
#else #else
#error "don't know how to typedef 'u64' on this system; please disabl e ARMA_64BIT_WORD and/or ARMA_USE_U64S64" #error "don't know how to typedef 'u64' on this system; please disabl e ARMA_64BIT_WORD"
#endif #endif
#endif #endif
#if !defined(ARMA_USE_U64S64) || (defined(ARMA_USE_U64S64) && !defined(ARMA _U64_IS_LONG)) #if !defined(ARMA_USE_U64S64) || (defined(ARMA_USE_U64S64) && !defined(ARMA _U64_IS_LONG))
#define ARMA_ALLOW_LONG #define ARMA_ALLOW_LONG
#endif #endif
typedef unsigned long ulng_t; typedef unsigned long ulng_t;
typedef long slng_t; typedef long slng_t;
#if !defined(ARMA_64BIT_WORD) #if defined(ARMA_64BIT_WORD)
typedef u32 uword;
typedef s32 sword;
typedef u16 uhword;
typedef s16 shword;
#define ARMA_MAX_UWORD 0xffffffff
#define ARMA_MAX_UHWORD 0xffff
#else
typedef u64 uword; typedef u64 uword;
typedef s64 sword; typedef s64 sword;
typedef u32 uhword; typedef u32 uhword;
typedef s32 shword; typedef s32 shword;
#define ARMA_MAX_UWORD 0xffffffffffffffff #define ARMA_MAX_UWORD 0xffffffffffffffff
#define ARMA_MAX_UHWORD 0xffffffff #define ARMA_MAX_UHWORD 0xffffffff
#endif #else
typedef u32 uword;
typedef s32 sword;
typedef std::complex<float> cx_float; typedef u16 uhword;
typedef std::complex<double> cx_double; typedef s16 shword;
#define ARMA_MAX_UWORD 0xffffffff
#define ARMA_MAX_UHWORD 0xffff
#endif
#if defined(ARMA_BLAS_LONG_LONG) #if defined(ARMA_BLAS_LONG_LONG)
typedef long long blas_int; typedef long long blas_int;
#define ARMA_MAX_BLAS_INT 0x7fffffffffffffffULL
#elif defined(ARMA_BLAS_LONG) #elif defined(ARMA_BLAS_LONG)
typedef long blas_int; typedef long blas_int;
#define ARMA_MAX_BLAS_INT 0x7fffffffffffffffUL
#else #else
typedef int blas_int; typedef int blas_int;
#define ARMA_MAX_BLAS_INT 0x7fffffffU
#endif #endif
typedef std::complex<float> cx_float;
typedef std::complex<double> cx_double;
typedef void* void_ptr; typedef void* void_ptr;
//! @} //! @}
 End of changes. 9 change blocks. 
16 lines changed or deleted 19 lines changed or added


 unwrap.hpp   unwrap.hpp 
// Copyright (C) 2008-2014 Conrad Sanderson // Copyright (C) 2008-2015 Conrad Sanderson
// Copyright (C) 2008-2014 NICTA (www.nicta.com.au) // Copyright (C) 2008-2015 NICTA (www.nicta.com.au)
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! \addtogroup unwrap //! \addtogroup unwrap
//! @{ //! @{
template<typename T1> template<typename T1>
struct unwrap_default struct unwrap_default
 End of changes. 1 change blocks. 
2 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/