Proxy.hpp   Proxy.hpp 
skipping to change at line 820 skipping to change at line 820
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.get_n_rows() ; } arma_inline uword get_n_rows() const { return is_row ? 1 : Q.get_n_rows() ; }
arma_inline uword get_n_cols() const { return is_col ? 1 : Q.get_n_cols() ; } arma_inline uword get_n_cols() const { return is_col ? 1 : Q.get_n_cols() ; }
arma_inline uword get_n_elem() const { return Q.get_n_elem(); } arma_inline uword get_n_elem() const { return Q.get_n_elem(); }
arma_inline elem_type operator[] (const uword i) const { return Q[i]; } arma_inline elem_type operator[] (const uword i) const { return Q[i]; }
arma_inline elem_type at (const uword row, const uword col) const { return Q.at(row, col); } arma_inline elem_type at (const uword row, const uword col) const { return Q.at(row, col); }
arma_inline ea_type get_ea() const { return Q; } arma_inline ea_type get_ea() const { return Q; }
template<typename eT2> template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (Q.P1.is_alia s(X) || Q.P2.is_alias(X)); } arma_inline bool is_alias(const Mat<eT2>& X) const { return (Q.P1.is_alia s(X) || Q.P2.is_alias(X)); }
}; };
template<typename out_eT, typename T1, typename op_type> template<typename out_eT, typename T1, typename op_type>
class Proxy< mtOp<out_eT, T1, op_type> > class Proxy< mtOp<out_eT, T1, op_type> >
{ {
public: public:
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 arma_version.hpp   arma_version.hpp 
skipping to change at line 18 skipping to change at line 18
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup arma_version //! \addtogroup arma_version
//! @{ //! @{
#define ARMA_VERSION_MAJOR 3 #define ARMA_VERSION_MAJOR 3
#define ARMA_VERSION_MINOR 1 #define ARMA_VERSION_MINOR 1
#define ARMA_VERSION_PATCH 94 #define ARMA_VERSION_PATCH 95
#define ARMA_VERSION_NAME "v3.2 beta 4" #define ARMA_VERSION_NAME "v3.2 beta 5"
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. 1 change blocks. 
2 lines changed or deleted 2 lines changed or added


 fn_accu.hpp   fn_accu.hpp 
skipping to change at line 40 skipping to change at line 40
uword i,j; uword i,j;
for(i=0, j=1; j < n_elem; i+=2, j+=2) for(i=0, j=1; j < n_elem; i+=2, j+=2)
{ {
val1 += A[i]; val1 += A[i];
val2 += A[j]; val2 += A[j];
} }
if(i < n_elem) if(i < n_elem)
{ {
val1 += A[i]; val1 += A[i]; // equivalent to: val1 += A[n_elem-1];
} }
return (val1 + val2); return (val1 + val2);
} }
template<typename T1> template<typename T1>
arma_hot arma_hot
inline inline
typename T1::elem_type typename T1::elem_type
accu_proxy_at(const Proxy<T1>& P) accu_proxy_at(const Proxy<T1>& P)
skipping to change at line 82 skipping to change at line 82
} }
} }
return val; return val;
} }
//! accumulate the elements of a matrix //! accumulate the elements of a matrix
template<typename T1> template<typename T1>
arma_hot arma_hot
inline inline
typename T1::elem_type typename enable_if2< is_arma_type<T1>::value, typename T1::elem_type >::res
accu(const Base<typename T1::elem_type,T1>& X) ult
accu(const T1& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const Proxy<T1> P(X.get_ref()); const Proxy<T1> P(X);
return (Proxy<T1>::prefer_at_accessor == false) ? accu_proxy_linear(P) : accu_proxy_at(P); return (Proxy<T1>::prefer_at_accessor == false) ? accu_proxy_linear(P) : accu_proxy_at(P);
} }
//! explicit handling of Hamming norm (also known as zero norm) //! explicit handling of Hamming norm (also known as zero norm)
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
uword uword
accu(const mtOp<uword,T1,op_rel_noteq>& X) accu(const mtOp<uword,T1,op_rel_noteq>& X)
skipping to change at line 148 skipping to change at line 148
if(P.at(row,col) != val) { ++n_nonzero; } if(P.at(row,col) != val) { ++n_nonzero; }
} }
} }
} }
return n_nonzero; return n_nonzero;
} }
//! accumulate the elements of a subview (submatrix) //! accumulate the elements of a subview (submatrix)
template<typename eT> template<typename eT>
arma_hot
arma_pure arma_pure
arma_warn_unused arma_warn_unused
inline inline
eT eT
accu(const subview<eT>& X) accu(const subview<eT>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const uword X_n_rows = X.n_rows; const uword X_n_rows = X.n_rows;
const uword X_n_cols = X.n_cols; const uword X_n_cols = X.n_cols;
skipping to change at line 199 skipping to change at line 200
for(uword col=0; col < X_n_cols; ++col) for(uword col=0; col < X_n_cols; ++col)
{ {
val += arrayops::accumulate( X.colptr(col), X_n_rows ); val += arrayops::accumulate( X.colptr(col), X_n_rows );
} }
} }
return val; return val;
} }
template<typename eT> template<typename eT>
arma_hot
arma_pure arma_pure
arma_warn_unused arma_warn_unused
inline inline
eT eT
accu(const subview_col<eT>& X) accu(const subview_col<eT>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return arrayops::accumulate( X.colptr(0), X.n_rows ); return arrayops::accumulate( X.colptr(0), X.n_rows );
} }
 End of changes. 5 change blocks. 
4 lines changed or deleted 7 lines changed or added


 fn_cumsum.hpp   fn_cumsum.hpp 
