arma_version.hpp   arma_version.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 arma_version //! \addtogroup arma_version
//! @{ //! @{
#define ARMA_VERSION_MAJOR 2 #define ARMA_VERSION_MAJOR 2
#define ARMA_VERSION_MINOR 3 #define ARMA_VERSION_MINOR 4
#define ARMA_VERSION_PATCH 92 #define ARMA_VERSION_PATCH 0
#define ARMA_VERSION_NAME "Loco Lounge Lizard (Beta 2)" #define ARMA_VERSION_NAME "Loco Lounge Lizard"
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. 
3 lines changed or deleted 3 lines changed or added


 diagview_meat.hpp   diagview_meat.hpp 
skipping to change at line 64 skipping to change at line 64
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
diagview<eT>& t = *this; diagview<eT>& t = *this;
arma_debug_check( (t.n_elem != x.n_elem), "diagview: diagonals have incom patible lengths"); arma_debug_check( (t.n_elem != x.n_elem), "diagview: diagonals have incom patible lengths");
Mat<eT>& t_m = *(t.m_ptr); Mat<eT>& t_m = *(t.m_ptr);
const Mat<eT>& x_m = x.m; const Mat<eT>& x_m = x.m;
const uword t_n_elem = t.n_elem; if(&t_m != &x_m)
const uword t_row_offset = t.row_offset; {
const uword t_col_offset = t.col_offset; const uword t_n_elem = t.n_elem;
const uword t_row_offset = t.row_offset;
const uword t_col_offset = t.col_offset;
const uword x_row_offset = x.row_offset; const uword x_row_offset = x.row_offset;
const uword x_col_offset = x.col_offset; const uword x_col_offset = x.col_offset;
for(uword i=0; i<t_n_elem; ++i) uword i,j;
for(i=0, j=1; j < t_n_elem; i+=2, j+=2)
{
const eT tmp_i = x_m.at(i + x_row_offset, i + x_col_offset);
const eT tmp_j = x_m.at(j + x_row_offset, j + x_col_offset);
t_m.at(i + t_row_offset, i + t_col_offset) = tmp_i;
t_m.at(j + t_row_offset, j + t_col_offset) = tmp_j;
}
if(i < t_n_elem)
{
t_m.at(i + t_row_offset, i + t_col_offset) = x_m.at(i + x_row_offset,
i + x_col_offset);
}
}
else
{ {
t_m.at(i + t_row_offset, i + t_col_offset) = x_m.at(i + x_row_offset, i const Mat<eT> tmp = x;
+ x_col_offset);
(*this).operator=(tmp);
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
diagview<eT>::operator+=(const eT val) diagview<eT>::operator+=(const eT val)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
skipping to change at line 181 skipping to change at line 200
); );
Mat<eT>& t_m = *(t.m_ptr); Mat<eT>& t_m = *(t.m_ptr);
const uword t_n_elem = t.n_elem; const uword t_n_elem = t.n_elem;
const uword t_row_offset = t.row_offset; const uword t_row_offset = t.row_offset;
const uword t_col_offset = t.col_offset; const uword t_col_offset = t.col_offset;
const eT* x_mem = x.memptr(); const eT* x_mem = x.memptr();
for(uword i=0; i<t_n_elem; ++i) uword i,j;
for(i=0, j=1; j < t_n_elem; i+=2, j+=2)
{
const eT tmp_i = x_mem[i];
const eT tmp_j = x_mem[j];
t_m.at( i + t_row_offset, i + t_col_offset) = tmp_i;
t_m.at( j + t_row_offset, j + t_col_offset) = tmp_j;
}
if(i < t_n_elem)
{ {
t_m.at( i + t_row_offset, i + t_col_offset) = x_mem[i]; t_m.at( i + t_row_offset, i + t_col_offset) = x_mem[i];
} }
} }
template<typename eT> template<typename eT>
template<typename T1> template<typename T1>
inline inline
void void
diagview<eT>::operator+=(const Base<eT,T1>& o) diagview<eT>::operator+=(const Base<eT,T1>& o)
skipping to change at line 214 skipping to change at line 243
); );
Mat<eT>& t_m = *(t.m_ptr); Mat<eT>& t_m = *(t.m_ptr);
const uword t_n_elem = t.n_elem; const uword t_n_elem = t.n_elem;
const uword t_row_offset = t.row_offset; const uword t_row_offset = t.row_offset;
const uword t_col_offset = t.col_offset; const uword t_col_offset = t.col_offset;
const eT* x_mem = x.memptr(); const eT* x_mem = x.memptr();
for(uword i=0; i<t_n_elem; ++i) uword i,j;
for(i=0, j=1; j < t_n_elem; i+=2, j+=2)
{
const eT tmp_i = x_mem[i];
const eT tmp_j = x_mem[j];
t_m.at( i + t_row_offset, i + t_col_offset) += tmp_i;
t_m.at( j + t_row_offset, j + t_col_offset) += tmp_j;
}
if(i < t_n_elem)
{ {
t_m.at( i + t_row_offset, i + t_col_offset) += x_mem[i]; t_m.at( i + t_row_offset, i + t_col_offset) += x_mem[i];
} }
} }
template<typename eT> template<typename eT>
template<typename T1> template<typename T1>
inline inline
void void
diagview<eT>::operator-=(const Base<eT,T1>& o) diagview<eT>::operator-=(const Base<eT,T1>& o)
skipping to change at line 247 skipping to change at line 286
); );
Mat<eT>& t_m = *(t.m_ptr); Mat<eT>& t_m = *(t.m_ptr);
const uword t_n_elem = t.n_elem; const uword t_n_elem = t.n_elem;
const uword t_row_offset = t.row_offset; const uword t_row_offset = t.row_offset;
const uword t_col_offset = t.col_offset; const uword t_col_offset = t.col_offset;
const eT* x_mem = x.memptr(); const eT* x_mem = x.memptr();
for(uword i=0; i<t_n_elem; ++i) uword i,j;
for(i=0, j=1; j < t_n_elem; i+=2, j+=2)
{
const eT tmp_i = x_mem[i];
const eT tmp_j = x_mem[j];
t_m.at( i + t_row_offset, i + t_col_offset) -= tmp_i;
t_m.at( j + t_row_offset, j + t_col_offset) -= tmp_j;
}
if(i < t_n_elem)
{ {
t_m.at( i + t_row_offset, i + t_col_offset) -= x_mem[i]; t_m.at( i + t_row_offset, i + t_col_offset) -= x_mem[i];
} }
} }
template<typename eT> template<typename eT>
template<typename T1> template<typename T1>
inline inline
void void
diagview<eT>::operator%=(const Base<eT,T1>& o) diagview<eT>::operator%=(const Base<eT,T1>& o)
skipping to change at line 280 skipping to change at line 329
); );
Mat<eT>& t_m = *(t.m_ptr); Mat<eT>& t_m = *(t.m_ptr);
const uword t_n_elem = t.n_elem; const uword t_n_elem = t.n_elem;
const uword t_row_offset = t.row_offset; const uword t_row_offset = t.row_offset;
const uword t_col_offset = t.col_offset; const uword t_col_offset = t.col_offset;
const eT* x_mem = x.memptr(); const eT* x_mem = x.memptr();
for(uword i=0; i<t_n_elem; ++i) uword i,j;
for(i=0, j=1; j < t_n_elem; i+=2, j+=2)
{
const eT tmp_i = x_mem[i];
const eT tmp_j = x_mem[j];
t_m.at( i + t_row_offset, i + t_col_offset) *= tmp_i;
t_m.at( j + t_row_offset, j + t_col_offset) *= tmp_j;
}
if(i < t_n_elem)
{ {
t_m.at( i + t_row_offset, i + t_col_offset) *= x_mem[i]; t_m.at( i + t_row_offset, i + t_col_offset) *= x_mem[i];
} }
} }
template<typename eT> template<typename eT>
template<typename T1> template<typename T1>
inline inline
void void
diagview<eT>::operator/=(const Base<eT,T1>& o) diagview<eT>::operator/=(const Base<eT,T1>& o)
skipping to change at line 313 skipping to change at line 372
); );
Mat<eT>& t_m = *(t.m_ptr); Mat<eT>& t_m = *(t.m_ptr);
const uword t_n_elem = t.n_elem; const uword t_n_elem = t.n_elem;
const uword t_row_offset = t.row_offset; const uword t_row_offset = t.row_offset;
const uword t_col_offset = t.col_offset; const uword t_col_offset = t.col_offset;
const eT* x_mem = x.memptr(); const eT* x_mem = x.memptr();
for(uword i=0; i<t_n_elem; ++i) uword i,j;
for(i=0, j=1; j < t_n_elem; i+=2, j+=2)
{
const eT tmp_i = x_mem[i];
const eT tmp_j = x_mem[j];
t_m.at( i + t_row_offset, i + t_col_offset) /= tmp_i;
t_m.at( j + t_row_offset, j + t_col_offset) /= tmp_j;
}
if(i < t_n_elem)
{ {
t_m.at( i + t_row_offset, i + t_col_offset) /= x_mem[i]; t_m.at( i + t_row_offset, i + t_col_offset) /= x_mem[i];
} }
} }
//! extract a diagonal and store it as a column vector //! extract a diagonal and store it as a column vector
template<typename eT> template<typename eT>
inline inline
void void
diagview<eT>::extract(Mat<eT>& out, const diagview<eT>& in) diagview<eT>::extract(Mat<eT>& out, const diagview<eT>& in)
skipping to change at line 338 skipping to change at line 407
// size setting and alias checking is done by either the Mat contructor o r operator=() // size setting and alias checking is done by either the Mat contructor o r operator=()
const Mat<eT>& in_m = in.m; const Mat<eT>& in_m = in.m;
const uword in_n_elem = in.n_elem; const uword in_n_elem = in.n_elem;
const uword in_row_offset = in.row_offset; const uword in_row_offset = in.row_offset;
const uword in_col_offset = in.col_offset; const uword in_col_offset = in.col_offset;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
for(uword i=0; i<in_n_elem; ++i) uword i,j;
for(i=0, j=1; j < in_n_elem; i+=2, j+=2)
{ {
out_mem[i] = in_m.at(i+in_row_offset, i+in_col_offset); const eT tmp_i = in_m.at( i + in_row_offset, i + in_col_offset );
const eT tmp_j = in_m.at( j + in_row_offset, j + in_col_offset );
out_mem[i] = tmp_i;
out_mem[j] = tmp_j;
}
if(i < in_n_elem)
{
out_mem[i] = in_m.at( i + in_row_offset, i + in_col_offset );
} }
} }
//! X += Y.diagview(...) //! X += Y.diag()
template<typename eT> template<typename eT>
inline inline
void void
diagview<eT>::plus_inplace(Mat<eT>& out, const diagview<eT>& in) diagview<eT>::plus_inplace(Mat<eT>& out, const diagview<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "addition"); arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "addition");
const Mat<eT>& in_m = in.m; const Mat<eT>& in_m = in.m;
const uword in_n_elem = in.n_elem; const uword in_n_elem = in.n_elem;
const uword in_row_offset = in.row_offset; const uword in_row_offset = in.row_offset;
const uword in_col_offset = in.col_offset; const uword in_col_offset = in.col_offset;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
for(uword i=0; i<in_n_elem; ++i) uword i,j;
for(i=0, j=1; j < in_n_elem; i+=2, j+=2)
{ {
out_mem[i] += in_m.at(i+in_row_offset, i+in_col_offset); const eT tmp_i = in_m.at( i + in_row_offset, i + in_col_offset );
const eT tmp_j = in_m.at( j + in_row_offset, j + in_col_offset );
out_mem[i] += tmp_i;
out_mem[j] += tmp_j;
}
if(i < in_n_elem)
{
out_mem[i] += in_m.at( i + in_row_offset, i + in_col_offset );
} }
} }
//! X -= Y.diagview(...) //! X -= Y.diag()
template<typename eT> template<typename eT>
inline inline
void void
diagview<eT>::minus_inplace(Mat<eT>& out, const diagview<eT>& in) diagview<eT>::minus_inplace(Mat<eT>& out, const diagview<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "subtraction"); arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "subtraction");
const Mat<eT>& in_m = in.m; const Mat<eT>& in_m = in.m;
const uword in_n_elem = in.n_elem; const uword in_n_elem = in.n_elem;
const uword in_row_offset = in.row_offset; const uword in_row_offset = in.row_offset;
const uword in_col_offset = in.col_offset; const uword in_col_offset = in.col_offset;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
for(uword i=0; i<in_n_elem; ++i) uword i,j;
for(i=0, j=1; j < in_n_elem; i+=2, j+=2)
{ {
out_mem[i] -= in_m.at(i+in_row_offset, i+in_col_offset); const eT tmp_i = in_m.at( i + in_row_offset, i + in_col_offset );
const eT tmp_j = in_m.at( j + in_row_offset, j + in_col_offset );
out_mem[i] -= tmp_i;
out_mem[j] -= tmp_j;
}
if(i < in_n_elem)
{
out_mem[i] -= in_m.at( i + in_row_offset, i + in_col_offset );
} }
} }
//! X %= Y.submat(...) //! X %= Y.diag()
template<typename eT> template<typename eT>
inline inline
void void
diagview<eT>::schur_inplace(Mat<eT>& out, const diagview<eT>& in) diagview<eT>::schur_inplace(Mat<eT>& out, const diagview<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "element-wise multiplication"); arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "element-wise multiplication");
const Mat<eT>& in_m = in.m; const Mat<eT>& in_m = in.m;
const uword in_n_elem = in.n_elem; const uword in_n_elem = in.n_elem;
const uword in_row_offset = in.row_offset; const uword in_row_offset = in.row_offset;
const uword in_col_offset = in.col_offset; const uword in_col_offset = in.col_offset;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
for(uword i=0; i<in_n_elem; ++i) uword i,j;
for(i=0, j=1; j < in_n_elem; i+=2, j+=2)
{ {
out_mem[i] *= in_m.at(i+in_row_offset, i+in_col_offset); const eT tmp_i = in_m.at( i + in_row_offset, i + in_col_offset );
const eT tmp_j = in_m.at( j + in_row_offset, j + in_col_offset );
out_mem[i] *= tmp_i;
out_mem[j] *= tmp_j;
}
if(i < in_n_elem)
{
out_mem[i] *= in_m.at( i + in_row_offset, i + in_col_offset );
} }
} }
//! X /= Y.diagview(...) //! X /= Y.diag()
template<typename eT> template<typename eT>
inline inline
void void
diagview<eT>::div_inplace(Mat<eT>& out, const diagview<eT>& in) diagview<eT>::div_inplace(Mat<eT>& out, const diagview<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "element-wise division"); arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "element-wise division");
const Mat<eT>& in_m = in.m; const Mat<eT>& in_m = in.m;
const uword in_n_elem = in.n_elem; const uword in_n_elem = in.n_elem;
const uword in_row_offset = in.row_offset; const uword in_row_offset = in.row_offset;
const uword in_col_offset = in.col_offset; const uword in_col_offset = in.col_offset;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
for(uword i=0; i<in_n_elem; ++i) uword i,j;
for(i=0, j=1; j < in_n_elem; i+=2, j+=2)
{
const eT tmp_i = in_m.at( i + in_row_offset, i + in_col_offset );
const eT tmp_j = in_m.at( j + in_row_offset, j + in_col_offset );
out_mem[i] /= tmp_i;
out_mem[j] /= tmp_j;
}
if(i < in_n_elem)
{ {
out_mem[i] /= in_m.at(i+in_row_offset, i+in_col_offset); out_mem[i] /= in_m.at( i + in_row_offset, i + in_col_offset );
} }
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
eT& eT&
diagview<eT>::operator[](const uword i) diagview<eT>::operator[](const uword i)
{ {
return (*m_ptr).at(i+row_offset, i+col_offset); return (*m_ptr).at(i+row_offset, i+col_offset);
} }
 End of changes. 23 change blocks. 
27 lines changed or deleted 146 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/