arma_version.hpp   arma_version.hpp 
skipping to change at line 23 skipping to change at line 23
// 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
//! @{ //! @{
struct arma_version struct arma_version
{ {
static const unsigned int major = 0; static const unsigned int major = 0;
static const unsigned int minor = 9; static const unsigned int minor = 9;
static const unsigned int patch = 50; static const unsigned int patch = 52;
static static
inline inline
std::string std::string
as_string() as_string()
{ {
const char* nickname = "Flying Spaghetti Monster"; const char* nickname = "Monkey Wrench";
// http://en.wikipedia.org/wiki/Flying_Spaghetti_Monster
std::stringstream ss; std::stringstream ss;
ss << arma_version::major ss << arma_version::major
<< '.' << '.'
<< arma_version::minor << arma_version::minor
<< '.' << '.'
<< arma_version::patch << arma_version::patch
<< " (" << " ("
<< nickname << nickname
<< ')'; << ')';
 End of changes. 2 change blocks. 
3 lines changed or deleted 2 lines changed or added


 auxlib_meat.hpp   auxlib_meat.hpp 
skipping to change at line 470 skipping to change at line 470
int sign = +1; int sign = +1;
for(u32 i=0; i < tmp.n_rows; ++i) for(u32 i=0; i < tmp.n_rows; ++i)
{ {
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 val * eT(sign); return ( (sign < 0) ? -val : val );
} }
#elif defined(ARMA_USE_LAPACK) #elif defined(ARMA_USE_LAPACK)
{ {
Mat<eT> tmp = X; Mat<eT> tmp = X;
podarray<int> ipiv(tmp.n_rows); podarray<int> ipiv(tmp.n_rows);
int info = 0; int info = 0;
int n_rows = int(tmp.n_rows); int n_rows = int(tmp.n_rows);
int n_cols = int(tmp.n_cols); int n_cols = int(tmp.n_cols);
skipping to change at line 499 skipping to change at line 499
int sign = +1; int sign = +1;
for(u32 i=0; i < tmp.n_rows; ++i) for(u32 i=0; i < tmp.n_rows; ++i)
{ {
if( int(i) != (ipiv.mem[i] - 1) ) // NOTE: adjustment of -1 is r equired as Fortran counts from 1 if( int(i) != (ipiv.mem[i] - 1) ) // NOTE: adjustment of -1 is r equired as Fortran counts from 1
{ {
sign *= -1; sign *= -1;
} }
} }
return val * eT(sign); return ( (sign < 0) ? -val : val );
} }
#else #else
{ {
arma_stop("det(): need ATLAS or LAPACK"); arma_stop("det(): need ATLAS or LAPACK");
return eT(0); return eT(0);
} }
#endif #endif
} }
} }
} }
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 diskio_meat.hpp   diskio_meat.hpp 
skipping to change at line 2138 skipping to change at line 2138
arma_debug_check( (x.n_slices != 3), "diskio::save_ppm_binary(): given cu be must have exactly 3 slices" ); arma_debug_check( (x.n_slices != 3), "diskio::save_ppm_binary(): given cu be must have exactly 3 slices" );
const u32 n_elem = 3 * x.n_rows * x.n_cols; const u32 n_elem = 3 * x.n_rows * x.n_cols;
podarray<u8> tmp(n_elem); podarray<u8> tmp(n_elem);
u32 i = 0; u32 i = 0;
for(u32 row=0; row < x.n_rows; ++row) for(u32 row=0; row < x.n_rows; ++row)
{ {
for(u32 col=0; col < x.n_cols; ++col) for(u32 col=0; col < x.n_cols; ++col)
{ {
tmp[i+0] = u8( x.at(row,col,0) ); tmp[i+0] = u8( access::tmp_real( x.at(row,col,0) ) );
tmp[i+1] = u8( x.at(row,col,1) ); tmp[i+1] = u8( access::tmp_real( x.at(row,col,1) ) );
tmp[i+2] = u8( x.at(row,col,2) ); tmp[i+2] = u8( access::tmp_real( x.at(row,col,2) ) );
i+=3; i+=3;
} }
} }
f << "P6" << '\n'; f << "P6" << '\n';
f << x.n_cols << '\n'; f << x.n_cols << '\n';
f << x.n_rows << '\n'; f << x.n_rows << '\n';
f << 255 << '\n'; f << 255 << '\n';
 End of changes. 1 change blocks. 