skipping to change at line 21 skipping to change at line 21
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup fn_cumsum //! \addtogroup fn_cumsum
//! @{ //! @{
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_cumsum_mat> const Op<T1, op_cumsum_mat>
cumsum cumsum
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword dim = 0, const uword dim = 0,
const typename enable_if<resolves_to_vector<T1>::value == false>::result* const typename enable_if< is_arma_type<T1>::value == true >::resul
junk1 = 0, t* junk1 = 0,
const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = const typename enable_if< resolves_to_vector<T1>::value == false >::resul
0 t* junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return Op<T1, op_cumsum_mat>(X.get_ref(), dim, 0); return Op<T1, op_cumsum_mat>(X, dim, 0);
} }
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_cumsum_mat> const Op<T1, op_cumsum_mat>
cumsum cumsum
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword dim, const uword dim,
const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk); arma_ignore(junk);
return Op<T1, op_cumsum_mat>(X.get_ref(), dim, 0); return Op<T1, op_cumsum_mat>(X, dim, 0);
} }
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_cumsum_vec> const Op<T1, op_cumsum_vec>
cumsum cumsum
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const arma_empty_class junk1 = arma_empty_class(), const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return Op<T1, op_cumsum_vec>(X.get_ref()); return Op<T1, op_cumsum_vec>(X);
} }
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_cumsum_vec> const Op<Op<T1, op_cumsum_vec>, op_cumsum_mat>
cumsum cumsum
( (
const T1& X, const Op<T1, op_cumsum_vec>& X,
const uword dim,
const typename enable_if<resolves_to_vector<T1>::value == true>::result*
junk = 0
)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
return Op<Op<T1, op_cumsum_vec>, op_cumsum_mat>(X, dim, 0);
}
template<typename T1>
arma_inline
const Op<Op<T1, op_cumsum_vec>, op_cumsum_vec>
cumsum
(
const Op<T1, op_cumsum_vec>& X,
const arma_empty_class junk1 = arma_empty_class(), const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<is_basevec<T1>::value == true>::result* junk2 = 0 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return Op<T1, op_cumsum_vec>(X); return Op<Op<T1, op_cumsum_vec>, op_cumsum_vec>(X);
} }
template<typename T> template<typename T>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
const typename arma_scalar_only<T>::result & const typename arma_scalar_only<T>::result &
cumsum(const T& x) cumsum(const T& x)
{ {
return x; return x;
} }
 End of changes. 11 change blocks. 
14 lines changed or deleted 31 lines changed or added


 fn_max.hpp   fn_max.hpp 
skipping to change at line 28 skipping to change at line 28
//! The dimension, along which the maxima are found, is set via 'dim'. //! The dimension, along which the maxima are found, is set via 'dim'.
//! For dim = 0, the maximum value of each column is found (i.e. searches b y traversing across rows). //! For dim = 0, the maximum value of each column is found (i.e. searches b y traversing across rows).
//! For dim = 1, the maximum value of each row is found (i.e. searches by t raversing across columns). //! For dim = 1, the maximum value of each row is found (i.e. searches by t raversing across columns).
//! The default is dim = 0. //! The default is dim = 0.
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_max> const Op<T1, op_max>
max max
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword dim = 0, const uword dim = 0,
const typename enable_if<resolves_to_vector<T1>::value == false>::result* const typename enable_if< is_arma_type<T1>::value == true >::resul
junk1 = 0, t* junk1 = 0,
const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = const typename enable_if< resolves_to_vector<T1>::value == false >::resul
0 t* junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return Op<T1, op_max>(X.get_ref(), dim, 0); return Op<T1, op_max>(X, dim, 0);
} }
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_max> const Op<T1, op_max>
max max
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword dim, const uword dim,
const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk); arma_ignore(junk);
return Op<T1, op_max>(X.get_ref(), dim, 0); return Op<T1, op_max>(X, dim, 0);
}
//! \brief
//! Immediate 'find maximum value' operation,
//! invoked, for example, by: max(max(A))
template<typename T1>
inline
arma_warn_unused
typename T1::elem_type
max(const Op<T1, op_max>& in)
{
arma_extra_debug_sigprint();
arma_extra_debug_print("max(): two consecutive max() calls detected");
return op_max::max(in.m);
}
template<typename T1>
arma_inline
const Op< Op<T1, op_max>, op_max>
max(const Op<T1, op_max>& in, const uword dim)
{
arma_extra_debug_sigprint();
return Op< Op<T1, op_max>, op_max>(in, dim, 0);
} }
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
typename T1::elem_type typename T1::elem_type
max max
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const arma_empty_class junk1 = arma_empty_class(), const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return op_max::max(X); return op_max::max(X);
} }
//! \brief
//! Immediate 'find maximum value' operation,
//! invoked, for example, by: max(max(A))
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
typename T1::elem_type typename T1::elem_type
max max(const Op<T1, op_max>& in)
(
const T1& X,
const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<is_basevec<T1>::value == true>::result* junk2 =
0
)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_extra_debug_print("max(): two consecutive max() calls detected");
arma_ignore(junk2);
return op_max::max(X); return op_max::max(in.m);
}
template<typename T1>
arma_inline
const Op< Op<T1, op_max>, op_max>
max(const Op<T1, op_max>& in, const uword dim)
{
arma_extra_debug_sigprint();
return Op< Op<T1, op_max>, op_max>(in, dim, 0);
} }
template<typename T> template<typename T>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
const typename arma_scalar_only<T>::result & const typename arma_scalar_only<T>::result &
max(const T& x) max(const T& x)
{ {
return x; return x;
} }
 End of changes. 10 change blocks. 
44 lines changed or deleted 25 lines changed or added


 fn_mean.hpp   fn_mean.hpp 
skipping to change at line 21 skipping to change at line 21
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup fn_mean //! \addtogroup fn_mean
//! @{ //! @{
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_mean> const Op<T1, op_mean>
mean mean
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword dim = 0, const uword dim = 0,
const typename enable_if<resolves_to_vector<T1>::value == false>::result* const typename enable_if< is_arma_type<T1>::value == true >::resul
junk1 = 0, t* junk1 = 0,
const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = const typename enable_if< resolves_to_vector<T1>::value == false >::resul
0 t* junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return Op<T1, op_mean>(X.get_ref(), dim, 0); return Op<T1, op_mean>(X, dim, 0);
} }
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_mean> const Op<T1, op_mean>
mean mean
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword dim, const uword dim,
const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk); arma_ignore(junk);
return Op<T1, op_mean>(X.get_ref(), dim, 0); return Op<T1, op_mean>(X, dim, 0);
}
template<typename T1>
inline
arma_warn_unused
typename T1::elem_type
mean
(
const T1& X,
const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<resolves_to_vector<T1>::value == true>::result*
junk2 = 0
)
{
arma_extra_debug_sigprint();
arma_ignore(junk1);
arma_ignore(junk2);
return op_mean::mean_all(X);
} }
//! \brief //! \brief
//! Immediate 'find mean value' operation, //! Immediate 'find mean value' operation,
//! invoked, for example, by: mean(mean(A)) //! invoked, for example, by: mean(mean(A))
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
typename T1::elem_type typename T1::elem_type
mean(const Op<T1, op_mean>& in) mean(const Op<T1, op_mean>& in)
skipping to change at line 77 skipping to change at line 95
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op< Op<T1, op_mean>, op_mean> const Op< Op<T1, op_mean>, op_mean>
mean(const Op<T1, op_mean>& in, const uword dim) mean(const Op<T1, op_mean>& in, const uword dim)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return Op< Op<T1, op_mean>, op_mean>(in, dim, 0); return Op< Op<T1, op_mean>, op_mean>(in, dim, 0);
} }
template<typename T1>
inline
arma_warn_unused
typename T1::elem_type
mean
(
const Base<typename T1::elem_type,T1>& X,
const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<resolves_to_vector<T1>::value == true>::result*
junk2 = 0
)
{
arma_extra_debug_sigprint();
arma_ignore(junk1);
arma_ignore(junk2);
return op_mean::mean_all(X);
}
template<typename T1>
inline
arma_warn_unused
typename T1::elem_type
mean
(
const T1& X,
const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<is_basevec<T1>::value == true>::result* junk2 =
0
)
{
arma_extra_debug_sigprint();
arma_ignore(junk1);
arma_ignore(junk2);
return op_mean::mean_all(X);
}
template<typename T> template<typename T>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
const typename arma_scalar_only<T>::result & const typename arma_scalar_only<T>::result &
mean(const T& x) mean(const T& x)
{ {
return x; return x;
} }
//! @} //! @}
 End of changes. 6 change blocks. 
46 lines changed or deleted 27 lines changed or added


 fn_median.hpp   fn_median.hpp 
skipping to change at line 21 skipping to change at line 21
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup fn_median //! \addtogroup fn_median
//! @{ //! @{
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_median> const Op<T1, op_median>
median median
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword dim = 0, const uword dim = 0,
const typename enable_if<resolves_to_vector<T1>::value == false>::result* const typename enable_if< is_arma_type<T1>::value == true >::resul
junk1 = 0, t* junk1 = 0,
const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = const typename enable_if< resolves_to_vector<T1>::value == false >::resul
0 t* junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return Op<T1, op_median>(X.get_ref(), dim, 0); return Op<T1, op_median>(X, dim, 0);
} }
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_median> const Op<T1, op_median>
median median
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword dim, const uword dim,
const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk); arma_ignore(junk);
return Op<T1, op_median>(X.get_ref(), dim, 0); return Op<T1, op_median>(X, dim, 0);
}
template<typename T1>
inline
arma_warn_unused
typename T1::elem_type
median
(
const Base<typename T1::elem_type,T1>& X,
const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<resolves_to_vector<T1>::value == true>::result*
junk2 = 0
)
{
arma_extra_debug_sigprint();
arma_ignore(junk1);
arma_ignore(junk2);
return op_median::median_vec(X.get_ref());
} }
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
typename T1::elem_type typename T1::elem_type
median median
( (
const T1& X, const T1& X,
const arma_empty_class junk1 = arma_empty_class(), const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<is_basevec<T1>::value == true>::result* junk2 = 0 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return op_median::median_vec(X); return op_median::median_vec(X);
} }
template<typename T> template<typename T>
 End of changes. 6 change blocks. 
28 lines changed or deleted 9 lines changed or added


 fn_min.hpp   fn_min.hpp 