3 lines changed or deleted 3 lines changed or added


 eop_core_proto.hpp   eop_core_proto.hpp 
skipping to change at line 26 skipping to change at line 26
//! \addtogroup eop_core //! \addtogroup eop_core
//! @{ //! @{
template<typename eop_type> template<typename eop_type>
class eop_core class eop_core
{ {
public: public:
arma_inline static const char* error_msg() { return ""; } arma_inline static const char* error_msg() { return ""; }
arma_inline static const bool size_ok(const u32 n_rows, const u32 n_cols) { return true; } arma_inline static bool size_ok(const u32 n_rows, const u32 n_cols) { return true; }
template<typename T1> arma_hot arma_inline static typename T1::elem_type get_elem(const eOp<T1, eop_type>& x, const u32 i); template<typename T1> arma_hot arma_inline static typename T1::elem_type get_elem(const eOp<T1, eop_type>& x, const u32 i);
template<typename T1> arma_hot arma_inline static typename T1::elem_type get_elem(const eOp<T1, eop_type>& x, const u32 row, const u32 col); template<typename T1> arma_hot arma_inline static typename T1::elem_type get_elem(const eOp<T1, eop_type>& x, const u32 row, const u32 col);
template<typename T1> arma_hot arma_inline static typename T1::elem_type process(const eOp<T1, eop_type>& x, const typename T1::elem_type val); template<typename T1> arma_hot arma_inline static typename T1::elem_type process(const eOp<T1, eop_type>& x, const typename T1::elem_type val);
template<typename T1> arma_hot arma_inline static void apply(Mat<typename T1::elem_type>& out, const eOp<T1, eop_type>& x); template<typename T1> arma_hot arma_inline static void apply(Mat<typename T1::elem_type>& out, const eOp<T1, eop_type>& x);
template<typename T1> arma_hot inline static void apply_proxy (Mat<typena me T1::elem_type>& out, const eOp<T1, eop_type>& x); template<typename T1> arma_hot inline static void apply_proxy (Mat<typena me T1::elem_type>& out, const eOp<T1, eop_type>& x);
template<typename T1> arma_hot inline static void apply_unwrap(Mat<typena me T1::elem_type>& out, const eOp<T1, eop_type>& x); template<typename T1> arma_hot inline static void apply_unwrap(Mat<typena me T1::elem_type>& out, const eOp<T1, eop_type>& x);
skipping to change at line 83 skipping to change at line 83
class eop_conj : public eop_core<eop_conj> {}; class eop_conj : public eop_core<eop_conj> {};
class eop_pow : public eop_core<eop_pow> {}; class eop_pow : public eop_core<eop_pow> {};
class eop_pow_int : public eop_core<eop_pow_int> {}; class eop_pow_int : public eop_core<eop_pow_int> {};
class eop_ones_diag : public eop_core<eop_ones_diag> class eop_ones_diag : public eop_core<eop_ones_diag>
{ {
public: public:
arma_inline static const char* error_msg() { return "eye(): given size is not square"; } arma_inline static const char* error_msg() { return "eye(): given size is not square"; }
arma_inline static const bool size_ok(const u32 n_rows, const u32 n_cols) { return (n_rows == n_cols); } arma_inline static bool size_ok(const u32 n_rows, const u32 n_cols) { ret urn (n_rows == n_cols); }
}; };
class eop_ones_full : public eop_core<eop_ones_full>{}; class eop_ones_full : public eop_core<eop_ones_full>{};
class eop_randu : public eop_core<eop_randu> {}; class eop_randu : public eop_core<eop_randu> {};
class eop_randn : public eop_core<eop_randn> {}; class eop_randn : public eop_core<eop_randn> {};
class eop_zeros : public eop_core<eop_zeros> {}; class eop_zeros : public eop_core<eop_zeros> {};
template<typename T1> struct is_generator { static const boo l value = false; }; template<typename T1> struct is_generator { static const boo l value = false; };
template<> struct is_generator<eop_ones_full> { static const boo l value = true; }; template<> struct is_generator<eop_ones_full> { static const boo l value = true; };
template<> struct is_generator<eop_randu> { static const boo l value = true; }; template<> struct is_generator<eop_randu> { static const boo l value = true; };
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 traits.hpp   traits.hpp 
skipping to change at line 399 skipping to change at line 399
// template<> // template<>
template<typename eT> template<typename eT>
struct is_complex< std::complex<eT> > struct is_complex< std::complex<eT> >
{ static const bool value = true; }; { static const bool value = true; };
template<typename T1> template<typename T1>
struct is_complex_float struct is_complex_float
{ static const bool value = false; }; { static const bool value = false; };
template<> template<>
struct is_complex< std::complex<float> > struct is_complex_float< std::complex<float> >
{ static const bool value = true; }; { static const bool value = true; };
template<typename T1> template<typename T1>
struct is_complex_double struct is_complex_double
{ static const bool value = false; }; { static const bool value = false; };
template<> template<>
struct is_complex_double< std::complex<double> > struct is_complex_double< std::complex<double> >
{ static const bool value = true; }; { static const bool value = true; };
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 upgrade_val.hpp   upgrade_val.hpp 
skipping to change at line 30 skipping to change at line 30
//! values are upgraded only where necessary. //! values are upgraded only where necessary.
template<typename T1, typename T2> template<typename T1, typename T2>
struct upgrade_val struct upgrade_val
{ {
typedef typename promote_type<T1,T2>::result T1_result; typedef typename promote_type<T1,T2>::result T1_result;
typedef typename promote_type<T1,T2>::result T2_result; typedef typename promote_type<T1,T2>::result T2_result;
arma_inline arma_inline
static static
const typename promote_type<T1,T2>::result typename promote_type<T1,T2>::result
apply(const T1 x) apply(const T1 x)
{ {
typedef typename promote_type<T1,T2>::result out_type; typedef typename promote_type<T1,T2>::result out_type;
return out_type(x); return out_type(x);
} }
arma_inline arma_inline
static static
const typename promote_type<T1,T2>::result typename promote_type<T1,T2>::result
apply(const T2 x) apply(const T2 x)
{ {
typedef typename promote_type<T1,T2>::result out_type; typedef typename promote_type<T1,T2>::result out_type;
return out_type(x); return out_type(x);
} }
}; };
// template<> // template<>
template<typename T> template<typename T>
skipping to change at line 68 skipping to change at line 68
//! upgrade a type to allow multiplication with a complex type //! upgrade a type to allow multiplication with a complex type
//! e.g. the int in "int * complex<double>" is upgraded to a double //! e.g. the int in "int * complex<double>" is upgraded to a double
// template<> // template<>
template<typename T, typename T2> template<typename T, typename T2>
struct upgrade_val< std::complex<T>, T2 > struct upgrade_val< std::complex<T>, T2 >
{ {
typedef std::complex<T> T1_result; typedef std::complex<T> T1_result;
typedef T T2_result; typedef T T2_result;
arma_inline static const std::complex<T>& apply(const std::complex<T>& x) { return x; } arma_inline static const std::complex<T>& apply(const std::complex<T>& x) { return x; }
arma_inline static const T apply(const T2 x) { return T(x); } arma_inline static T apply(const T2 x) { return T(x); }
}; };
// template<> // template<>
template<typename T1, typename T> template<typename T1, typename T>
struct upgrade_val< T1, std::complex<T> > struct upgrade_val< T1, std::complex<T> >
{ {
typedef T T1_result; typedef T T1_result;
typedef std::complex<T> T2_result; typedef std::complex<T> T2_result;
arma_inline static const T apply(const T1 x) { return T(x); } arma_inline static T apply(const T1 x) { return T(x); }
arma_inline static const std::complex<T>& apply(const std::complex<T>& x) { return x; } arma_inline static const std::complex<T>& apply(const std::complex<T>& x) { return x; }
}; };
//! ensure we don't lose precision when multiplying a complex number with a higher precision real number //! ensure we don't lose precision when multiplying a complex number with a higher precision real number
template<> template<>
struct upgrade_val< std::complex<float>, double > struct upgrade_val< std::complex<float>, double >
{ {
typedef std::complex<double> T1_result; typedef std::complex<double> T1_result;
typedef double T2_result; typedef double T2_result;
arma_inline static const std::complex<double> apply(const std::complex<fl oat>& x) { return std::complex<double>(x); } arma_inline static const std::complex<double> apply(const std::complex<fl oat>& x) { return std::complex<double>(x); }
arma_inline static const double apply(const double x) { return x; } arma_inline static double apply(const double x) { return x; }
}; };
template<> template<>
struct upgrade_val< double, std::complex<float> > struct upgrade_val< double, std::complex<float> >
{ {
typedef double T1_result; typedef double T1_result;
typedef std::complex<float> T2_result; typedef std::complex<float> T2_result;
arma_inline static const double apply(const double x) { return x; } arma_inline static double apply(const double x) { return x; }
arma_inline static const std::complex<double> apply(const std::complex<fl oat>& x) { return std::complex<double>(x); } arma_inline static const std::complex<double> apply(const std::complex<fl oat>& x) { return std::complex<double>(x); }
}; };
//! ensure we don't lose precision when multiplying complex numbers with di fferent underlying types //! ensure we don't lose precision when multiplying complex numbers with di fferent underlying types
template<> template<>
struct upgrade_val< std::complex<float>, std::complex<double> > struct upgrade_val< std::complex<float>, std::complex<double> >
{ {
typedef std::complex<double> T1_result; typedef std::complex<double> T1_result;
typedef std::complex<double> T2_result; typedef std::complex<double> T2_result;
skipping to change at line 132 skipping to change at line 132
}; };
//! work around limitations in the complex class (at least as present in gc c 4.1 & 4.3) //! work around limitations in the complex class (at least as present in gc c 4.1 & 4.3)
template<> template<>
struct upgrade_val< std::complex<double>, float > struct upgrade_val< std::complex<double>, float >
{ {
typedef std::complex<double> T1_result; typedef std::complex<double> T1_result;
typedef double T2_result; typedef double T2_result;
arma_inline static const std::complex<double>& apply(const std::complex<d ouble>& x) { return x; } arma_inline static const std::complex<double>& apply(const std::complex<d ouble>& x) { return x; }
arma_inline static const double apply(const float x) { return double(x); } arma_inline static double apply(const float x) { return double(x); }
}; };
template<> template<>
struct upgrade_val< float, std::complex<double> > struct upgrade_val< float, std::complex<double> >
{ {
typedef double T1_result; typedef double T1_result;
typedef std::complex<double> T2_result; typedef std::complex<double> T2_result;
arma_inline static const double apply(const float x) { return double(x); } arma_inline static double apply(const float x) { return double(x); }
arma_inline static const std::complex<double>& apply(const std::complex<d ouble>& x) { return x; } arma_inline static const std::complex<double>& apply(const std::complex<d ouble>& x) { return x; }
}; };
//! @} //! @}
 End of changes. 8 change blocks. 
8 lines changed or deleted 8 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/