skipping to change at line 28 skipping to change at line 28
//! The dimension, along which the minima are found, is set via 'dim'. //! The dimension, along which the minima are found, is set via 'dim'.
//! For dim = 0, the minimum value of each column is found (i.e. searches b y traversing across rows). //! For dim = 0, the minimum value of each column is found (i.e. searches b y traversing across rows).
//! For dim = 1, the minimum value of each row is found (i.e. searches by t raversing across columns). //! For dim = 1, the minimum value of each row is found (i.e. searches by t raversing across columns).
//! The default is dim = 0. //! The default is dim = 0.
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_min> const Op<T1, op_min>
min min
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword dim = 0, const uword dim = 0,
const typename enable_if<resolves_to_vector<T1>::value == false>::result* const typename enable_if< is_arma_type<T1>::value == true >::resul
junk1 = 0, t* junk1 = 0,
const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = const typename enable_if< resolves_to_vector<T1>::value == false >::resul
0 t* junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return Op<T1, op_min>(X.get_ref(), dim, 0); return Op<T1, op_min>(X, dim, 0);
} }
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_min> const Op<T1, op_min>
min min
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword dim, const uword dim,
const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk); arma_ignore(junk);
return Op<T1, op_min>(X.get_ref(), dim, 0); return Op<T1, op_min>(X, dim, 0);
}
//! \brief
//! Immediate 'find minimum value' operation,
//! invoked, for example, by: min(min(A))
template<typename T1>
inline
arma_warn_unused
typename T1::elem_type
min(const Op<T1, op_min>& in)
{
arma_extra_debug_sigprint();
arma_extra_debug_print("min(): two consecutive min() calls detected");
return op_min::min(in.m);
}
template<typename T1>
arma_inline
const Op< Op<T1, op_min>, op_min>
min(const Op<T1, op_min>& in, const uword dim)
{
arma_extra_debug_sigprint();
return Op< Op<T1, op_min>, op_min>(in, dim, 0);
} }
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
typename T1::elem_type typename T1::elem_type
min min
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const arma_empty_class junk1 = arma_empty_class(), const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return op_min::min(X); return op_min::min(X);
} }
//! \brief
//! Immediate 'find minimum value' operation,
//! invoked, for example, by: min(min(A))
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
typename T1::elem_type typename T1::elem_type
min min(const Op<T1, op_min>& in)
(
const T1& X,
const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<is_basevec<T1>::value == true>::result* junk2 =
0
)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_extra_debug_print("min(): two consecutive min() calls detected");
arma_ignore(junk2);
return op_min::min(X); return op_min::min(in.m);
}
template<typename T1>
arma_inline
const Op< Op<T1, op_min>, op_min>
min(const Op<T1, op_min>& in, const uword dim)
{
arma_extra_debug_sigprint();
return Op< Op<T1, op_min>, op_min>(in, dim, 0);
} }
template<typename T> template<typename T>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
const typename arma_scalar_only<T>::result & const typename arma_scalar_only<T>::result &
min(const T& x) min(const T& x)
{ {
return x; return x;
} }
 End of changes. 10 change blocks. 
44 lines changed or deleted 25 lines changed or added


 fn_prod.hpp   fn_prod.hpp 
skipping to change at line 29 skipping to change at line 29
//! For dim = 0, find the sum of each column (i.e. traverse across rows) //! For dim = 0, find the sum of each column (i.e. traverse across rows)
//! For dim = 1, find the sum of each row (i.e. traverse across columns) //! For dim = 1, find the sum of each row (i.e. traverse across columns)
//! The default is dim = 0. //! The default is dim = 0.
//! NOTE: this function works differently than in Matlab/Octave. //! NOTE: this function works differently than in Matlab/Octave.
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_prod> const Op<T1, op_prod>
prod prod
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword dim = 0, const uword dim = 0,
const typename enable_if<resolves_to_vector<T1>::value == false>::result* const typename enable_if< is_arma_type<T1>::value == true >::resul
junk1 = 0, t* junk1 = 0,
const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = const typename enable_if< resolves_to_vector<T1>::value == false >::resul
0 t* junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return Op<T1, op_prod>(X.get_ref(), dim, 0); return Op<T1, op_prod>(X, dim, 0);
} }
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_prod> const Op<T1, op_prod>
prod prod
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword dim, const uword dim,
const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk); arma_ignore(junk);
return Op<T1, op_prod>(X.get_ref(), dim, 0); return Op<T1, op_prod>(X, dim, 0);
}
//! \brief
//! Immediate 'product of all values' operation,
//! invoked, for example, by: prod(prod(A))
template<typename T1>
inline
typename T1::elem_type
prod(const Op<T1, op_prod>& in)
{
arma_extra_debug_sigprint();
arma_extra_debug_print("prod(): two consecutive prod() calls detected");
return op_prod::prod( in.m );
}
template<typename T1>
inline
const Op<Op<T1, op_prod>, op_prod>
prod(const Op<T1, op_prod>& in, const uword dim)
{
arma_extra_debug_sigprint();
return Op<Op<T1, op_prod>, op_prod>(in, dim, 0);
} }
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
typename T1::elem_type typename T1::elem_type
prod prod
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const arma_empty_class junk1 = arma_empty_class(), const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return op_prod::prod( X.get_ref() ); return op_prod::prod( X );
} }
//! \brief
//! Immediate 'product of all values' operation,
//! invoked, for example, by: prod(prod(A))
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
typename T1::elem_type typename T1::elem_type
prod prod(const Op<T1, op_prod>& in)
(
const T1& X,
const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<is_basevec<T1>::value == true>::result* junk2 =
0
)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_extra_debug_print("prod(): two consecutive prod() calls detected");
arma_ignore(junk2);
return op_prod::prod(X); return op_prod::prod( in.m );
}
template<typename T1>
inline
const Op<Op<T1, op_prod>, op_prod>
prod(const Op<T1, op_prod>& in, const uword dim)
{
arma_extra_debug_sigprint();
return Op<Op<T1, op_prod>, op_prod>(in, dim, 0);
} }
template<typename T> template<typename T>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
const typename arma_scalar_only<T>::result & const typename arma_scalar_only<T>::result &
prod(const T& x) prod(const T& x)
{ {
return x; return x;
} }
 End of changes. 11 change blocks. 
45 lines changed or deleted 27 lines changed or added


 fn_stddev.hpp   fn_stddev.hpp 
skipping to change at line 21 skipping to change at line 21
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup fn_stddev //! \addtogroup fn_stddev
//! @{ //! @{
template<typename T1> template<typename T1>
inline inline
const mtOp<typename T1::pod_type, T1, op_stddev> const mtOp<typename T1::pod_type, T1, op_stddev>
stddev stddev
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword norm_type = 0, const uword norm_type = 0,
const uword dim = 0, const uword dim = 0,
const typename enable_if<resolves_to_vector<T1>::value == false>::result* const typename enable_if< is_arma_type<T1>::value == true >::resul
junk1 = 0, t* junk1 = 0,
const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = const typename enable_if< resolves_to_vector<T1>::value == false >::resul
0 t* junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return mtOp<typename T1::pod_type, T1, op_stddev>(X.get_ref(), norm_type, dim); return mtOp<typename T1::pod_type, T1, op_stddev>(X, norm_type, dim);
} }
template<typename T1> template<typename T1>
inline inline
const mtOp<typename T1::pod_type, T1, op_stddev> const mtOp<typename T1::pod_type, T1, op_stddev>
stddev stddev
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword norm_type, const uword norm_type,
const uword dim, const uword dim,
const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk); arma_ignore(junk);
return mtOp<typename T1::pod_type, T1, op_stddev>(X.get_ref(), norm_type, dim); return mtOp<typename T1::pod_type, T1, op_stddev>(X, norm_type, dim);
} }
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
typename T1::pod_type typename T1::pod_type
stddev stddev
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword norm_type = 0, const uword norm_type = 0,
const arma_empty_class junk1 = arma_empty_class(), const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return std::sqrt( op_var::var_vec(X.get_ref(), norm_type) ); return std::sqrt( op_var::var_vec(X, norm_type) );
} }
template<typename T1> template<typename T>
inline arma_inline
arma_warn_unused arma_warn_unused
typename T1::pod_type const typename arma_scalar_only<T>::result
stddev stddev(const T&)
(
const T1& X,
const uword norm_type = 0,
const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<is_basevec<T1>::value == true>::result* junk2 =
0
)
{ {
arma_extra_debug_sigprint(); return T(0);
arma_ignore(junk1);
arma_ignore(junk2);
return std::sqrt( op_var::var_vec(X, norm_type) );
} }
//! @} //! @}
 End of changes. 10 change blocks. 
26 lines changed or deleted 15 lines changed or added


 fn_sum.hpp   fn_sum.hpp 
skipping to change at line 19 skipping to change at line 19
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup fn_sum //! \addtogroup fn_sum
//! @{ //! @{
//! \brief //! \brief
//! Delayed sum of elements of a matrix along a specified dimension (either rows or columns). //! Delayed sum of elements of a matrix along a specified dimension (either rows or columns).
//! The result is stored in a dense matrix that has either one column or on e row. //! The result is stored in a dense matrix that has either one column or on e row.
//! For dim = 0, find the sum of each column. //! For dim = 0, find the sum of each column (traverse across rows)
//! For dim = 1, find the sum of each row. //! For dim = 1, find the sum of each row (traverse across columns)
//! The default is dim = 0. //! The default is dim = 0.
//! NOTE: this function works differently than in Matlab/Octave. //! NOTE: the dim argument is different than in Matlab/Octave.
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_sum> const Op<T1, op_sum>
sum sum
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword dim = 0, const uword dim = 0,
const typename enable_if<resolves_to_vector<T1>::value == false>::result* const typename enable_if< is_arma_type<T1>::value == true >::resul
junk1 = 0, t* junk1 = 0,
const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = const typename enable_if< resolves_to_vector<T1>::value == false >::resul
0 t* junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return Op<T1, op_sum>(X.get_ref(), dim, 0); return Op<T1, op_sum>(X, dim, 0);
} }
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_sum> const Op<T1, op_sum>
sum sum
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword dim, const uword dim,
const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0 const typename enable_if< resolves_to_vector<T1>::value == true >::result * junk = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk); arma_ignore(junk);
return Op<T1, op_sum>(X.get_ref(), dim, 0); return Op<T1, op_sum>(X, dim, 0);
}
//! \brief
//! Immediate 'sum all values' operation,
//! invoked, for example, by: sum(sum(A))
template<typename T1>
inline
arma_warn_unused
typename T1::elem_type
sum(const Op<T1, op_sum>& in)
{
arma_extra_debug_sigprint();
arma_extra_debug_print("sum(): two consecutive sum() calls detected");
return accu(in.m);
}
template<typename T1>
arma_inline
const Op<Op<T1, op_sum>, op_sum>
sum(const Op<T1, op_sum>& in, const uword dim)
{
arma_extra_debug_sigprint();
return Op<Op<T1, op_sum>, op_sum>(in, dim, 0);
} }
//! \brief //! \brief
//! Immediate 'sum all values' operation for expressions which resolve to a vector //! Immediate 'sum all values' operation for expressions which resolve to a vector
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
typename T1::elem_type typename T1::elem_type
sum sum
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const arma_empty_class junk1 = arma_empty_class(), const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0 const typename enable_if< resolves_to_vector<T1>::value == true >::result * junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return accu(X.get_ref()); return accu(X);
} }
//! \brief
//! Immediate 'sum all values' operation,
//! invoked, for example, by: sum(sum(A))
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
typename T1::elem_type typename T1::elem_type
sum sum(const Op<T1, op_sum>& in)
(
const T1& X,
const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<is_basevec<T1>::value == true>::result* junk2 =
0
)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_extra_debug_print("sum(): two consecutive sum() calls detected");
arma_ignore(junk2);
return accu(X); return accu(in.m);
}
template<typename T1>
arma_inline
const Op<Op<T1, op_sum>, op_sum>
sum(const Op<T1, op_sum>& in, const uword dim)
{
arma_extra_debug_sigprint();
return Op<Op<T1, op_sum>, op_sum>(in, dim, 0);
} }
template<typename T> template<typename T>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
const typename arma_scalar_only<T>::result & const typename arma_scalar_only<T>::result &
sum(const T& x) sum(const T& x)
{ {
return x; return x;
} }
 End of changes. 15 change blocks. 
51 lines changed or deleted 32 lines changed or added


 fn_var.hpp   fn_var.hpp 
skipping to change at line 21 skipping to change at line 21
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup fn_var //! \addtogroup fn_var
//! @{ //! @{
template<typename T1> template<typename T1>
inline inline
const mtOp<typename T1::pod_type, T1, op_var> const mtOp<typename T1::pod_type, T1, op_var>
var var
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword norm_type = 0, const uword norm_type = 0,
const uword dim = 0, const uword dim = 0,
const typename enable_if<resolves_to_vector<T1>::value == false>::result* const typename enable_if< is_arma_type<T1>::value == true >::resul
junk1 = 0, t* junk1 = 0,
const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = const typename enable_if< resolves_to_vector<T1>::value == false >::resul
0 t* junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return mtOp<typename T1::pod_type, T1, op_var>(X.get_ref(), norm_type, di m); return mtOp<typename T1::pod_type, T1, op_var>(X, norm_type, dim);
} }
template<typename T1> template<typename T1>
inline inline
const mtOp<typename T1::pod_type, T1, op_var> const mtOp<typename T1::pod_type, T1, op_var>
var var
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword norm_type, const uword norm_type,
const uword dim, const uword dim,
const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk); arma_ignore(junk);
return mtOp<typename T1::pod_type, T1, op_var>(X.get_ref(), norm_type, di m); return mtOp<typename T1::pod_type, T1, op_var>(X, norm_type, dim);
} }
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
typename T1::pod_type typename T1::pod_type
var var
( (
const Base<typename T1::elem_type,T1>& X, const T1& X,
const uword norm_type = 0, const uword norm_type = 0,
const arma_empty_class junk1 = arma_empty_class(), const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0 const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
return op_var::var_vec( X.get_ref(), norm_type ); return op_var::var_vec( X, norm_type );
} }
template<typename T1> template<typename T>
inline arma_inline
arma_warn_unused arma_warn_unused
typename T1::pod_type const typename arma_scalar_only<T>::result
var var(const T&)
(
const T1& X,
const uword norm_type = 0,
const arma_empty_class junk1 = arma_empty_class(),
const typename enable_if<is_basevec<T1>::value == true>::result* junk2 =
0
)
{ {
arma_extra_debug_sigprint(); return T(0);
arma_ignore(junk1);
arma_ignore(junk2);
return op_var::var_vec( X, norm_type );
} }
//! @} //! @}
 End of changes. 10 change blocks. 
26 lines changed or deleted 15 lines changed or added


 op_sum_bones.hpp   op_sum_bones.hpp 
// Copyright (C) 2008-2010 NICTA (www.nicta.com.au) // Copyright (C) 2008-2012 NICTA (www.nicta.com.au)
// Copyright (C) 2008-2010 Conrad Sanderson // Copyright (C) 2008-2012 Conrad Sanderson
// //
// This file is part of the Armadillo C++ library. // This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup op_sum //! \addtogroup op_sum
//! @{ //! @{
//! Class for finding sums of values in a matrix (e.g. along rows or colum ns) //! Class for finding sums of values in a matrix (e.g. along rows or colum ns)
class op_sum class op_sum
{ {
public: public:
template<typename T1> template<typename T1>
inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1, o p_sum>& in); arma_hot inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1, op_sum>& in);
}; };
//! @} //! @}
 End of changes. 2 change blocks. 
3 lines changed or deleted 3 lines changed or added


 op_sum_meat.hpp   op_sum_meat.hpp 
skipping to change at line 21 skipping to change at line 21
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup op_sum //! \addtogroup op_sum
//! @{ //! @{
//! \brief //! \brief
//! Immediate sum of elements of a matrix along a specified dimension (eith er rows or columns). //! Immediate sum of elements of a matrix along a specified dimension (eith er rows or columns).
//! The result is stored in a dense matrix that has either one column or on e row. //! The result is stored in a dense matrix that has either one column or on e row.
//! See the sum() function for more details. //! See the sum() function for more details.
template<typename T1> template<typename T1>
arma_hot
inline inline
void void
op_sum::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_sum>& in) op_sum::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_sum>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
const uword dim = in.aux_uword_a; const uword dim = in.aux_uword_a;
arma_debug_check( (dim > 1), "sum(): incorrect usage. dim must be 0 or 1" ); arma_debug_check( (dim > 1), "sum(): incorrect usage. dim must be 0 or 1" );
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 podarray_bones.hpp   podarray_bones.hpp 
skipping to change at line 21 skipping to change at line 21
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup podarray //! \addtogroup podarray
//! @{ //! @{
struct podarray_prealloc_n_elem struct podarray_prealloc_n_elem
{ {
static const uword val = 16; static const uword val = 16;
}; };
//! A lightweight array for POD types. If the amount of memory requested is //! A lightweight array for POD types. For internal use only!
small, the stack is used.
template<typename eT> template<typename eT>
class podarray class podarray
{ {
public: public:
arma_aligned const uword n_elem; //!< number of elements held arma_aligned const uword n_elem; //!< number of elements held
arma_aligned const eT* const mem; //!< pointer to memory used by the o arma_aligned eT* mem; //!< pointer to memory used by the objec
bject t
protected: protected:
//! Internal memory, to avoid calling the 'new' operator for small amount s of memory. //! Internal memory, to avoid calling the 'new' operator for small amount s of memory.
arma_aligned eT mem_local[ podarray_prealloc_n_elem::val ]; arma_aligned eT mem_local[ podarray_prealloc_n_elem::val ];
public: public:
inline ~podarray(); inline ~podarray();
inline podarray(); inline podarray();
skipping to change at line 71 skipping to change at line 70
inline void zeros(); inline void zeros();
inline void zeros(const uword new_n_elem); inline void zeros(const uword new_n_elem);
arma_inline eT* memptr(); arma_inline eT* memptr();
arma_inline const eT* memptr() const; arma_inline const eT* memptr() const;
arma_hot inline void copy_row(const Mat<eT>& A, const uword row); arma_hot inline void copy_row(const Mat<eT>& A, const uword row);
protected: protected:
inline void init(const uword new_n_elem); inline void init_cold(const uword new_n_elemZ);
inline void init_warm(const uword new_n_elem);
}; };
//! @} //! @}
 End of changes. 3 change blocks. 
7 lines changed or deleted 6 lines changed or added


 podarray_meat.hpp   podarray_meat.hpp 
skipping to change at line 17 skipping to change at line 17
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup podarray //! \addtogroup podarray
//! @{ //! @{
template<typename eT> template<typename eT>
arma_hot
inline inline
podarray<eT>::~podarray() podarray<eT>::~podarray()
{ {
arma_extra_debug_sigprint_this(this); arma_extra_debug_sigprint_this(this);
if(n_elem > sizeof(mem_local)/sizeof(eT) ) if(n_elem > podarray_prealloc_n_elem::val )
{ {
memory::release( access::rw(mem) ); memory::release( mem );
}
if(arma_config::debug == true)
{
access::rw(mem) = 0;
} }
} }
template<typename eT> template<typename eT>
inline inline
podarray<eT>::podarray() podarray<eT>::podarray()
: n_elem(0) : n_elem(0)
, mem (0) , mem (0)
{ {
arma_extra_debug_sigprint_this(this); arma_extra_debug_sigprint_this(this);
} }
template<typename eT> template<typename eT>
inline inline
podarray<eT>::podarray(const podarray& x) podarray<eT>::podarray(const podarray& x)
: n_elem(0) : n_elem(x.n_elem)
, mem (0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
this->operator=(x); const uword x_n_elem = x.n_elem;
init_cold(x_n_elem);
arrayops::copy( memptr(), x.memptr(), x_n_elem );
} }
template<typename eT> template<typename eT>
inline inline
const podarray<eT>& const podarray<eT>&
podarray<eT>::operator=(const podarray& x) podarray<eT>::operator=(const podarray& x)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
if(this != &x) if(this != &x)
{ {
init(x.n_elem); const uword x_n_elem = x.n_elem;
init_warm(x_n_elem);
arrayops::copy( memptr(), x.memptr(), n_elem ); arrayops::copy( memptr(), x.memptr(), x_n_elem );
} }
return *this; return *this;
} }
template<typename eT> template<typename eT>
arma_hot
arma_inline arma_inline
podarray<eT>::podarray(const uword new_n_elem) podarray<eT>::podarray(const uword new_n_elem)
: n_elem(0) : n_elem(new_n_elem)
, mem (0)
{ {
arma_extra_debug_sigprint_this(this); arma_extra_debug_sigprint_this(this);
init(new_n_elem); init_cold(new_n_elem);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
podarray<eT>::podarray(const eT* X, const uword new_n_elem) podarray<eT>::podarray(const eT* X, const uword new_n_elem)
: n_elem(0) : n_elem(new_n_elem)
, mem (0)
{ {
arma_extra_debug_sigprint_this(this); arma_extra_debug_sigprint_this(this);
init(new_n_elem); init_cold(new_n_elem);
arrayops::copy( memptr(), X, new_n_elem ); arrayops::copy( memptr(), X, new_n_elem );
} }
template<typename eT> template<typename eT>
template<typename T1> template<typename T1>
inline inline
podarray<eT>::podarray(const Proxy<T1>& P) podarray<eT>::podarray(const Proxy<T1>& P)
: n_elem(0) : n_elem(P.get_n_elem())
, mem (0)
{ {
arma_extra_debug_sigprint_this(this); arma_extra_debug_sigprint_this(this);
const uword P_n_elem = P.get_n_elem(); const uword P_n_elem = P.get_n_elem();
init(P_n_elem); init_cold(P_n_elem);
eT* out_mem = (*this).memptr(); eT* out_mem = (*this).memptr();
if(Proxy<T1>::prefer_at_accessor == false) if(Proxy<T1>::prefer_at_accessor == false)
{ {
typedef typename Proxy<T1>::ea_type ea_type; typename Proxy<T1>::ea_type A = P.get_ea();
ea_type A = P.get_ea();
uword i,j; uword i,j;
for(i=0, j=1; j < P_n_elem; i+=2, j+=2) for(i=0, j=1; j < P_n_elem; i+=2, j+=2)
{ {
const eT val_i = A[i]; const eT val_i = A[i];
const eT val_j = A[j]; const eT val_j = A[j];
out_mem[i] = val_i; out_mem[i] = val_i;
out_mem[j] = val_j; out_mem[j] = val_j;
} }
if(i < n_elem) if(i < P_n_elem)
{ {
out_mem[i] = A[i]; out_mem[i] = A[i];
} }
} }
else else
{ {
const uword P_n_rows = P.get_n_rows(); const uword P_n_rows = P.get_n_rows();
const uword P_n_cols = P.get_n_cols(); const uword P_n_cols = P.get_n_cols();
if(P_n_rows != 1) if(P_n_rows != 1)
skipping to change at line 177 skipping to change at line 174
{ {
return access::rw(mem[i]); return access::rw(mem[i]);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
eT eT
podarray<eT>::operator() (const uword i) const podarray<eT>::operator() (const uword i) const
{ {
arma_debug_check( (i >= n_elem), "podarray::operator(): index out of boun ds"); arma_debug_check( (i >= n_elem), "podarray::operator(): index out of boun ds");
return mem[i]; return mem[i];
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
eT& eT&
podarray<eT>::operator() (const uword i) podarray<eT>::operator() (const uword i)
{ {
arma_debug_check( (i >= n_elem), "podarray::operator(): index out of boun ds"); arma_debug_check( (i >= n_elem), "podarray::operator(): index out of boun ds");
return access::rw(mem[i]); return access::rw(mem[i]);
} }
template<typename eT> template<typename eT>
inline inline
void void
podarray<eT>::set_size(const uword new_n_elem) podarray<eT>::set_size(const uword new_n_elem)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
init(new_n_elem); init_warm(new_n_elem);
} }
template<typename eT> template<typename eT>
inline inline
void void
podarray<eT>::reset() podarray<eT>::reset()
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
init(0); init_warm(0);
} }
template<typename eT> template<typename eT>
inline inline
void void
podarray<eT>::fill(const eT val) podarray<eT>::fill(const eT val)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arrayops::inplace_set(memptr(), val, n_elem); arrayops::inplace_set(memptr(), val, n_elem);
skipping to change at line 236 skipping to change at line 235
fill(eT(0)); fill(eT(0));
} }
template<typename eT> template<typename eT>
inline inline
void void
podarray<eT>::zeros(const uword new_n_elem) podarray<eT>::zeros(const uword new_n_elem)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
init(new_n_elem); init_warm(new_n_elem);
fill(eT(0)); fill(eT(0));
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
eT* eT*
podarray<eT>::memptr() podarray<eT>::memptr()
{ {
return const_cast<eT*>(mem); return mem;
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
const eT* const eT*
podarray<eT>::memptr() const podarray<eT>::memptr() const
{ {
return mem; return mem;
} }
skipping to change at line 315 skipping to change at line 315
case 2: case 2:
out[1] = A.at(row, 1); out[1] = A.at(row, 1);
case 1: case 1:
out[0] = A.at(row, 0); out[0] = A.at(row, 0);
} }
} }
template<typename eT> template<typename eT>
arma_hot
inline
void
podarray<eT>::init_cold(const uword new_n_elem)
{
arma_extra_debug_sigprint();
if(new_n_elem <= podarray_prealloc_n_elem::val )
{
mem = mem_local;
}
else
{
mem = memory::acquire<eT>(new_n_elem);
arma_check_bad_alloc( (mem == 0), "arma::podarray: out of memory" );
}
}
template<typename eT>
inline inline
void void
podarray<eT>::init(const uword new_n_elem) podarray<eT>::init_warm(const uword new_n_elem)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
if(n_elem == new_n_elem) if(n_elem == new_n_elem)
{ {
return; return;
} }
if(n_elem > sizeof(mem_local)/sizeof(eT) ) if(n_elem > podarray_prealloc_n_elem::val )
{ {
memory::release( access::rw(mem) ); memory::release( mem );
} }
if(new_n_elem <= sizeof(mem_local)/sizeof(eT) ) if(new_n_elem <= podarray_prealloc_n_elem::val )
{ {
access::rw(mem) = mem_local; mem = mem_local;
} }
else else
{ {
access::rw(mem) = memory::acquire<eT>(new_n_elem); mem = memory::acquire<eT>(new_n_elem);
arma_check_bad_alloc( (mem == 0), "podarray::init(): out of memory" ); arma_check_bad_alloc( (mem == 0), "arma::podarray: out of memory" );
} }
access::rw(n_elem) = new_n_elem; access::rw(n_elem) = new_n_elem;
} }
//! @} //! @}
 End of changes. 30 change blocks. 
36 lines changed or deleted 56 lines changed or added


 traits.hpp   traits.hpp 
skipping to change at line 791 skipping to change at line 791
template<typename T1> template<typename T1>
struct force_different_type<T1,T1> struct force_different_type<T1,T1>
{ {
typedef T1 T1_result; typedef T1 T1_result;
typedef arma_junk_class T2_result; typedef arma_junk_class T2_result;
}; };
// //
template<typename T1> template<typename T1>
struct resolves_to_vector struct resolves_to_vector_default { static const bool value = false;
{ static const bool value = T1::is_col || T1::is_row; }; };
template<typename T1>
struct resolves_to_vector_test { static const bool value = T1::is_col ||
T1::is_row; };
template<typename T1, bool condition>
struct resolves_to_vector_redirect {};
template<typename T1>
struct resolves_to_vector_redirect<T1, false> { typedef resolves_to_vector_
default<T1> result; };
template<typename T1>
struct resolves_to_vector_redirect<T1, true> { typedef resolves_to_vector_
test<T1> result; };
template<typename T1>
struct resolves_to_vector : public resolves_to_vector_redirect<T1, is_arma_
type<T1>::value>::result {};
template<typename glue_type> struct is_glue_mixed_times { static const bool value = false; }; template<typename glue_type> struct is_glue_mixed_times { static const bool value = false; };
template<> struct is_glue_mixed_times<glue_mixed_times> { static const bool value = true; }; template<> struct is_glue_mixed_times<glue_mixed_times> { static const bool value = true; };
template<typename glue_type> struct is_glue_mixed_elem { static const bool value = false; }; template<typename glue_type> struct is_glue_mixed_elem { static const bool value = false; };
template<> struct is_glue_mixed_elem<glue_mixed_plus> { static const bool value = true; }; template<> struct is_glue_mixed_elem<glue_mixed_plus> { static const bool value = true; };
template<> struct is_glue_mixed_elem<glue_mixed_minus> { static const bool value = true; }; template<> struct is_glue_mixed_elem<glue_mixed_minus> { static const bool value = true; };
template<> struct is_glue_mixed_elem<glue_mixed_div> { static const bool value = true; }; template<> struct is_glue_mixed_elem<glue_mixed_div> { static const bool value = true; };
template<> struct is_glue_mixed_elem<glue_mixed_schur> { static const bool value = true; }; template<> struct is_glue_mixed_elem<glue_mixed_schur> { static const bool value = true; };
 End of changes. 1 change blocks. 
2 lines changed or deleted 21 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/