Col_meat.hpp   Col_meat.hpp 
skipping to change at line 269 skipping to change at line 269
arma_inline arma_inline
const subview_col<eT> const subview_col<eT>
Col<eT>::rows(const u32 in_row1, const u32 in_row2) Col<eT>::rows(const u32 in_row1, const u32 in_row2)
const const
{ {
arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= Mat<eT>::n_rows) ) , "Col::rows(): indices out of bounds or incorrectly used"); arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= Mat<eT>::n_rows) ) , "Col::rows(): indices out of bounds or incorrectly used");
return subview_col<eT>(*this, 0, in_row1, in_row2); return subview_col<eT>(*this, 0, in_row1, in_row2);
} }
template<typename eT>
arma_inline
subview_col<eT>
Col<eT>::subvec(const u32 in_row1, const u32 in_row2)
{
arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= Mat<eT>::n_rows) )
, "Col::subvec(): indices out of bounds or incorrectly used");
return subview_col<eT>(*this, 0, in_row1, in_row2);
}
template<typename eT>
arma_inline
const subview_col<eT>
Col<eT>::subvec(const u32 in_row1, const u32 in_row2)
const
{
arma_debug_check( ( (in_row1 > in_row2) || (in_row2 >= Mat<eT>::n_rows) )
, "Col::subvec(): indices out of bounds or incorrectly used");
return subview_col<eT>(*this, 0, in_row1, in_row2);
}
//! remove specified row //! remove specified row
template<typename eT> template<typename eT>
inline inline
void void
Col<eT>::shed_row(const u32 row_num) Col<eT>::shed_row(const u32 row_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( row_num >= Mat<eT>::n_rows, "Col::shed_row(): out of bo unds"); arma_debug_check( row_num >= Mat<eT>::n_rows, "Col::shed_row(): out of bo unds");
 End of changes. 1 change blocks. 
0 lines changed or deleted 23 lines changed or added


 Col_proto.hpp   Col_proto.hpp 
skipping to change at line 16 skipping to change at line 16
// 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 Col //! \addtogroup Col
//! @{ //! @{
//! Class for column vectors (matrices with only column) //! Class for column vectors (matrices with only one column)
template<typename eT> template<typename eT>
class Col : public Mat<eT>, public BaseVec< eT, Col<eT> > class Col : public Mat<eT>, public BaseVec< eT, Col<eT> >
{ {
public: public:
typedef eT elem_type; typedef eT elem_type;
typedef typename get_pod_type<eT>::result pod_type; typedef typename get_pod_type<eT>::result pod_type;
inline Col(); inline Col();
skipping to change at line 57 skipping to change at line 57
inline const Col& operator=(const subview_cube<eT>& X); inline const Col& operator=(const subview_cube<eT>& X);
inline mat_injector<Col> operator<<(const eT val); inline mat_injector<Col> operator<<(const eT val);
arma_inline eT& row(const u32 row_num); arma_inline eT& row(const u32 row_num);
arma_inline eT row(const u32 row_num) const; arma_inline eT row(const u32 row_num) const;
arma_inline subview_col<eT> rows(const u32 in_row1, const u32 in_ro w2); arma_inline subview_col<eT> rows(const u32 in_row1, const u32 in_ro w2);
arma_inline const subview_col<eT> rows(const u32 in_row1, const u32 in_ro w2) const; arma_inline const subview_col<eT> rows(const u32 in_row1, const u32 in_ro w2) const;
arma_inline subview_col<eT> subvec(const u32 in_row1, const u32 in_
row2);
arma_inline const subview_col<eT> subvec(const u32 in_row1, const u32 in_
row2) const;
inline void shed_row (const u32 row_num); inline void shed_row (const u32 row_num);
inline void shed_rows(const u32 in_row1, const u32 in_row2); inline void shed_rows(const u32 in_row1, const u32 in_row2);
inline void insert_rows(const u32 row_num, const u3 2 N, const bool set_to_zero = true); inline void insert_rows(const u32 row_num, const u3 2 N, const bool set_to_zero = true);
template<typename T1> inline void insert_rows(const u32 row_num, const Ba se<eT,T1>& X); template<typename T1> inline void insert_rows(const u32 row_num, const Ba se<eT,T1>& X);
typedef eT* row_iterator; typedef eT* row_iterator;
typedef const eT* const_row_iterator; typedef const eT* const_row_iterator;
inline row_iterator begin_row(const u32 row_num); inline row_iterator begin_row(const u32 row_num);
 End of changes. 2 change blocks. 
1 lines changed or deleted 6 lines changed or added


 Cube_meat.hpp   Cube_meat.hpp 
skipping to change at line 1565 skipping to change at line 1565
//! linear element accessor (treats the cube as a vector); no bounds check //! linear element accessor (treats the cube as a vector); no bounds check
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT eT
Cube<eT>::operator[] (const u32 i) const Cube<eT>::operator[] (const u32 i) const
{ {
return mem[i]; return mem[i];
} }
//! linear element accessor (treats the cube as a vector); no bounds check.
template<typename eT>
arma_inline
arma_warn_unused
eT&
Cube<eT>::at(const u32 i)
{
return access::rw(mem[i]);
}
//! linear element accessor (treats the cube as a vector); no bounds check
template<typename eT>
arma_inline
arma_warn_unused
eT
Cube<eT>::at(const u32 i) const
{
return mem[i];
}
//! element accessor; bounds checking not done when ARMA_NO_DEBUG is define d //! element accessor; bounds checking not done when ARMA_NO_DEBUG is define d
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Cube<eT>::operator() (const u32 in_row, const u32 in_col, const u32 in_slic e) Cube<eT>::operator() (const u32 in_row, const u32 in_col, const u32 in_slic e)
{ {
arma_debug_check arma_debug_check
( (
(in_row >= n_rows) || (in_row >= n_rows) ||
skipping to change at line 2064 skipping to change at line 2084
switch(type) switch(type)
{ {
case raw_ascii: case raw_ascii:
save_okay = diskio::save_raw_ascii(*this, name); save_okay = diskio::save_raw_ascii(*this, name);
break; break;
case arma_ascii: case arma_ascii:
save_okay = diskio::save_arma_ascii(*this, name); save_okay = diskio::save_arma_ascii(*this, name);
break; break;
case raw_binary:
save_okay = diskio::save_raw_binary(*this, name);
break;
case arma_binary: case arma_binary:
save_okay = diskio::save_arma_binary(*this, name); save_okay = diskio::save_arma_binary(*this, name);
break; break;
case ppm_binary: case ppm_binary:
save_okay = diskio::save_ppm_binary(*this, name); save_okay = diskio::save_ppm_binary(*this, name);
break; break;
default: default:
arma_warn(print_status, "Cube::save(): unsupported file type"); arma_warn(print_status, "Cube::save(): unsupported file type");
skipping to change at line 2102 skipping to change at line 2126
switch(type) switch(type)
{ {
case raw_ascii: case raw_ascii:
save_okay = diskio::save_raw_ascii(*this, os); save_okay = diskio::save_raw_ascii(*this, os);
break; break;
case arma_ascii: case arma_ascii:
save_okay = diskio::save_arma_ascii(*this, os); save_okay = diskio::save_arma_ascii(*this, os);
break; break;
case raw_binary:
save_okay = diskio::save_raw_binary(*this, os);
break;
case arma_binary: case arma_binary:
save_okay = diskio::save_arma_binary(*this, os); save_okay = diskio::save_arma_binary(*this, os);
break; break;
case ppm_binary: case ppm_binary:
save_okay = diskio::save_ppm_binary(*this, os); save_okay = diskio::save_ppm_binary(*this, os);
break; break;
default: default:
arma_warn(print_status, "Cube::save(): unsupported file type"); arma_warn(print_status, "Cube::save(): unsupported file type");
skipping to change at line 2145 skipping to change at line 2173
break; break;
case raw_ascii: case raw_ascii:
load_okay = diskio::load_raw_ascii(*this, name, err_msg); load_okay = diskio::load_raw_ascii(*this, name, err_msg);
break; break;
case arma_ascii: case arma_ascii:
load_okay = diskio::load_arma_ascii(*this, name, err_msg); load_okay = diskio::load_arma_ascii(*this, name, err_msg);
break; break;
case raw_binary:
load_okay = diskio::load_raw_binary(*this, name, err_msg);
break;
case arma_binary: case arma_binary:
load_okay = diskio::load_arma_binary(*this, name, err_msg); load_okay = diskio::load_arma_binary(*this, name, err_msg);
break; break;
case ppm_binary: case ppm_binary:
load_okay = diskio::load_ppm_binary(*this, name, err_msg); load_okay = diskio::load_ppm_binary(*this, name, err_msg);
break; break;
default: default:
arma_warn(print_status, "Cube::load(): unsupported file type"); arma_warn(print_status, "Cube::load(): unsupported file type");
skipping to change at line 2203 skipping to change at line 2235
break; break;
case raw_ascii: case raw_ascii:
load_okay = diskio::load_raw_ascii(*this, is, err_msg); load_okay = diskio::load_raw_ascii(*this, is, err_msg);
break; break;
case arma_ascii: case arma_ascii:
load_okay = diskio::load_arma_ascii(*this, is, err_msg); load_okay = diskio::load_arma_ascii(*this, is, err_msg);
break; break;
case raw_binary:
load_okay = diskio::load_raw_binary(*this, is, err_msg);
break;
case arma_binary: case arma_binary:
load_okay = diskio::load_arma_binary(*this, is, err_msg); load_okay = diskio::load_arma_binary(*this, is, err_msg);
break; break;
case ppm_binary: case ppm_binary:
load_okay = diskio::load_ppm_binary(*this, is, err_msg); load_okay = diskio::load_ppm_binary(*this, is, err_msg);
break; break;
default: default:
arma_warn(print_status, "Cube::load(): unsupported file type"); arma_warn(print_status, "Cube::load(): unsupported file type");
 End of changes. 5 change blocks. 
0 lines changed or deleted 36 lines changed or added


 Cube_proto.hpp   Cube_proto.hpp 
skipping to change at line 149 skipping to change at line 149
template<typename T1, typename T2, typename glue_type> inline Cube(const mtGlueCube<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline Cube(const mtGlueCube<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Cube& operator=(const mtGlueCube<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Cube& operator=(const mtGlueCube<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Cube& operator+=(const mtGlueCube<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Cube& operator+=(const mtGlueCube<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Cube& operator-=(const mtGlueCube<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Cube& operator-=(const mtGlueCube<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Cube& operator%=(const mtGlueCube<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Cube& operator%=(const mtGlueCube<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Cube& operator/=(const mtGlueCube<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Cube& operator/=(const mtGlueCube<eT, T1, T2, glue_type>& X);
arma_inline arma_warn_unused eT& operator[] (const u32 i); arma_inline arma_warn_unused eT& operator[] (const u32 i);
arma_inline arma_warn_unused eT operator[] (const u32 i) const; arma_inline arma_warn_unused eT operator[] (const u32 i) const;
arma_inline arma_warn_unused eT& at(const u32 i);
arma_inline arma_warn_unused eT at(const u32 i) const;
arma_inline arma_warn_unused eT& operator() (const u32 i); arma_inline arma_warn_unused eT& operator() (const u32 i);
arma_inline arma_warn_unused eT operator() (const u32 i) const; arma_inline arma_warn_unused eT operator() (const u32 i) const;
arma_inline arma_warn_unused eT& at (const u32 in_row, const u32 in_col, const u32 in_slice); arma_inline arma_warn_unused eT& at (const u32 in_row, const u32 in_col, const u32 in_slice);
arma_inline arma_warn_unused eT at (const u32 in_row, const u32 in_col, const u32 in_slice) const; arma_inline arma_warn_unused eT at (const u32 in_row, const u32 in_col, const u32 in_slice) const;
arma_inline arma_warn_unused eT& operator() (const u32 in_row, const u32 in_col, const u32 in_slice); arma_inline arma_warn_unused eT& operator() (const u32 in_row, const u32 in_col, const u32 in_slice);
arma_inline arma_warn_unused eT operator() (const u32 in_row, const u32 in_col, const u32 in_slice) const; arma_inline arma_warn_unused eT operator() (const u32 in_row, const u32 in_col, const u32 in_slice) const;
arma_inline const Cube& operator++(); arma_inline const Cube& operator++();
arma_inline void operator++(int); arma_inline void operator++(int);
arma_inline const Cube& operator--(); arma_inline const Cube& operator--();
arma_inline void operator--(int); arma_inline void operator--(int);
arma_inline arma_warn_unused bool is_finite() const; arma_inline arma_warn_unused bool is_finite() const;
arma_inline arma_warn_unused bool is_empty() const; arma_inline arma_warn_unused bool is_empty() const;
// TODO: expand .in_range() to handle ranges specified by span
arma_inline arma_warn_unused bool in_range(const u32 i) const; arma_inline arma_warn_unused bool in_range(const u32 i) const;
arma_inline arma_warn_unused bool in_range(const u32 in_row, const u32 in _col, const u32 in_slice) const; arma_inline arma_warn_unused bool in_range(const u32 in_row, const u32 in _col, const u32 in_slice) const;
arma_inline arma_warn_unused eT* memptr(); arma_inline arma_warn_unused eT* memptr();
arma_inline arma_warn_unused const eT* memptr() const; arma_inline arma_warn_unused const eT* memptr() const;
arma_inline arma_warn_unused eT* slice_memptr(const u32 slice); arma_inline arma_warn_unused eT* slice_memptr(const u32 slice);
arma_inline arma_warn_unused const eT* slice_memptr(const u32 slice) cons t; arma_inline arma_warn_unused const eT* slice_memptr(const u32 slice) cons t;
arma_inline arma_warn_unused eT* slice_colptr(const u32 in_slice, c onst u32 in_col); arma_inline arma_warn_unused eT* slice_colptr(const u32 in_slice, c onst u32 in_col);
 End of changes. 3 change blocks. 
0 lines changed or deleted 6 lines changed or added


 Mat_meat.hpp   Mat_meat.hpp 
skipping to change at line 967 skipping to change at line 967
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>
template<typename T1>
inline
Mat<eT>::Mat(const subview_elem1<eT,T1>& X)
: n_rows(0)
, n_cols(0)
, n_elem(0)
, vec_state(0)
, mem_state(0)
//, mem(0)
, mem(mem)
{
arma_extra_debug_sigprint_this(this);
this->operator=(X);
}
template<typename eT>
template<typename T1>
inline
const Mat<eT>&
Mat<eT>::operator=(const subview_elem1<eT,T1>& X)
{
arma_extra_debug_sigprint();
subview_elem1<eT,T1>::extract(*this, X);
return *this;
}
template<typename eT>
template<typename T1>
inline
const Mat<eT>&
Mat<eT>::operator+=(const subview_elem1<eT,T1>& X)
{
arma_extra_debug_sigprint();
subview_elem1<eT,T1>::plus_inplace(*this, X);
return *this;
}
template<typename eT>
template<typename T1>
inline
const Mat<eT>&
Mat<eT>::operator-=(const subview_elem1<eT,T1>& X)
{
arma_extra_debug_sigprint();
subview_elem1<eT,T1>::minus_inplace(*this, X);
return *this;
}
template<typename eT>
template<typename T1>
inline
const Mat<eT>&
Mat<eT>::operator*=(const subview_elem1<eT,T1>& X)
{
arma_extra_debug_sigprint();
glue_times::apply_inplace(*this, X);
return *this;
}
template<typename eT>
template<typename T1>
inline
const Mat<eT>&
Mat<eT>::operator%=(const subview_elem1<eT,T1>& X)
{
arma_extra_debug_sigprint();
subview_elem1<eT,T1>::schur_inplace(*this, X);
return *this;
}
template<typename eT>
template<typename T1>
inline
const Mat<eT>&
Mat<eT>::operator/=(const subview_elem1<eT,T1>& X)
{
arma_extra_debug_sigprint();
subview_elem1<eT,T1>::div_inplace(*this, X);
return *this;
}
template<typename eT>
inline inline
mat_injector< Mat<eT> > mat_injector< Mat<eT> >
Mat<eT>::operator<<(const eT val) Mat<eT>::operator<<(const eT val)
{ {
return mat_injector< Mat<eT> >(*this, val); return mat_injector< Mat<eT> >(*this, val);
} }
template<typename eT> template<typename eT>
inline inline
mat_injector< Mat<eT> > mat_injector< Mat<eT> >
skipping to change at line 990 skipping to change at line 1085
} }
//! creation of subview (row vector) //! creation of subview (row vector)
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_row<eT> subview_row<eT>
Mat<eT>::row(const u32 row_num) Mat<eT>::row(const u32 row_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( row_num >= n_rows, "Mat::row(): row out of bounds" ); arma_debug_check( row_num >= n_rows, "Mat::row(): out of bounds" );
return subview_row<eT>(*this, row_num); return subview_row<eT>(*this, row_num);
} }
//! creation of subview (row vector) //! creation of subview (row vector)
template<typename eT> template<typename eT>
arma_inline arma_inline
const subview_row<eT> const subview_row<eT>
Mat<eT>::row(const u32 row_num) const Mat<eT>::row(const u32 row_num) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( row_num >= n_rows, "Mat::row(): row out of bounds" ); arma_debug_check( row_num >= n_rows, "Mat::row(): out of bounds" );
return subview_row<eT>(*this, row_num);
}
template<typename eT>
arma_inline
subview_row<eT>
Mat<eT>::operator()(const u32 row_num, const span_helper)
{
arma_extra_debug_sigprint();
arma_debug_check( (row_num >= n_rows), "Mat::operator(): row out of bound
s" );
return subview_row<eT>(*this, row_num);
}
template<typename eT>
arma_inline
const subview_row<eT>
Mat<eT>::operator()(const u32 row_num, const span_helper) const
{
arma_extra_debug_sigprint();
arma_debug_check( (row_num >= n_rows), "Mat::operator(): row out of bound
s" );
return subview_row<eT>(*this, row_num); return subview_row<eT>(*this, row_num);
} }
template<typename eT>
arma_inline
subview_row<eT>
Mat<eT>::operator()(const u32 row_num, const span& col_span)
{
arma_extra_debug_sigprint();
const u32 a = col_span.a;
const u32 b = col_span.b;
arma_debug_check
(
(row_num >= n_rows) || (a > b) || (b >= n_cols),
"Mat::operator(): indices out of bounds or incorrectly used"
);
return subview_row<eT>(*this, row_num, a, b);
}
template<typename eT>
arma_inline
const subview_row<eT>
Mat<eT>::operator()(const u32 row_num, const span& col_span) const
{
arma_extra_debug_sigprint();
const u32 a = col_span.a;
const u32 b = col_span.b;
arma_debug_check
(
(row_num >= n_rows) || (a > b) || (b >= n_cols),
"Mat::operator(): indices out of bounds or incorrectly used"
);
return subview_row<eT>(*this, row_num, a, b);
}
//! creation of subview (column vector) //! creation of subview (column vector)
template<typename eT> template<typename eT>
arma_inline arma_inline
subview_col<eT> subview_col<eT>
Mat<eT>::col(const u32 col_num) Mat<eT>::col(const u32 col_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( col_num >= n_cols, "Mat::col(): out of bounds"); arma_debug_check( col_num >= n_cols, "Mat::col(): out of bounds");
skipping to change at line 1034 skipping to change at line 1191
const subview_col<eT> const subview_col<eT>
Mat<eT>::col(const u32 col_num) const Mat<eT>::col(const u32 col_num) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( col_num >= n_cols, "Mat::col(): out of bounds"); arma_debug_check( col_num >= n_cols, "Mat::col(): out of bounds");
return subview_col<eT>(*this, col_num); return subview_col<eT>(*this, col_num);
} }
template<typename eT>
arma_inline
subview_col<eT>
Mat<eT>::operator()(const span_helper, const u32 col_num)
{
arma_extra_debug_sigprint();
arma_debug_check( col_num >= n_cols, "Mat::operator(): column out of boun
ds");
return subview_col<eT>(*this, col_num);
}
template<typename eT>
arma_inline
const subview_col<eT>
Mat<eT>::operator()(const span_helper, const u32 col_num) const
{
arma_extra_debug_sigprint();
arma_debug_check( col_num >= n_cols, "Mat::operator(): column out of boun
ds");
return subview_col<eT>(*this, col_num);
}
template<typename eT>
arma_inline
subview_col<eT>
Mat<eT>::operator()(const span& row_span, const u32 col_num)
{
arma_extra_debug_sigprint();
const u32 a = row_span.a;
const u32 b = row_span.b;
arma_debug_check
(
(col_num >= n_cols) || (a > b) || (b >= n_rows),
"Mat::operator(): indices out of bounds or incorrectly used"
);
return subview_col<eT>(*this, col_num, a, b);
}
template<typename eT>
arma_inline
const subview_col<eT>
Mat<eT>::operator()(const span& row_span, const u32 col_num) const
{
arma_extra_debug_sigprint();
const u32 a = row_span.a;
const u32 b = row_span.b;
arma_debug_check
(
(col_num >= n_cols) || (a > b) || (b >= n_rows),
"Mat::operator(): indices out of bounds or incorrectly used"
);
return subview_col<eT>(*this, col_num, a, b);
}
//! create a Col object which uses memory from an existing matrix object. //! create a Col object which uses memory from an existing matrix object.
//! this approach is currently not alias safe //! this approach is currently not alias safe
//! and does not take into account that the parent matrix object could be d eleted. //! and does not take into account that the parent matrix object could be d eleted.
//! if deleted memory is accessed by the created Col object, //! if deleted memory is accessed by the created Col object,
//! it will cause memory corruption and/or a crash //! it will cause memory corruption and/or a crash
template<typename eT> template<typename eT>
inline inline
Col<eT> Col<eT>
Mat<eT>::unsafe_col(const u32 col_num) Mat<eT>::unsafe_col(const u32 col_num)
{ {
skipping to change at line 1216 skipping to change at line 1435
arma_debug_check arma_debug_check
( (
(in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || ( in_col2 >= n_cols), (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || ( in_col2 >= n_cols),
"Mat::submat(): indices out of bounds or incorrectly used" "Mat::submat(): indices out of bounds or incorrectly used"
); );
return subview<eT>(*this, in_row1, in_col1, in_row2, in_col2); return subview<eT>(*this, in_row1, in_col1, in_row2, in_col2);
} }
template<typename eT>
arma_inline
subview<eT>
Mat<eT>::operator()(const span& row_span, const span& col_span)
{
arma_extra_debug_sigprint();
return submat(row_span, col_span);
}
template<typename eT>
arma_inline
const subview<eT>
Mat<eT>::operator()(const span& row_span, const span& col_span) const
{
arma_extra_debug_sigprint();
return submat(row_span, col_span);
}
template<typename eT>
template<typename T1>
arma_inline
subview_elem1<eT,T1>
Mat<eT>::elem(const Base<u32,T1>& a)
{
arma_extra_debug_sigprint();
return subview_elem1<eT,T1>(*this, a);
}
template<typename eT>
template<typename T1>
arma_inline
const subview_elem1<eT,T1>
Mat<eT>::elem(const Base<u32,T1>& a) const
{
arma_extra_debug_sigprint();
return subview_elem1<eT,T1>(*this, a);
}
// template<typename eT>
// template<typename T1, typename T2>
// arma_inline
// subview_elem2<eT,T1,T2>
// Mat<eT>::elem(const Base<u32,T1>& a, const Base<u32,T2>& b)
// {
// arma_extra_debug_sigprint();
//
// return subview_elem2<eT,T1,T2>(*this, a, b);
// }
//
//
//
// template<typename eT>
// template<typename T1, typename T2>
// arma_inline
// const subview_elem2<eT,T1,T2>
// Mat<eT>::elem(const Base<u32,T1>& a, const Base<u32,T2>& b) const
// {
// arma_extra_debug_sigprint();
//
// return subview_elem2<eT,T1,T2>(*this, a, b);
// }
//! creation of diagview (diagonal) //! creation of diagview (diagonal)
template<typename eT> template<typename eT>
arma_inline arma_inline
diagview<eT> diagview<eT>
Mat<eT>::diag(const s32 in_id) Mat<eT>::diag(const s32 in_id)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const u32 row_offset = (in_id < 0) ? -in_id : 0; const u32 row_offset = (in_id < 0) ? -in_id : 0;
const u32 col_offset = (in_id > 0) ? in_id : 0; const u32 col_offset = (in_id > 0) ? in_id : 0;
skipping to change at line 2314 skipping to change at line 2599
//! linear element accessor (treats the matrix as a vector); no bounds chec k //! linear element accessor (treats the matrix as a vector); no bounds chec k
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT eT
Mat<eT>::operator[] (const u32 i) const Mat<eT>::operator[] (const u32 i) const
{ {
return mem[i]; return mem[i];
} }
//! linear element accessor (treats the matrix as a vector); no bounds chec
k.
template<typename eT>
arma_inline
arma_warn_unused
eT&
Mat<eT>::at(const u32 i)
{
return access::rw(mem[i]);
}
//! linear element accessor (treats the matrix as a vector); no bounds chec
k
template<typename eT>
arma_inline
arma_warn_unused
eT
Mat<eT>::at(const u32 i) const
{
return mem[i];
}
//! element accessor; bounds checking not done when ARMA_NO_DEBUG is define d //! element accessor; bounds checking not done when ARMA_NO_DEBUG is define d
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT& eT&
Mat<eT>::operator() (const u32 in_row, const u32 in_col) Mat<eT>::operator() (const u32 in_row, const u32 in_col)
{ {
arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "Mat::opera tor(): out of bounds"); arma_debug_check( ((in_row >= n_rows) || (in_col >= n_cols)), "Mat::opera tor(): out of bounds");
return access::rw(mem[in_row + in_col*n_rows]); return access::rw(mem[in_row + in_col*n_rows]);
} }
skipping to change at line 2468 skipping to change at line 2773
//! returns true if the given index is currently in range //! returns true if the given index is currently in range
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
bool bool
Mat<eT>::in_range(const u32 i) const Mat<eT>::in_range(const u32 i) const
{ {
return (i < n_elem); return (i < n_elem);
} }
//! returns true if the given start and end indices are currently in range
template<typename eT>
arma_inline
arma_warn_unused
bool
Mat<eT>::in_range(const span& x) const
{
arma_extra_debug_sigprint();
const u32 a = x.a;
const u32 b = x.b;
return ( (a <= b) && (b < n_elem) );
}
//! returns true if the given location is currently in range //! returns true if the given location is currently in range
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
bool bool
Mat<eT>::in_range(const u32 in_row, const u32 in_col) const Mat<eT>::in_range(const u32 in_row, const u32 in_col) const
{ {
return ( (in_row < n_rows) && (in_col < n_cols) ); return ( (in_row < n_rows) && (in_col < n_cols) );
} }
template<typename eT>
arma_inline
arma_warn_unused
bool
Mat<eT>::in_range(const span& row_span, const u32 in_col) const
{
arma_extra_debug_sigprint();
const u32 in_row1 = row_span.a;
const u32 in_row2 = row_span.b;
return ( (in_row1 <= in_row2) && (in_row2 < n_rows) && (in_col < n_cols)
);
}
template<typename eT>
arma_inline
arma_warn_unused
bool
Mat<eT>::in_range(const span& row_span, const span_helper) const
{
arma_extra_debug_sigprint();
const u32 in_row1 = row_span.a;
const u32 in_row2 = row_span.b;
return ( (in_row1 <= in_row2) && (in_row2 < n_rows) && (n_cols > 0) );
}
template<typename eT>
arma_inline
arma_warn_unused
bool
Mat<eT>::in_range(const u32 in_row, const span& col_span) const
{
arma_extra_debug_sigprint();
const u32 in_col1 = col_span.a;
const u32 in_col2 = col_span.b;
return ( (in_row < n_rows) && (in_col1 <= in_col2) && (in_col2 < n_cols)
);
}
template<typename eT>
arma_inline
arma_warn_unused
bool
Mat<eT>::in_range(const span_helper, const span& col_span) const
{
arma_extra_debug_sigprint();
const u32 in_col1 = col_span.a;
const u32 in_col2 = col_span.b;
return ( (n_rows > 0) && (in_col1 <= in_col2) && (in_col2 < n_cols) );
}
template<typename eT>
arma_inline
arma_warn_unused
bool
Mat<eT>::in_range(const span& row_span, const span& col_span) const
{
arma_extra_debug_sigprint();
const u32 in_row1 = row_span.a;
const u32 in_row2 = row_span.b;
const u32 in_col1 = col_span.a;
const u32 in_col2 = col_span.b;
return ( (in_row1 <= in_row2) && (in_row2 < n_rows) && (in_col1 <= in_col
2) && (in_col2 < n_cols) );
}
//! returns a pointer to array of eTs for a specified column; no bounds che ck //! returns a pointer to array of eTs for a specified column; no bounds che ck
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT* eT*
Mat<eT>::colptr(const u32 in_col) Mat<eT>::colptr(const u32 in_col)
{ {
return & access::rw(mem[in_col*n_rows]); return & access::rw(mem[in_col*n_rows]);
} }
skipping to change at line 2993 skipping to change at line 3386
switch(type) switch(type)
{ {
case raw_ascii: case raw_ascii:
save_okay = diskio::save_raw_ascii(*this, name); save_okay = diskio::save_raw_ascii(*this, name);
break; break;
case arma_ascii: case arma_ascii:
save_okay = diskio::save_arma_ascii(*this, name); save_okay = diskio::save_arma_ascii(*this, name);
break; break;
case raw_binary:
save_okay = diskio::save_raw_binary(*this, name);
break;
case arma_binary: case arma_binary:
save_okay = diskio::save_arma_binary(*this, name); save_okay = diskio::save_arma_binary(*this, name);
break; break;
case pgm_binary: case pgm_binary:
save_okay = diskio::save_pgm_binary(*this, name); save_okay = diskio::save_pgm_binary(*this, name);
break; break;
default: default:
arma_warn(print_status, "Mat::save(): unsupported file type"); arma_warn(print_status, "Mat::save(): unsupported file type");
skipping to change at line 3031 skipping to change at line 3428
switch(type) switch(type)
{ {
case raw_ascii: case raw_ascii:
save_okay = diskio::save_raw_ascii(*this, os); save_okay = diskio::save_raw_ascii(*this, os);
break; break;
case arma_ascii: case arma_ascii:
save_okay = diskio::save_arma_ascii(*this, os); save_okay = diskio::save_arma_ascii(*this, os);
break; break;
case raw_binary:
save_okay = diskio::save_raw_binary(*this, os);
break;
case arma_binary: case arma_binary:
save_okay = diskio::save_arma_binary(*this, os); save_okay = diskio::save_arma_binary(*this, os);
break; break;
case pgm_binary: case pgm_binary:
save_okay = diskio::save_pgm_binary(*this, os); save_okay = diskio::save_pgm_binary(*this, os);
break; break;
default: default:
arma_warn(print_status, "Mat::save(): unsupported file type"); arma_warn(print_status, "Mat::save(): unsupported file type");
skipping to change at line 3074 skipping to change at line 3475
break; break;
case raw_ascii: case raw_ascii:
load_okay = diskio::load_raw_ascii(*this, name, err_msg); load_okay = diskio::load_raw_ascii(*this, name, err_msg);
break; break;
case arma_ascii: case arma_ascii:
load_okay = diskio::load_arma_ascii(*this, name, err_msg); load_okay = diskio::load_arma_ascii(*this, name, err_msg);
break; break;
case raw_binary:
load_okay = diskio::load_raw_binary(*this, name, err_msg);
break;
case arma_binary: case arma_binary:
load_okay = diskio::load_arma_binary(*this, name, err_msg); load_okay = diskio::load_arma_binary(*this, name, err_msg);
break; break;
case pgm_binary: case pgm_binary:
load_okay = diskio::load_pgm_binary(*this, name, err_msg); load_okay = diskio::load_pgm_binary(*this, name, err_msg);
break; break;
default: default:
arma_warn(print_status, "Mat::load(): unsupported file type"); arma_warn(print_status, "Mat::load(): unsupported file type");
skipping to change at line 3132 skipping to change at line 3537
break; break;
case raw_ascii: case raw_ascii:
load_okay = diskio::load_raw_ascii(*this, is, err_msg); load_okay = diskio::load_raw_ascii(*this, is, err_msg);
break; break;
case arma_ascii: case arma_ascii:
load_okay = diskio::load_arma_ascii(*this, is, err_msg); load_okay = diskio::load_arma_ascii(*this, is, err_msg);
break; break;
case raw_binary:
load_okay = diskio::load_raw_binary(*this, is, err_msg);
break;
case arma_binary: case arma_binary:
load_okay = diskio::load_arma_binary(*this, is, err_msg); load_okay = diskio::load_arma_binary(*this, is, err_msg);
break; break;
case pgm_binary: case pgm_binary:
load_okay = diskio::load_pgm_binary(*this, is, err_msg); load_okay = diskio::load_pgm_binary(*this, is, err_msg);
break; break;
default: default:
arma_warn(print_status, "Mat::load(): unsupported file type"); arma_warn(print_status, "Mat::load(): unsupported file type");
 End of changes. 13 change blocks. 
2 lines changed or deleted 420 lines changed or added


 Mat_proto.hpp   Mat_proto.hpp 
skipping to change at line 105 skipping to change at line 105
//inline explicit Mat(const diagview<eT>& X); //inline explicit Mat(const diagview<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);
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);
inline mat_injector<Mat> operator<<(const eT val); inline mat_injector<Mat> operator<<(const eT val);
inline mat_injector<Mat> operator<<(const injector_helper x); inline mat_injector<Mat> operator<<(const injector_helper x);
arma_inline subview_row<eT> row(const u32 row_num); arma_inline subview_row<eT> row(const u32 row_num);
arma_inline const subview_row<eT> row(const u32 row_num) const; arma_inline const subview_row<eT> row(const u32 row_num) const;
arma_inline subview_row<eT> operator()(const u32 row_num, const spa
n_helper);
arma_inline const subview_row<eT> operator()(const u32 row_num, const spa
n_helper) const;
arma_inline subview_row<eT> operator()(const u32 row_num, const spa
n& col_span);
arma_inline const subview_row<eT> operator()(const u32 row_num, const spa
n& col_span) const;
arma_inline subview_col<eT> col(const u32 col_num); arma_inline subview_col<eT> col(const u32 col_num);
arma_inline const subview_col<eT> col(const u32 col_num) const; arma_inline const subview_col<eT> col(const u32 col_num) const;
arma_inline subview_col<eT> operator()(const span_helper, const
u32 col_num);
arma_inline const subview_col<eT> operator()(const span_helper, const
u32 col_num) const;
arma_inline subview_col<eT> operator()(const span& row_span, const
u32 col_num);
arma_inline const subview_col<eT> operator()(const span& row_span, const
u32 col_num) const;
inline Col<eT> unsafe_col(const u32 col_num); inline Col<eT> unsafe_col(const u32 col_num);
inline const Col<eT> unsafe_col(const u32 col_num) const; inline const Col<eT> unsafe_col(const u32 col_num) const;
arma_inline subview<eT> rows(const u32 in_row1, const u32 in_row2); arma_inline subview<eT> rows(const u32 in_row1, const u32 in_row2);
arma_inline const subview<eT> rows(const u32 in_row1, const u32 in_row2) const; arma_inline const subview<eT> rows(const u32 in_row1, const u32 in_row2) const;
arma_inline subview<eT> cols(const u32 in_col1, const u32 in_col2); arma_inline subview<eT> cols(const u32 in_col1, const u32 in_col2);
arma_inline const subview<eT> cols(const u32 in_col1, const u32 in_col2) const; arma_inline const subview<eT> cols(const u32 in_col1, const u32 in_col2) const;
arma_inline subview<eT> submat(const u32 in_row1, const u32 in_col1 , const u32 in_row2, const u32 in_col2); arma_inline subview<eT> submat(const u32 in_row1, const u32 in_col1 , const u32 in_row2, const u32 in_col2);
arma_inline const subview<eT> submat(const u32 in_row1, const u32 in_col1 , const u32 in_row2, const u32 in_col2) const; arma_inline const subview<eT> submat(const u32 in_row1, const u32 in_col1 , const u32 in_row2, const u32 in_col2) const;
arma_inline subview<eT> submat(const span& row_span, const span& co arma_inline subview<eT> submat (const span& row_span, const span
l_span); & col_span);
arma_inline const subview<eT> submat(const span& row_span, const span& co arma_inline const subview<eT> submat (const span& row_span, const span
l_span) const; & col_span) const;
arma_inline subview<eT> operator()(const span& row_span, const span
& col_span);
arma_inline const subview<eT> operator()(const span& row_span, const span
& col_span) const;
template<typename T1> arma_inline subview_elem1<eT,T1> elem(const B
ase<u32,T1>& a);
template<typename T1> arma_inline const subview_elem1<eT,T1> elem(const B
ase<u32,T1>& a) const;
// template<typename T1, typename T2> arma_inline subview_elem2<eT,
T1,T2> submat(const Base<u32,T1>& a, const Base<u32,T2>& b);
// template<typename T1, typename T2> arma_inline const subview_elem2<eT,
T1,T2> submat(const Base<u32,T1>& a, const Base<u32,T2>& b) const;
arma_inline diagview<eT> diag(const s32 in_id = 0); arma_inline diagview<eT> diag(const s32 in_id = 0);
arma_inline const diagview<eT> diag(const s32 in_id = 0) const; arma_inline const diagview<eT> diag(const s32 in_id = 0) const;
inline void swap_rows(const u32 in_row1, const u32 in_row2); inline void swap_rows(const u32 in_row1, const u32 in_row2);
inline void swap_cols(const u32 in_col1, const u32 in_col2); inline void swap_cols(const u32 in_col1, const u32 in_col2);
inline void shed_row(const u32 row_num); inline void shed_row(const u32 row_num);
inline void shed_col(const u32 col_num); inline void shed_col(const u32 col_num);
skipping to change at line 200 skipping to change at line 229
template<typename T1, typename T2, typename glue_type> inline Mat(const mtGlue<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline Mat(const mtGlue<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Mat& operator=(const mtGlue<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Mat& operator=(const mtGlue<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Mat& operator+=(const mtGlue<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Mat& operator+=(const mtGlue<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Mat& operator-=(const mtGlue<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Mat& operator-=(const mtGlue<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Mat& operator*=(const mtGlue<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Mat& operator*=(const mtGlue<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Mat& operator%=(const mtGlue<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Mat& operator%=(const mtGlue<eT, T1, T2, glue_type>& X);
template<typename T1, typename T2, typename glue_type> inline const Mat& operator/=(const mtGlue<eT, T1, T2, glue_type>& X); template<typename T1, typename T2, typename glue_type> inline const Mat& operator/=(const mtGlue<eT, T1, T2, glue_type>& X);
arma_inline arma_warn_unused eT& operator[] (const u32 i); arma_inline arma_warn_unused eT& operator[] (const u32 i);
arma_inline arma_warn_unused eT operator[] (const u32 i) const; arma_inline arma_warn_unused eT operator[] (const u32 i) const;
arma_inline arma_warn_unused eT& at (const u32 i);
arma_inline arma_warn_unused eT at (const u32 i) const;
arma_inline arma_warn_unused eT& operator() (const u32 i); arma_inline arma_warn_unused eT& operator() (const u32 i);
arma_inline arma_warn_unused eT operator() (const u32 i) const; arma_inline arma_warn_unused eT operator() (const u32 i) const;
arma_inline arma_warn_unused eT& at (const u32 in_row, const u32 in_col); arma_inline arma_warn_unused eT& at (const u32 in_row, const u32 in_col);
arma_inline arma_warn_unused eT at (const u32 in_row, const u32 in_col) const; arma_inline arma_warn_unused eT at (const u32 in_row, const u32 in_col) const;
arma_inline arma_warn_unused eT& operator() (const u32 in_row, const u32 in_col); arma_inline arma_warn_unused eT& operator() (const u32 in_row, const u32 in_col);
arma_inline arma_warn_unused eT operator() (const u32 in_row, const u32 in_col) const; arma_inline arma_warn_unused eT operator() (const u32 in_row, const u32 in_col) const;
arma_inline const Mat& operator++(); arma_inline const Mat& operator++();
arma_inline void operator++(int); arma_inline void operator++(int);
arma_inline const Mat& operator--(); arma_inline const Mat& operator--();
arma_inline void operator--(int); arma_inline void operator--(int);
arma_inline arma_warn_unused bool is_empty() const; arma_inline arma_warn_unused bool is_empty() const;
arma_inline arma_warn_unused bool is_vec() const; arma_inline arma_warn_unused bool is_vec() const;
arma_inline arma_warn_unused bool is_square() const; arma_inline arma_warn_unused bool is_square() const;
inline arma_warn_unused bool is_finite() const; inline arma_warn_unused bool is_finite() const;
arma_inline arma_warn_unused bool in_range(const u32 i) const; // TODO: test and add expanded .in_range() to user documentation
arma_inline arma_warn_unused bool in_range(const u32 in_row, const u32 in arma_inline arma_warn_unused bool in_range(const u32 i) const;
_col) const; arma_inline arma_warn_unused bool in_range(const span& x) const;
arma_inline arma_warn_unused bool in_range(const u32 in_row, co
nst u32 in_col ) const;
arma_inline arma_warn_unused bool in_range(const span& row_span, co
nst u32 in_col ) const;
arma_inline arma_warn_unused bool in_range(const span& row_span, co
nst span_helper junk ) const;
arma_inline arma_warn_unused bool in_range(const u32 in_row, co
nst span& col_span) const;
arma_inline arma_warn_unused bool in_range(const span_helper junk, co
nst span& col_span) const;
arma_inline arma_warn_unused bool in_range(const span& row_span, co
nst span& col_span) const;
arma_inline arma_warn_unused eT* colptr(const u32 in_col); arma_inline arma_warn_unused eT* colptr(const u32 in_col);
arma_inline arma_warn_unused const eT* colptr(const u32 in_col) const; arma_inline arma_warn_unused const eT* colptr(const u32 in_col) const;
arma_inline arma_warn_unused eT* memptr(); arma_inline arma_warn_unused eT* memptr();
arma_inline arma_warn_unused const eT* memptr() const; arma_inline arma_warn_unused const eT* memptr() const;
inline void print(const std::string extra_text = "") const; inline void print(const std::string extra_text = "") const;
inline void print(std::ostream& user_stream, const std::string extra_text = "") const; inline void print(std::ostream& user_stream, const std::string extra_text = "") const;
 End of changes. 6 change blocks. 
7 lines changed or deleted 72 lines changed or added


 Proxy.hpp   Proxy.hpp 
skipping to change at line 54 skipping to change at line 54
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline u32 get_n_rows() const { return Q.n_rows; } arma_inline u32 get_n_rows() const { return Q.n_rows; }
arma_inline u32 get_n_cols() const { return Q.n_cols; } arma_inline u32 get_n_cols() const { return Q.n_cols; }
arma_inline u32 get_n_elem() const { return Q.n_elem; } arma_inline u32 get_n_elem() const { return Q.n_elem; }
arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; } arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; }
arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); } arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); }
arma_inline ea_type get_ea() const { return Q.memptr(); } arma_inline ea_type get_ea() const { return Q.memptr();
}
arma_inline bool is_alias(const Mat<eT>& X) const { return (&Q == &X);
}
}; };
template<typename eT> template<typename eT>
class Proxy< Col<eT> > class Proxy< Col<eT> >
{ {
public: public:
typedef eT elem_type; typedef eT elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef Col<eT> stored_type; typedef Col<eT> stored_type;
skipping to change at line 82 skipping to change at line 83
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline u32 get_n_rows() const { return Q.n_rows; } arma_inline u32 get_n_rows() const { return Q.n_rows; }
arma_inline u32 get_n_cols() const { return Q.n_cols; } arma_inline u32 get_n_cols() const { return Q.n_cols; }
arma_inline u32 get_n_elem() const { return Q.n_elem; } arma_inline u32 get_n_elem() const { return Q.n_elem; }
arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; } arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; }
arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); } arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); }
arma_inline ea_type get_ea() const { return Q.memptr(); } arma_inline ea_type get_ea() const { return Q.memptr();
}
arma_inline bool is_alias(const Mat<eT>& X) const { return (&Q == &X);
}
}; };
template<typename eT> template<typename eT>
class Proxy< Row<eT> > class Proxy< Row<eT> >
{ {
public: public:
typedef eT elem_type; typedef eT elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef Row<eT> stored_type; typedef Row<eT> stored_type;
skipping to change at line 110 skipping to change at line 112
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline u32 get_n_rows() const { return Q.n_rows; } arma_inline u32 get_n_rows() const { return Q.n_rows; }
arma_inline u32 get_n_cols() const { return Q.n_cols; } arma_inline u32 get_n_cols() const { return Q.n_cols; }
arma_inline u32 get_n_elem() const { return Q.n_elem; } arma_inline u32 get_n_elem() const { return Q.n_elem; }
arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; } arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; }
arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); } arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); }
arma_inline ea_type get_ea() const { return Q.memptr(); } arma_inline ea_type get_ea() const { return Q.memptr();
}
arma_inline bool is_alias(const Mat<eT>& X) const { return (&Q == &X);
}
}; };
template<typename T1, typename op_type> template<typename T1, typename op_type>
class Proxy< Op<T1, op_type> > class Proxy< Op<T1, op_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 Mat<elem_type> stored_type; typedef Mat<elem_type> stored_type;
skipping to change at line 138 skipping to change at line 141
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline u32 get_n_rows() const { return Q.n_rows; } arma_inline u32 get_n_rows() const { return Q.n_rows; }
arma_inline u32 get_n_cols() const { return Q.n_cols; } arma_inline u32 get_n_cols() const { return Q.n_cols; }
arma_inline u32 get_n_elem() const { return Q.n_elem; } arma_inline u32 get_n_elem() const { return Q.n_elem; }
arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; } arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; }
arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); } arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); }
arma_inline ea_type get_ea() const { return Q.memptr(); } arma_inline ea_type get_ea() const { return Q.memp
tr(); }
arma_inline bool is_alias(const Mat<elem_type>&) const { return false;
}
}; };
template<typename T1, typename T2, typename glue_type> template<typename T1, typename T2, typename glue_type>
class Proxy< Glue<T1, T2, glue_type> > class Proxy< Glue<T1, T2, glue_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 Mat<elem_type> stored_type; typedef Mat<elem_type> stored_type;
skipping to change at line 166 skipping to change at line 170
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline u32 get_n_rows() const { return Q.n_rows; } arma_inline u32 get_n_rows() const { return Q.n_rows; }
arma_inline u32 get_n_cols() const { return Q.n_cols; } arma_inline u32 get_n_cols() const { return Q.n_cols; }
arma_inline u32 get_n_elem() const { return Q.n_elem; } arma_inline u32 get_n_elem() const { return Q.n_elem; }
arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; } arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; }
arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); } arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); }
arma_inline ea_type get_ea() const { return Q.memptr(); } arma_inline ea_type get_ea() const { return Q.memp
tr(); }
arma_inline bool is_alias(const Mat<elem_type>&) const { return false;
}
}; };
template<typename eT> template<typename eT>
class Proxy< subview<eT> > class Proxy< subview<eT> >
{ {
public: public:
typedef eT elem_type; typedef eT elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef subview<eT> stored_type; typedef subview<eT> stored_type;
skipping to change at line 194 skipping to change at line 199
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline u32 get_n_rows() const { return Q.n_rows; } arma_inline u32 get_n_rows() const { return Q.n_rows; }
arma_inline u32 get_n_cols() const { return Q.n_cols; } arma_inline u32 get_n_cols() const { return Q.n_cols; }
arma_inline u32 get_n_elem() const { return Q.n_elem; } arma_inline u32 get_n_elem() const { return Q.n_elem; }
arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; } arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; }
arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); } arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); }
arma_inline ea_type get_ea() const { return Q; } arma_inline ea_type get_ea() const { return Q;
}
arma_inline bool is_alias(const Mat<eT>& X) const { return (&(Q.m) ==
&X); }
};
template<typename eT, typename T1>
class Proxy< subview_elem1<eT,T1> >
{
public:
typedef eT elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
typedef Mat<eT> stored_type;
typedef const eT* ea_type;
arma_aligned const Mat<eT> Q;
inline explicit Proxy(const subview_elem1<eT,T1>& A)
: Q(A)
{
arma_extra_debug_sigprint();
}
arma_inline u32 get_n_rows() const { return Q.n_rows; }
arma_inline u32 get_n_cols() const { return Q.n_cols; }
arma_inline u32 get_n_elem() const { return Q.n_elem; }
arma_inline elem_type operator[] (const u32 i) const { r
eturn Q[i]; }
arma_inline elem_type at (const u32 row, const u32 col) const { r
eturn Q.at(row, col); }
arma_inline ea_type get_ea() const { return Q.memptr(); }
arma_inline bool is_alias(const Mat<eT>&) const { return false; }
}; };
template<typename eT> template<typename eT>
class Proxy< diagview<eT> > class Proxy< diagview<eT> >
{ {
public: public:
typedef eT elem_type; typedef eT elem_type;
typedef typename get_pod_type<elem_type>::result pod_type; typedef typename get_pod_type<elem_type>::result pod_type;
typedef diagview<eT> stored_type; typedef diagview<eT> stored_type;
skipping to change at line 222 skipping to change at line 257
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline u32 get_n_rows() const { return Q.n_rows; } arma_inline u32 get_n_rows() const { return Q.n_rows; }
arma_inline u32 get_n_cols() const { return Q.n_cols; } arma_inline u32 get_n_cols() const { return Q.n_cols; }
arma_inline u32 get_n_elem() const { return Q.n_elem; } arma_inline u32 get_n_elem() const { return Q.n_elem; }
arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; } arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; }
arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); } arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); }
arma_inline ea_type get_ea() const { return Q; } arma_inline ea_type get_ea() const { return Q;
}
arma_inline bool is_alias(const Mat<eT>& X) const { return (&(Q.m) ==
&X); }
}; };
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;
skipping to change at line 250 skipping to change at line 286
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline u32 get_n_rows() const { return Q.get_n_rows(); } arma_inline u32 get_n_rows() const { return Q.get_n_rows(); }
arma_inline u32 get_n_cols() const { return Q.get_n_cols(); } arma_inline u32 get_n_cols() const { return Q.get_n_cols(); }
arma_inline u32 get_n_elem() const { return Q.get_n_elem(); } arma_inline u32 get_n_elem() const { return Q.get_n_elem(); }
arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; } arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; }
arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); } arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); }
arma_inline ea_type get_ea() const { return Q; } arma_inline ea_type get_ea() const { return Q;
}
arma_inline bool is_alias(const Mat<elem_type>& X) const { return Q.P.
is_alias(X); }
}; };
template<typename T1, typename T2, typename eglue_type> template<typename T1, typename T2, typename eglue_type>
class Proxy< eGlue<T1, T2, eglue_type > > class Proxy< eGlue<T1, T2, eglue_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 eGlue<T1, T2, eglue_type> stored_type; typedef eGlue<T1, T2, eglue_type> stored_type;
skipping to change at line 278 skipping to change at line 315
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline u32 get_n_rows() const { return Q.get_n_rows(); } arma_inline u32 get_n_rows() const { return Q.get_n_rows(); }
arma_inline u32 get_n_cols() const { return Q.get_n_cols(); } arma_inline u32 get_n_cols() const { return Q.get_n_cols(); }
arma_inline u32 get_n_elem() const { return Q.get_n_elem(); } arma_inline u32 get_n_elem() const { return Q.get_n_elem(); }
arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; } arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; }
arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); } arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row, col); }
arma_inline ea_type get_ea() const { return Q; } arma_inline ea_type get_ea() const { return Q;
}
arma_inline bool is_alias(const Mat<elem_type>& X) const { return (Q.P
1.is_alias(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:
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 Mat<out_eT> stored_type; typedef Mat<out_eT> stored_type;
skipping to change at line 306 skipping to change at line 344
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline u32 get_n_rows() const { return Q.n_rows; } arma_inline u32 get_n_rows() const { return Q.n_rows; }
arma_inline u32 get_n_cols() const { return Q.n_cols; } arma_inline u32 get_n_cols() const { return Q.n_cols; }
arma_inline u32 get_n_elem() const { return Q.n_elem; } arma_inline u32 get_n_elem() const { return Q.n_elem; }
arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; } arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; }
arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row,col); } arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row,col); }
arma_inline ea_type get_ea() const { return Q.memptr(); } arma_inline ea_type get_ea() const { return Q.memptr(
); }
arma_inline bool is_alias(const Mat<out_eT>&) const { return false;
}
}; };
template<typename out_eT, typename T1, typename T2, typename glue_type> template<typename out_eT, typename T1, typename T2, typename glue_type>
class Proxy< mtGlue<out_eT, T1, T2, glue_type > > class Proxy< mtGlue<out_eT, T1, T2, glue_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 Mat<out_eT> stored_type; typedef Mat<out_eT> stored_type;
skipping to change at line 334 skipping to change at line 373
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
arma_inline u32 get_n_rows() const { return Q.n_rows; } arma_inline u32 get_n_rows() const { return Q.n_rows; }
arma_inline u32 get_n_cols() const { return Q.n_cols; } arma_inline u32 get_n_cols() const { return Q.n_cols; }
arma_inline u32 get_n_elem() const { return Q.n_elem; } arma_inline u32 get_n_elem() const { return Q.n_elem; }
arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; } arma_inline elem_type operator[] (const u32 i) const { r eturn Q[i]; }
arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row,col); } arma_inline elem_type at (const u32 row, const u32 col) const { r eturn Q.at(row,col); }
arma_inline ea_type get_ea() const { return Q.memptr(); } arma_inline ea_type get_ea() const { return Q.memptr(
); }
arma_inline bool is_alias(const Mat<out_eT>&) const { return false;
}
}; };
//! @} //! @}
 End of changes. 11 change blocks. 
11 lines changed or deleted 75 lines changed or added


 Row_meat.hpp   Row_meat.hpp 
skipping to change at line 241 skipping to change at line 241
arma_inline arma_inline
const subview_row<eT> const subview_row<eT>
Row<eT>::cols(const u32 in_col1, const u32 in_col2) Row<eT>::cols(const u32 in_col1, const u32 in_col2)
const const
{ {
arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat<eT>::n_cols) ) , "Row::cols(): indices out of bounds or incorrectly used"); arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat<eT>::n_cols) ) , "Row::cols(): indices out of bounds or incorrectly used");
return subview_row<eT>(*this, 0, in_col1, in_col2); return subview_row<eT>(*this, 0, in_col1, in_col2);
} }
template<typename eT>
arma_inline
subview_row<eT>
Row<eT>::subvec(const u32 in_col1, const u32 in_col2)
{
arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat<eT>::n_cols) )
, "Row::subvec(): indices out of bounds or incorrectly used");
return subview_row<eT>(*this, 0, in_col1, in_col2);
}
template<typename eT>
arma_inline
const subview_row<eT>
Row<eT>::subvec(const u32 in_col1, const u32 in_col2)
const
{
arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat<eT>::n_cols) )
, "Row::subvec(): indices out of bounds or incorrectly used");
return subview_row<eT>(*this, 0, in_col1, in_col2);
}
//! remove specified columns //! remove specified columns
template<typename eT> template<typename eT>
inline inline
void void
Row<eT>::shed_col(const u32 col_num) Row<eT>::shed_col(const u32 col_num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( col_num >= Mat<eT>::n_cols, "Row::shed_col(): out of bo unds"); arma_debug_check( col_num >= Mat<eT>::n_cols, "Row::shed_col(): out of bo unds");
 End of changes. 1 change blocks. 
0 lines changed or deleted 23 lines changed or added


 Row_proto.hpp   Row_proto.hpp 
skipping to change at line 57 skipping to change at line 57
inline const Row& operator=(const subview_cube<eT>& X); inline const Row& operator=(const subview_cube<eT>& X);
inline mat_injector<Row> operator<<(const eT val); inline mat_injector<Row> operator<<(const eT val);
arma_inline eT& col(const u32 col_num); arma_inline eT& col(const u32 col_num);
arma_inline eT col(const u32 col_num) const; arma_inline eT col(const u32 col_num) const;
arma_inline subview_row<eT> cols(const u32 in_col1, const u32 in_co l2); arma_inline subview_row<eT> cols(const u32 in_col1, const u32 in_co l2);
arma_inline const subview_row<eT> cols(const u32 in_col1, const u32 in_co l2) const; arma_inline const subview_row<eT> cols(const u32 in_col1, const u32 in_co l2) const;
arma_inline subview_row<eT> subvec(const u32 in_col1, const u32 in_
col2);
arma_inline const subview_row<eT> subvec(const u32 in_col1, const u32 in_
col2) const;
inline void shed_col (const u32 col_num); inline void shed_col (const u32 col_num);
inline void shed_cols(const u32 in_col1, const u32 in_col2); inline void shed_cols(const u32 in_col1, const u32 in_col2);
inline void insert_cols(const u32 col_num, const u3 2 N, const bool set_to_zero = true); inline void insert_cols(const u32 col_num, const u3 2 N, const bool set_to_zero = true);
template<typename T1> inline void insert_cols(const u32 col_num, const Ba se<eT,T1>& X); template<typename T1> inline void insert_cols(const u32 col_num, const Ba se<eT,T1>& X);
typedef eT* row_iterator; typedef eT* row_iterator;
typedef const eT* const_row_iterator; typedef const eT* const_row_iterator;
inline row_iterator begin_row(const u32 row_num); inline row_iterator begin_row(const u32 row_num);
 End of changes. 1 change blocks. 
0 lines changed or deleted 5 lines changed or added


 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 1 #define ARMA_VERSION_MAJOR 1
#define ARMA_VERSION_MINOR 0 #define ARMA_VERSION_MINOR 1
#define ARMA_VERSION_PATCH 4 #define ARMA_VERSION_PATCH 0
#define ARMA_VERSION_NAME "Antipodean Antileech" #define ARMA_VERSION_NAME "Climate Vandal"
// http://dictionary.reference.com/browse/leech
//
// 2. a person who clings to another for personal gain,
// esp. without giving anything in return, and usually
// with the implication or effect of exhausting the
// other's resources; parasite.
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. 
10 lines changed or deleted 3 lines changed or added


 armadillo   armadillo 
skipping to change at line 137 skipping to change at line 137
#include "armadillo_bits/Mat_proto.hpp" #include "armadillo_bits/Mat_proto.hpp"
#include "armadillo_bits/Col_proto.hpp" #include "armadillo_bits/Col_proto.hpp"
#include "armadillo_bits/Row_proto.hpp" #include "armadillo_bits/Row_proto.hpp"
#include "armadillo_bits/Cube_proto.hpp" #include "armadillo_bits/Cube_proto.hpp"
#include "armadillo_bits/typedef_fixed.hpp" #include "armadillo_bits/typedef_fixed.hpp"
#include "armadillo_bits/field_proto.hpp" #include "armadillo_bits/field_proto.hpp"
#include "armadillo_bits/subview_proto.hpp" #include "armadillo_bits/subview_proto.hpp"
#include "armadillo_bits/subview_elem1_proto.hpp"
#include "armadillo_bits/subview_field_proto.hpp" #include "armadillo_bits/subview_field_proto.hpp"
#include "armadillo_bits/subview_cube_proto.hpp" #include "armadillo_bits/subview_cube_proto.hpp"
#include "armadillo_bits/diagview_proto.hpp" #include "armadillo_bits/diagview_proto.hpp"
#include "armadillo_bits/diskio_proto.hpp" #include "armadillo_bits/diskio_proto.hpp"
#include "armadillo_bits/wall_clock_proto.hpp" #include "armadillo_bits/wall_clock_proto.hpp"
#include "armadillo_bits/running_stat_proto.hpp" #include "armadillo_bits/running_stat_proto.hpp"
#include "armadillo_bits/running_stat_vec_proto.hpp" #include "armadillo_bits/running_stat_vec_proto.hpp"
#include "armadillo_bits/Op_proto.hpp" #include "armadillo_bits/Op_proto.hpp"
skipping to change at line 196 skipping to change at line 197
#include "armadillo_bits/op_pinv_proto.hpp" #include "armadillo_bits/op_pinv_proto.hpp"
#include "armadillo_bits/op_dotext_proto.hpp" #include "armadillo_bits/op_dotext_proto.hpp"
#include "armadillo_bits/op_flip_proto.hpp" #include "armadillo_bits/op_flip_proto.hpp"
#include "armadillo_bits/op_princomp_proto.hpp" #include "armadillo_bits/op_princomp_proto.hpp"
#include "armadillo_bits/op_princomp_cov_proto.hpp" #include "armadillo_bits/op_princomp_cov_proto.hpp"
#include "armadillo_bits/op_misc_proto.hpp" #include "armadillo_bits/op_misc_proto.hpp"
#include "armadillo_bits/op_relational_proto.hpp" #include "armadillo_bits/op_relational_proto.hpp"
#include "armadillo_bits/op_find_proto.hpp" #include "armadillo_bits/op_find_proto.hpp"
#include "armadillo_bits/op_chol_proto.hpp" #include "armadillo_bits/op_chol_proto.hpp"
#include "armadillo_bits/op_cx_scalar_proto.hpp" #include "armadillo_bits/op_cx_scalar_proto.hpp"
#include "armadillo_bits/op_trimat_proto.hpp"
#include "armadillo_bits/op_cumsum_proto.hpp"
#include "armadillo_bits/glue_times_proto.hpp" #include "armadillo_bits/glue_times_proto.hpp"
#include "armadillo_bits/glue_mixed_proto.hpp" #include "armadillo_bits/glue_mixed_proto.hpp"
#include "armadillo_bits/glue_cov_proto.hpp" #include "armadillo_bits/glue_cov_proto.hpp"
#include "armadillo_bits/glue_cor_proto.hpp" #include "armadillo_bits/glue_cor_proto.hpp"
#include "armadillo_bits/glue_kron_proto.hpp" #include "armadillo_bits/glue_kron_proto.hpp"
#include "armadillo_bits/glue_cross_proto.hpp" #include "armadillo_bits/glue_cross_proto.hpp"
#include "armadillo_bits/glue_join_proto.hpp" #include "armadillo_bits/glue_join_proto.hpp"
#include "armadillo_bits/glue_relational_proto.hpp" #include "armadillo_bits/glue_relational_proto.hpp"
#include "armadillo_bits/glue_solve_proto.hpp" #include "armadillo_bits/glue_solve_proto.hpp"
skipping to change at line 300 skipping to change at line 303
#include "armadillo_bits/fn_inv.hpp" #include "armadillo_bits/fn_inv.hpp"
#include "armadillo_bits/fn_trace.hpp" #include "armadillo_bits/fn_trace.hpp"
#include "armadillo_bits/fn_trans.hpp" #include "armadillo_bits/fn_trans.hpp"
#include "armadillo_bits/fn_det.hpp" #include "armadillo_bits/fn_det.hpp"
#include "armadillo_bits/fn_log_det.hpp" #include "armadillo_bits/fn_log_det.hpp"
#include "armadillo_bits/fn_eig.hpp" #include "armadillo_bits/fn_eig.hpp"
#include "armadillo_bits/fn_lu.hpp" #include "armadillo_bits/fn_lu.hpp"
#include "armadillo_bits/fn_zeros.hpp" #include "armadillo_bits/fn_zeros.hpp"
#include "armadillo_bits/fn_ones.hpp" #include "armadillo_bits/fn_ones.hpp"
#include "armadillo_bits/fn_misc.hpp" #include "armadillo_bits/fn_misc.hpp"
#include "armadillo_bits/fn_elem.hpp"
#include "armadillo_bits/fn_norm.hpp" #include "armadillo_bits/fn_norm.hpp"
#include "armadillo_bits/fn_dot.hpp" #include "armadillo_bits/fn_dot.hpp"
#include "armadillo_bits/fn_randu.hpp" #include "armadillo_bits/fn_randu.hpp"
#include "armadillo_bits/fn_randn.hpp" #include "armadillo_bits/fn_randn.hpp"
#include "armadillo_bits/fn_trig.hpp" #include "armadillo_bits/fn_trig.hpp"
#include "armadillo_bits/fn_mean.hpp" #include "armadillo_bits/fn_mean.hpp"
#include "armadillo_bits/fn_median.hpp" #include "armadillo_bits/fn_median.hpp"
#include "armadillo_bits/fn_stddev.hpp" #include "armadillo_bits/fn_stddev.hpp"
#include "armadillo_bits/fn_var.hpp" #include "armadillo_bits/fn_var.hpp"
#include "armadillo_bits/fn_sort.hpp" #include "armadillo_bits/fn_sort.hpp"
skipping to change at line 336 skipping to change at line 340
#include "armadillo_bits/fn_flip.hpp" #include "armadillo_bits/fn_flip.hpp"
#include "armadillo_bits/fn_as_scalar.hpp" #include "armadillo_bits/fn_as_scalar.hpp"
#include "armadillo_bits/fn_princomp.hpp" #include "armadillo_bits/fn_princomp.hpp"
#include "armadillo_bits/fn_princomp_cov.hpp" #include "armadillo_bits/fn_princomp_cov.hpp"
#include "armadillo_bits/fn_cross.hpp" #include "armadillo_bits/fn_cross.hpp"
#include "armadillo_bits/fn_join.hpp" #include "armadillo_bits/fn_join.hpp"
#include "armadillo_bits/fn_conv.hpp" #include "armadillo_bits/fn_conv.hpp"
#include "armadillo_bits/fn_trunc_exp.hpp" #include "armadillo_bits/fn_trunc_exp.hpp"
#include "armadillo_bits/fn_trunc_log.hpp" #include "armadillo_bits/fn_trunc_log.hpp"
#include "armadillo_bits/fn_toeplitz.hpp" #include "armadillo_bits/fn_toeplitz.hpp"
#include "armadillo_bits/fn_trimat.hpp"
#include "armadillo_bits/fn_cumsum.hpp"
// //
// class meat // class meat
#include "armadillo_bits/gemm.hpp" #include "armadillo_bits/gemm.hpp"
#include "armadillo_bits/gemv.hpp" #include "armadillo_bits/gemv.hpp"
#include "armadillo_bits/gemm_mixed.hpp" #include "armadillo_bits/gemm_mixed.hpp"
#include "armadillo_bits/eop_core_meat.hpp" #include "armadillo_bits/eop_core_meat.hpp"
#include "armadillo_bits/eglue_core_meat.hpp" #include "armadillo_bits/eglue_core_meat.hpp"
skipping to change at line 358 skipping to change at line 364
#include "armadillo_bits/auxlib_meat.hpp" #include "armadillo_bits/auxlib_meat.hpp"
#include "armadillo_bits/injector_meat.hpp" #include "armadillo_bits/injector_meat.hpp"
#include "armadillo_bits/Mat_meat.hpp" #include "armadillo_bits/Mat_meat.hpp"
#include "armadillo_bits/Col_meat.hpp" #include "armadillo_bits/Col_meat.hpp"
#include "armadillo_bits/Row_meat.hpp" #include "armadillo_bits/Row_meat.hpp"
#include "armadillo_bits/Cube_meat.hpp" #include "armadillo_bits/Cube_meat.hpp"
#include "armadillo_bits/field_meat.hpp" #include "armadillo_bits/field_meat.hpp"
#include "armadillo_bits/subview_meat.hpp" #include "armadillo_bits/subview_meat.hpp"
#include "armadillo_bits/subview_elem1_meat.hpp"
#include "armadillo_bits/subview_field_meat.hpp" #include "armadillo_bits/subview_field_meat.hpp"
#include "armadillo_bits/subview_cube_meat.hpp" #include "armadillo_bits/subview_cube_meat.hpp"
#include "armadillo_bits/diagview_meat.hpp" #include "armadillo_bits/diagview_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"
skipping to change at line 397 skipping to change at line 404
#include "armadillo_bits/op_pinv_meat.hpp" #include "armadillo_bits/op_pinv_meat.hpp"
#include "armadillo_bits/op_dotext_meat.hpp" #include "armadillo_bits/op_dotext_meat.hpp"
#include "armadillo_bits/op_flip_meat.hpp" #include "armadillo_bits/op_flip_meat.hpp"
#include "armadillo_bits/op_princomp_meat.hpp" #include "armadillo_bits/op_princomp_meat.hpp"
#include "armadillo_bits/op_princomp_cov_meat.hpp" #include "armadillo_bits/op_princomp_cov_meat.hpp"
#include "armadillo_bits/op_misc_meat.hpp" #include "armadillo_bits/op_misc_meat.hpp"
#include "armadillo_bits/op_relational_meat.hpp" #include "armadillo_bits/op_relational_meat.hpp"
#include "armadillo_bits/op_find_meat.hpp" #include "armadillo_bits/op_find_meat.hpp"
#include "armadillo_bits/op_chol_meat.hpp" #include "armadillo_bits/op_chol_meat.hpp"
#include "armadillo_bits/op_cx_scalar_meat.hpp" #include "armadillo_bits/op_cx_scalar_meat.hpp"
#include "armadillo_bits/op_trimat_meat.hpp"
#include "armadillo_bits/op_cumsum_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"
 End of changes. 6 change blocks. 
0 lines changed or deleted 9 lines changed or added


 auxlib_meat.hpp   auxlib_meat.hpp 
skipping to change at line 413 skipping to change at line 413
{ {
arma_ignore(out); arma_ignore(out);
arma_stop("inv(): need ATLAS or LAPACK"); arma_stop("inv(): need ATLAS or LAPACK");
return false; return false;
} }
#endif #endif
} }
template<typename eT, typename T1> template<typename eT, typename T1>
inline inline
bool
auxlib::inv_tr(Mat<eT>& out, const Base<eT,T1>& X, const u32 layout)
{
arma_extra_debug_sigprint();
out = X.get_ref();
arma_debug_check( (out.is_square() == false), "inv(): given matrix is not
square" );
bool status;
#if defined(ARMA_USE_LAPACK)
{
char uplo = (layout == 0) ? 'U' : 'L';
char diag = 'N';
blas_int n = blas_int(out.n_rows);
blas_int info = 0;
lapack::trtri(&uplo, &diag, &n, out.memptr(), &n, &info);
status = (info == 0);
}
#else
{
arma_ignore(layout);
arma_stop("inv(): need LAPACK");
status = false;
}
#endif
if(status == false)
{
arma_print("inv(): matrix appears to be singular" );
out.reset();
}
else
{
if(layout == 0)
{
// upper triangular
out = trimatu(out);
}
else
{
// lower triangular
out = trimatl(out);
}
}
return status;
}
template<typename eT, typename T1>
inline
eT eT
auxlib::det(const Base<eT,T1>& X) auxlib::det(const Base<eT,T1>& X)
{ {
const unwrap<T1> tmp(X.get_ref()); const unwrap<T1> tmp(X.get_ref());
const Mat<eT>& A = tmp.M; const Mat<eT>& A = tmp.M;
arma_debug_check( !A.is_square(), "det(): matrix is not square" ); arma_debug_check( !A.is_square(), "det(): matrix is not square" );
const bool make_copy = (is_Mat<T1>::value == true) ? true : false; const bool make_copy = (is_Mat<T1>::value == true) ? true : false;
skipping to change at line 1960 skipping to change at line 2014
{ {
arma_ignore(out); arma_ignore(out);
arma_ignore(A); arma_ignore(A);
arma_ignore(B); arma_ignore(B);
arma_stop("auxlib::solve_ud(): need LAPACK"); arma_stop("auxlib::solve_ud(): need LAPACK");
return false; return false;
} }
#endif #endif
} }
//
// solve_tr
template<typename eT>
inline
bool
auxlib::solve_tr(Mat<eT>& out, const Mat<eT>& A, const Mat<eT>& B, const u3
2 layout)
{
arma_extra_debug_sigprint();
if(A.is_empty() || B.is_empty())
{
out.reset();
return false;
}
#if defined(ARMA_USE_LAPACK)
{
out = B;
char uplo = (layout == 0) ? 'U' : 'L';
char trans = 'N';
char diag = 'N';
blas_int n = blas_int(A.n_rows);
blas_int nrhs = blas_int(B.n_cols);
blas_int info = 0;
lapack::trtrs<eT>(&uplo, &trans, &diag, &n, &nrhs, A.memptr(), &n, out.
memptr(), &n, &info);
return (info == 0);
}
#else
{
arma_ignore(out);
arma_ignore(A);
arma_ignore(B);
arma_ignore(layout);
arma_stop("solve(): need LAPACK");
return false;
}
#endif
}
//! @} //! @}
 End of changes. 2 change blocks. 
0 lines changed or deleted 100 lines changed or added


 auxlib_proto.hpp   auxlib_proto.hpp 
skipping to change at line 41 skipping to change at line 41
template<typename eT> template<typename eT>
inline static bool inv_noalias_tinymat(Mat<eT>& out, const Mat<eT>& X, co nst u32 N); inline static bool inv_noalias_tinymat(Mat<eT>& out, const Mat<eT>& X, co nst u32 N);
template<typename eT> template<typename eT>
inline static bool inv_inplace_tinymat(Mat<eT>& out, const u32 N); inline static bool inv_inplace_tinymat(Mat<eT>& out, const u32 N);
template<typename eT> template<typename eT>
inline static bool inv_inplace_lapack(Mat<eT>& out); inline static bool inv_inplace_lapack(Mat<eT>& out);
// //
// inv_tr
template<typename eT, typename T1>
inline static bool inv_tr(Mat<eT>& out, const Base<eT,T1>& X, const u32 l
ayout);
//
// det // det
template<typename eT, typename T1> template<typename eT, typename T1>
inline static eT det(const Base<eT,T1>& X); inline static eT det(const Base<eT,T1>& X);
template<typename eT> template<typename eT>
inline static eT det_tinymat(const Mat<eT>& X, const u32 N); inline static eT det_tinymat(const Mat<eT>& X, const u32 N);
template<typename eT> template<typename eT>
inline static eT det_lapack(const Mat<eT>& X, const bool make_copy); inline static eT det_lapack(const Mat<eT>& X, const bool make_copy);
skipping to change at line 136 skipping to change at line 142
template<typename eT> template<typename eT>
inline static bool solve(Mat<eT>& out, const Mat<eT>& A, const Mat<eT>& B ); inline static bool solve(Mat<eT>& out, const Mat<eT>& A, const Mat<eT>& B );
template<typename eT> template<typename eT>
inline static bool solve_od(Mat<eT>& out, const Mat<eT>& A, const Mat<eT> & B); inline static bool solve_od(Mat<eT>& out, const Mat<eT>& A, const Mat<eT> & B);
template<typename eT> template<typename eT>
inline static bool solve_ud(Mat<eT>& out, const Mat<eT>& A, const Mat<eT> & B); inline static bool solve_ud(Mat<eT>& out, const Mat<eT>& A, const Mat<eT> & B);
//
// solve_tr
template<typename eT>
inline static bool solve_tr(Mat<eT>& out, const Mat<eT>& A, const Mat<eT>
& B, const u32 layout);
}; };
//! @} //! @}
 End of changes. 2 change blocks. 
0 lines changed or deleted 13 lines changed or added


 compiler_setup.hpp   compiler_setup.hpp 
skipping to change at line 73 skipping to change at line 73
#define arma_aligned __attribute__((aligned)) #define arma_aligned __attribute__((aligned))
#define arma_warn_unused __attribute__((warn_unused_result)) #define arma_warn_unused __attribute__((warn_unused_result))
#define arma_deprecated __attribute__((deprecated)) #define arma_deprecated __attribute__((deprecated))
#if (ARMA_GCC_VERSION >= 40200) #if (ARMA_GCC_VERSION >= 40200)
#if defined(_GLIBCXX_USE_C99_MATH_TR1) && defined(_GLIBCXX_USE_C99_COMP LEX_TR1) #if defined(_GLIBCXX_USE_C99_MATH_TR1) && defined(_GLIBCXX_USE_C99_COMP LEX_TR1)
#define ARMA_HAVE_STD_TR1 #define ARMA_HAVE_STD_TR1
#endif #endif
#endif #endif
#if defined(__GXX_EXPERIMENTAL_CXX0X__)
#undef ARMA_HAVE_STD_TR1
#endif
#if (ARMA_GCC_VERSION >= 40300) #if (ARMA_GCC_VERSION >= 40300)
#undef arma_hot #undef arma_hot
#undef arma_cold #undef arma_cold
#define arma_hot __attribute__((hot)) #define arma_hot __attribute__((hot))
#define arma_cold __attribute__((cold)) #define arma_cold __attribute__((cold))
#endif #endif
#undef ARMA_GCC_VERSION #undef ARMA_GCC_VERSION
 End of changes. 1 change blocks. 
4 lines changed or deleted 0 lines changed or added


 debug.hpp   debug.hpp 
skipping to change at line 16 skipping to change at line 16
// 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 debug //! \addtogroup debug
//! @{ //! @{
template<typename T>
inline
std::ostream&
arma_log_stream(std::ostream* user_stream)
{
static std::ostream* log_stream = &(std::cout);
if(user_stream != NULL)
{
log_stream = user_stream;
}
return *log_stream;
}
// TODO: add to user documentation
inline
void
set_log_stream(std::ostream& user_stream)
{
arma_log_stream<char>(&user_stream);
}
// TODO: add to user documentation
inline
std::ostream&
get_log_stream()
{
return arma_log_stream<char>(NULL);
}
// //
// arma_stop // arma_stop
//! print a message to std::cout and/or throw a run-time error exception //! print a message to get_log_stream() and/or throw a run-time error excep tion
template<typename T1> template<typename T1>
inline inline
void void
arma_cold arma_cold
arma_stop(const T1& x) arma_stop(const T1& x)
{ {
std::cerr.flush(); get_log_stream().flush();
std::cout.flush();
std::cout << '\n'; get_log_stream() << '\n';
std::cout << "run-time error: " << x << '\n'; get_log_stream() << "run-time error: " << x << '\n';
std::cout << '\n'; get_log_stream() << '\n';
std::cout.flush(); get_log_stream().flush();
throw std::runtime_error(""); throw std::runtime_error("");
} }
// //
// arma_print // arma_print
inline inline
void void
arma_cold arma_cold
arma_print() arma_print()
{ {
std::cout << std::endl; get_log_stream() << std::endl;
} }
template<typename T1> template<typename T1>
inline inline
void void
arma_cold arma_cold
arma_print(const T1& x) arma_print(const T1& x)
{ {
std::cout << x << std::endl; get_log_stream() << x << std::endl;
} }
template<typename T1, typename T2> template<typename T1, typename T2>
inline inline
void void
arma_cold arma_cold
arma_print(const T1& x, const T2& y) arma_print(const T1& x, const T2& y)
{ {
std::cout << x << y << std::endl; get_log_stream() << x << y << std::endl;
} }
template<typename T1, typename T2, typename T3> template<typename T1, typename T2, typename T3>
inline inline
void void
arma_cold arma_cold
arma_print(const T1& x, const T2& y, const T3& z) arma_print(const T1& x, const T2& y, const T3& z)
{ {
std::cout << x << y << z << std::endl; get_log_stream() << x << y << z << std::endl;
} }
// //
// arma_sigprint // arma_sigprint
//! print a message on cout, with a preceding @ character. //! print a message the the log stream with a preceding @ character.
//! by default the log stream is cout.
//! used for printing the signature of a function //! used for printing the signature of a function
//! (see the arma_extra_debug_sigprint macro) //! (see the arma_extra_debug_sigprint macro)
inline inline
void void
arma_sigprint(const char* x) arma_sigprint(const char* x)
{ {
std::cout << "@ " << x; get_log_stream() << "@ " << x;
} }
// //
// arma_bktprint // arma_bktprint
inline inline
void void
arma_bktprint() arma_bktprint()
{ {
std::cout << std::endl; get_log_stream() << std::endl;
} }
template<typename T1> template<typename T1>
inline inline
void void
arma_bktprint(const T1& x) arma_bktprint(const T1& x)
{ {
std::cout << " [" << x << ']' << std::endl; get_log_stream() << " [" << x << ']' << std::endl;
} }
template<typename T1, typename T2> template<typename T1, typename T2>
inline inline
void void
arma_bktprint(const T1& x, const T2& y) arma_bktprint(const T1& x, const T2& y)
{ {
std::cout << " [" << x << y << ']' << std::endl; get_log_stream() << " [" << x << y << ']' << std::endl;
} }
// //
// arma_thisprint // arma_thisprint
inline inline
void void
arma_thisprint(void* this_ptr) arma_thisprint(void* this_ptr)
{ {
std::cout << " [this = " << this_ptr << ']' << std::endl; get_log_stream() << " [this = " << this_ptr << ']' << std::endl;
} }
// //
// arma_warn // arma_warn
//! if state is true, print a message on cout //! if state is true, print a message on cout
template<typename T1> template<typename T1>
inline inline
void void
arma_hot arma_hot
skipping to change at line 671 skipping to change at line 702
class arma_first_extra_debug_message class arma_first_extra_debug_message
{ {
public: public:
inline inline
arma_cold arma_cold
arma_first_extra_debug_message() arma_first_extra_debug_message()
{ {
const char* nickname = ARMA_VERSION_NAME; const char* nickname = ARMA_VERSION_NAME;
std::cout << "@ ---" << '\n'; get_log_stream() << "@ ---" << '\n';
std::cout << "@ Armadillo " get_log_stream() << "@ Armadillo "
<< arma_version::major << '.' << arma_version::minor << ' .' << arma_version::patch << arma_version::major << '.' << arma_version::minor << ' .' << arma_version::patch
<< " (" << nickname << ")\n"; << " (" << nickname << ")\n";
std::cout << "@ arma_config::atlas = " << arma_config::atlas get_log_stream() << "@ arma_config::atlas = " << arma_config::
<< '\n'; atlas << '\n';
std::cout << "@ arma_config::lapack = " << arma_config::lapack get_log_stream() << "@ arma_config::lapack = " << arma_config::
<< '\n'; lapack << '\n';
std::cout << "@ arma_config::blas = " << arma_config::blas get_log_stream() << "@ arma_config::blas = " << arma_config::
<< '\n'; blas << '\n';
std::cout << "@ arma_config::boost = " << arma_config::boost get_log_stream() << "@ arma_config::boost = " << arma_config::
<< '\n'; boost << '\n';
std::cout << "@ arma_config::boost_date = " << arma_config::boost_d get_log_stream() << "@ arma_config::boost_date = " << arma_config::
ate << '\n'; boost_date << '\n';
std::cout << "@ arma_config::good_comp = " << arma_config::good_co get_log_stream() << "@ arma_config::good_comp = " << arma_config::
mp << '\n'; good_comp << '\n';
std::cout << "@ arma_config::extra_code = " << arma_config::extra_c get_log_stream() << "@ arma_config::extra_code = " << arma_config::
ode << '\n'; extra_code << '\n';
std::cout << "@ sizeof(void*) = " << sizeof(void*) << '\n'; get_log_stream() << "@ sizeof(void*) = " << sizeof(void*) <<
std::cout << "@ sizeof(int) = " << sizeof(int) << '\n'; '\n';
std::cout << "@ sizeof(long) = " << sizeof(long) << '\n'; get_log_stream() << "@ sizeof(int) = " << sizeof(int) <<
std::cout << "@ sizeof(blas_int) = " << sizeof(blas_int) << '\n'; '\n';
std::cout << "@ ---" << std::endl; get_log_stream() << "@ sizeof(long) = " << sizeof(long) <<
'\n';
get_log_stream() << "@ sizeof(blas_int) = " << sizeof(blas_int) <<
'\n';
get_log_stream() << "@ ---" << 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;
} }
#endif #endif
//! @} //! @}
 End of changes. 16 change blocks. 
38 lines changed or deleted 73 lines changed or added


 diskio_meat.hpp   diskio_meat.hpp 
skipping to change at line 298 skipping to change at line 298
return std::string("ARMA_CUB_BIN_FC016"); return std::string("ARMA_CUB_BIN_FC016");
} }
else else
{ {
return std::string(); return std::string();
} }
} }
inline inline
bool
diskio::is_raw_binary(std::istream& f)
{
arma_extra_debug_sigprint();
f.clear();
const std::fstream::pos_type pos1 = f.tellg();
f.clear();
f.seekg(0, ios::end);
f.clear();
const std::fstream::pos_type pos2 = f.tellg();
const u32 N = ( (pos1 >= 0) && (pos2 >= 0) ) ? u32(pos2 - pos1) : 0;
f.clear();
f.seekg(pos1);
podarray<unsigned char> data(N);
unsigned char* ptr = data.memptr();
f.clear();
f.read(reinterpret_cast<char*>(ptr), N);
bool has_non_text_val = false;
if(f.good() == true)
{
for(u32 i=0; i<N; ++i)
{
const unsigned char val = ptr[i];
// the range checking can be made more elaborate
if( (val <= 8) || (val >= 123) )
{
has_non_text_val = true;
break;
}
}
}
f.clear();
f.seekg(pos1);
return has_non_text_val;
}
inline
char char
diskio::conv_to_hex_char(const u8 x) diskio::conv_to_hex_char(const u8 x)
{ {
char out; char out;
switch(x) switch(x)
{ {
case 0: out = '0'; break; case 0: out = '0'; break;
case 1: out = '1'; break; case 1: out = '1'; break;
case 2: out = '2'; break; case 2: out = '2'; break;
skipping to change at line 403 skipping to change at line 453
{ {
out[x_size + extra_size + i] = tmp[i]; out[x_size + extra_size + i] = tmp[i];
} }
return out; return out;
} }
//! Safely rename a file. //! Safely rename a file.
//! Before renaming, test if we can write to the final file. //! Before renaming, test if we can write to the final file.
//! This should prevent: //! This should prevent:
//! (i) overwriting files that have been write protected, //! (i) overwriting files that are write protected,
//! (ii) overwriting directories. //! (ii) overwriting directories.
inline inline
bool bool
diskio::safe_rename(const std::string& old_name, const std::string& new_nam e) diskio::safe_rename(const std::string& old_name, const std::string& new_nam e)
{ {
std::fstream f(new_name.c_str(), std::fstream::out | std::fstream::app); std::fstream f(new_name.c_str(), std::fstream::out | std::fstream::app);
f.put(' '); f.put(' ');
bool save_okay = f.good(); bool save_okay = f.good();
f.close(); f.close();
skipping to change at line 498 skipping to change at line 548
f << x.at(row,col); f << x.at(row,col);
} }
f.put('\n'); f.put('\n');
} }
return f.good(); return f.good();
} }
//! Save a matrix as raw binary (no header)
template<typename eT>
inline
bool
diskio::save_raw_binary(const Mat<eT>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
std::ofstream f(tmp_name.c_str(), std::fstream::binary);
bool save_okay = f.is_open();
if(save_okay == true)
{
save_okay = diskio::save_raw_binary(x, f);
f.flush();
f.close();
if(save_okay == true)
{
save_okay = diskio::safe_rename(tmp_name, final_name);
}
}
return save_okay;
}
template<typename eT>
inline
bool
diskio::save_raw_binary(const Mat<eT>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
f.write(reinterpret_cast<const char*>(x.mem), x.n_elem*sizeof(eT));
return f.good();
}
//! Save a matrix in text format (human readable), //! Save 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::save_arma_ascii(const Mat<eT>& x, const std::string& final_name) diskio::save_arma_ascii(const Mat<eT>& x, const std::string& final_name)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name); const std::string tmp_name = diskio::gen_tmp_name(final_name);
skipping to change at line 827 skipping to change at line 919
} }
if(f.good() == false) if(f.good() == false)
{ {
load_okay = false; load_okay = false;
} }
return load_okay; return load_okay;
} }
//! Load a matrix in binary format (no header);
//! the matrix is assumed to have one column
template<typename eT>
inline
bool
diskio::load_raw_binary(Mat<eT>& x, const std::string& name, std::string& e
rr_msg)
{
arma_extra_debug_sigprint();
std::ifstream f;
f.open(name.c_str(), std::fstream::binary);
bool load_okay = f.is_open();
if(load_okay == true)
{
load_okay = diskio::load_raw_binary(x, f, err_msg);
f.close();
}
return load_okay;
}
template<typename eT>
inline
bool
diskio::load_raw_binary(Mat<eT>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_ignore(err_msg);
f.clear();
const std::streampos pos1 = f.tellg();
f.clear();
f.seekg(0, ios::end);
f.clear();
const std::streampos pos2 = f.tellg();
const u32 N = ( (pos1 >= 0) && (pos2 >= 0) ) ? u32(pos2 - pos1) : 0;
f.clear();
//f.seekg(0, ios::beg);
f.seekg(pos1);
x.set_size(N / sizeof(eT), 1);
f.clear();
f.read( reinterpret_cast<char *>(x.memptr()), N);
return f.good();
}
//! 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, const std::string& name, std::string& e rr_msg) diskio::load_arma_ascii(Mat<eT>& x, const std::string& name, std::string& e rr_msg)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
std::ifstream f(name.c_str()); std::ifstream f(name.c_str());
skipping to change at line 1182 skipping to change at line 1328
{ {
return load_arma_binary(x, f, err_msg); return load_arma_binary(x, f, err_msg);
} }
else else
if(P5 == header.substr(0,P5.length())) if(P5 == header.substr(0,P5.length()))
{ {
return load_pgm_binary(x, f, err_msg); return load_pgm_binary(x, f, err_msg);
} }
else else
{ {
return load_raw_ascii(x, f, err_msg); if(is_raw_binary(f) == true)
{
return load_raw_binary(x, f, err_msg);
}
else
{
return load_raw_ascii(x, f, err_msg);
}
} }
} }
// cubes // cubes
//! Save a cube as raw text (no header, human readable). //! Save a cube as raw text (no header, human readable).
template<typename eT> template<typename eT>
inline inline
bool bool
diskio::save_raw_ascii(const Cube<eT>& x, const std::string& final_name) diskio::save_raw_ascii(const Cube<eT>& x, const std::string& final_name)
skipping to change at line 1260 skipping to change at line 1413
f << x.at(row,col,slice); f << x.at(row,col,slice);
} }
f.put('\n'); f.put('\n');
} }
} }
return f.good(); return f.good();
} }
//! Save a cube as raw binary (no header)
template<typename eT>
inline
bool
diskio::save_raw_binary(const Cube<eT>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
std::ofstream f(tmp_name.c_str(), std::fstream::binary);
bool save_okay = f.is_open();
if(save_okay == true)
{
save_okay = diskio::save_raw_binary(x, f);
f.flush();
f.close();
if(save_okay == true)
{
save_okay = diskio::safe_rename(tmp_name, final_name);
}
}
return save_okay;
}
template<typename eT>
inline
bool
diskio::save_raw_binary(const Cube<eT>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
f.write(reinterpret_cast<const char*>(x.mem), x.n_elem*sizeof(eT));
return f.good();
}
//! Save a cube in text format (human readable), //! Save 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::save_arma_ascii(const Cube<eT>& x, const std::string& final_name) diskio::save_arma_ascii(const Cube<eT>& x, const std::string& final_name)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name); const std::string tmp_name = diskio::gen_tmp_name(final_name);
skipping to change at line 1443 skipping to change at line 1638
// make sure the loaded matrix was not empty // make sure the loaded matrix was not empty
if(x.n_slices > 0) if(x.n_slices > 0)
{ {
x.slice(0) = tmp; x.slice(0) = tmp;
} }
} }
return load_okay; return load_okay;
} }
//! Load a cube in binary format (no header);
//! the cube is assumed to have one slice with one column
template<typename eT>
inline
bool
diskio::load_raw_binary(Cube<eT>& x, const std::string& name, std::string&
err_msg)
{
arma_extra_debug_sigprint();
std::ifstream f;
f.open(name.c_str(), std::fstream::binary);
bool load_okay = f.is_open();
if(load_okay == true)
{
load_okay = diskio::load_raw_binary(x, f, err_msg);
f.close();
}
return load_okay;
}
template<typename eT>
inline
bool
diskio::load_raw_binary(Cube<eT>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_ignore(err_msg);
f.clear();
const std::streampos pos1 = f.tellg();
f.clear();
f.seekg(0, ios::end);
f.clear();
const std::streampos pos2 = f.tellg();
const u32 N = ( (pos1 >= 0) && (pos2 >= 0) ) ? u32(pos2 - pos1) : 0;
f.clear();
//f.seekg(0, ios::beg);
f.seekg(pos1);
x.set_size(N / sizeof(eT), 1, 1);
f.clear();
f.read( reinterpret_cast<char *>(x.memptr()), N);
return f.good();
}
//! 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, const std::string& name, std::string& err_msg) diskio::load_arma_ascii(Cube<eT>& x, const std::string& name, std::string& err_msg)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
std::ifstream f(name.c_str()); std::ifstream f(name.c_str());
skipping to change at line 1635 skipping to change at line 1884
{ {
return load_arma_binary(x, f, err_msg); return load_arma_binary(x, f, err_msg);
} }
else else
if(P6 == header.substr(0, P6.length())) if(P6 == header.substr(0, P6.length()))
{ {
return load_ppm_binary(x, f, err_msg); return load_ppm_binary(x, f, err_msg);
} }
else else
{ {
return load_raw_ascii(x, f, err_msg); if(is_raw_binary(f) == true)
{
return load_raw_binary(x, f, err_msg);
}
else
{
return load_raw_ascii(x, f, err_msg);
}
} }
} }
// fields // fields
template<typename T1> template<typename T1>
inline inline
bool bool
diskio::save_arma_binary(const field<T1>& x, const std::string& final_name) diskio::save_arma_binary(const field<T1>& x, const std::string& final_name)
{ {
 End of changes. 8 change blocks. 
3 lines changed or deleted 261 lines changed or added


 diskio_proto.hpp   diskio_proto.hpp 
skipping to change at line 47 skipping to change at line 47
|| is_complex_double<eT>::value || is_complex_double<eT>::value
); );
}; };
template<typename eT> inline static std::string gen_txt_header(const Mat< eT>& x); template<typename eT> inline static std::string gen_txt_header(const Mat< eT>& x);
template<typename eT> inline static std::string gen_bin_header(const Mat< eT>& x); template<typename eT> inline static std::string gen_bin_header(const Mat< eT>& x);
template<typename eT> inline static std::string gen_txt_header(const Cube <eT>& x); template<typename eT> inline static std::string gen_txt_header(const Cube <eT>& x);
template<typename eT> inline static std::string gen_bin_header(const Cube <eT>& x); template<typename eT> inline static std::string gen_bin_header(const Cube <eT>& x);
inline static bool is_raw_binary(std::istream& f);
inline static char conv_to_hex_char(const u8 x); inline static char conv_to_hex_char(const u8 x);
inline static void conv_to_hex(char* out, const u8 x); inline static void conv_to_hex(char* out, const u8 x);
inline static std::string gen_tmp_name(const std::string& x); inline static std::string gen_tmp_name(const std::string& x);
inline static bool safe_rename(const std::string& old_name, const std::st ring& new_name); inline static bool safe_rename(const std::string& old_name, const std::st ring& new_name);
// //
// matrix saving // matrix saving
template<typename eT> inline static bool save_raw_ascii (const Mat<eT>& x, const std::string& final_name); template<typename eT> inline static bool save_raw_ascii (const Mat<eT>& x, const std::string& final_name);
template<typename eT> inline static bool save_raw_binary (const Mat<eT>& x, const std::string& final_name);
template<typename eT> inline static bool save_arma_ascii (const Mat<eT>& x, const std::string& final_name); template<typename eT> inline static bool save_arma_ascii (const Mat<eT>& x, const std::string& final_name);
template<typename eT> inline static bool save_arma_binary(const Mat<eT>& x, const std::string& final_name); template<typename eT> inline static bool save_arma_binary(const Mat<eT>& x, const std::string& final_name);
template<typename eT> inline static bool save_pgm_binary (const Mat<eT>& x, const std::string& final_name); template<typename eT> inline static bool save_pgm_binary (const Mat<eT>& x, const std::string& final_name);
template<typename T> inline static bool save_pgm_binary (const Mat< std: :complex<T> >& x, const std::string& final_name); template<typename T> inline static bool save_pgm_binary (const Mat< std: :complex<T> >& x, const std::string& final_name);
template<typename eT> inline static bool save_raw_ascii (const Mat<eT>& x, std::ostream& f); template<typename eT> inline static bool save_raw_ascii (const Mat<eT>& x, std::ostream& f);
template<typename eT> inline static bool save_raw_binary (const Mat<eT>& x, std::ostream& f);
template<typename eT> inline static bool save_arma_ascii (const Mat<eT>& x, std::ostream& f); template<typename eT> inline static bool save_arma_ascii (const Mat<eT>& x, std::ostream& f);
template<typename eT> inline static bool save_arma_binary(const Mat<eT>& x, std::ostream& f); template<typename eT> inline static bool save_arma_binary(const Mat<eT>& x, std::ostream& f);
template<typename eT> inline static bool save_pgm_binary (const Mat<eT>& x, std::ostream& f); template<typename eT> inline static bool save_pgm_binary (const Mat<eT>& x, std::ostream& f);
template<typename T> inline static bool save_pgm_binary (const Mat< std: :complex<T> >& x, std::ostream& f); template<typename T> inline static bool save_pgm_binary (const Mat< std: :complex<T> >& x, std::ostream& f);
// //
// matrix loading // matrix loading
template<typename eT> inline static bool load_raw_ascii (Mat<eT>& x, const std::string& name, std::string& err_msg); template<typename eT> inline static bool load_raw_ascii (Mat<eT>& x, const std::string& name, std::string& err_msg);
template<typename eT> inline static bool load_raw_binary (Mat<eT>& x, const std::string& name, std::string& err_msg);
template<typename eT> inline static bool load_arma_ascii (Mat<eT>& x, const std::string& name, std::string& err_msg); template<typename eT> inline static bool load_arma_ascii (Mat<eT>& x, const std::string& name, std::string& err_msg);
template<typename eT> inline static bool load_arma_binary(Mat<eT>& x, const std::string& name, std::string& err_msg); template<typename eT> inline static bool load_arma_binary(Mat<eT>& x, const std::string& name, std::string& err_msg);
template<typename eT> inline static bool load_pgm_binary (Mat<eT>& x, const std::string& name, std::string& err_msg); template<typename eT> inline static bool load_pgm_binary (Mat<eT>& x, const std::string& name, std::string& err_msg);
template<typename T> inline static bool load_pgm_binary (Mat< std::compl ex<T> >& x, const std::string& name, std::string& err_msg); template<typename T> inline static bool load_pgm_binary (Mat< std::compl ex<T> >& x, const std::string& name, std::string& err_msg);
template<typename eT> inline static bool load_auto_detect(Mat<eT>& x, const std::string& name, std::string& err_msg); template<typename eT> inline static bool load_auto_detect(Mat<eT>& x, const std::string& name, std::string& err_msg);
template<typename eT> inline static bool load_raw_ascii (Mat<eT>& x, std::istream& f, std::string& err_msg); template<typename eT> inline static bool load_raw_ascii (Mat<eT>& x, std::istream& f, std::string& err_msg);
template<typename eT> inline static bool load_raw_binary (Mat<eT>& x, std::istream& f, std::string& err_msg);
template<typename eT> inline static bool load_arma_ascii (Mat<eT>& x, std::istream& f, std::string& err_msg); template<typename eT> inline static bool load_arma_ascii (Mat<eT>& x, std::istream& f, std::string& err_msg);
template<typename eT> inline static bool load_arma_binary(Mat<eT>& x, std::istream& f, std::string& err_msg); template<typename eT> inline static bool load_arma_binary(Mat<eT>& x, std::istream& f, std::string& err_msg);
template<typename eT> inline static bool load_pgm_binary (Mat<eT>& x, std::istream& is, std::string& err_msg); template<typename eT> inline static bool load_pgm_binary (Mat<eT>& x, std::istream& is, std::string& err_msg);
template<typename T> inline static bool load_pgm_binary (Mat< std::compl ex<T> >& x, std::istream& is, std::string& err_msg); template<typename T> inline static bool load_pgm_binary (Mat< std::compl ex<T> >& x, std::istream& is, std::string& err_msg);
template<typename eT> inline static bool load_auto_detect(Mat<eT>& x, std::istream& f, std::string& err_msg); template<typename eT> inline static bool load_auto_detect(Mat<eT>& x, std::istream& f, std::string& err_msg);
inline static void pnm_skip_comments(std::istream& f); inline static void pnm_skip_comments(std::istream& f);
// //
// cube saving // cube saving
template<typename eT> inline static bool save_raw_ascii (const Cube<eT>& x, const std::string& name); template<typename eT> inline static bool save_raw_ascii (const Cube<eT>& x, const std::string& name);
template<typename eT> inline static bool save_raw_binary (const Cube<eT>& x, const std::string& name);
template<typename eT> inline static bool save_arma_ascii (const Cube<eT>& x, const std::string& name); template<typename eT> inline static bool save_arma_ascii (const Cube<eT>& x, const std::string& name);
template<typename eT> inline static bool save_arma_binary(const Cube<eT>& x, const std::string& name); template<typename eT> inline static bool save_arma_binary(const Cube<eT>& x, const std::string& name);
template<typename eT> inline static bool save_raw_ascii (const Cube<eT>& x, std::ostream& f); template<typename eT> inline static bool save_raw_ascii (const Cube<eT>& x, std::ostream& f);
template<typename eT> inline static bool save_raw_binary (const Cube<eT>& x, std::ostream& f);
template<typename eT> inline static bool save_arma_ascii (const Cube<eT>& x, std::ostream& f); template<typename eT> inline static bool save_arma_ascii (const Cube<eT>& x, std::ostream& f);
template<typename eT> inline static bool save_arma_binary(const Cube<eT>& x, std::ostream& f); template<typename eT> inline static bool save_arma_binary(const Cube<eT>& x, std::ostream& f);
// //
// cube loading // cube loading
template<typename eT> inline static bool load_raw_ascii (Cube<eT>& x, co nst std::string& name, std::string& err_msg); template<typename eT> inline static bool load_raw_ascii (Cube<eT>& x, co nst std::string& name, std::string& err_msg);
template<typename eT> inline static bool load_raw_binary (Cube<eT>& x, co nst std::string& name, std::string& err_msg);
template<typename eT> inline static bool load_arma_ascii (Cube<eT>& x, co nst std::string& name, std::string& err_msg); template<typename eT> inline static bool load_arma_ascii (Cube<eT>& x, co nst std::string& name, std::string& err_msg);
template<typename eT> inline static bool load_arma_binary(Cube<eT>& x, co nst std::string& name, std::string& err_msg); template<typename eT> inline static bool load_arma_binary(Cube<eT>& x, co nst std::string& name, std::string& err_msg);
template<typename eT> inline static bool load_auto_detect(Cube<eT>& x, co nst std::string& name, std::string& err_msg); template<typename eT> inline static bool load_auto_detect(Cube<eT>& x, co nst std::string& name, std::string& err_msg);
template<typename eT> inline static bool load_raw_ascii (Cube<eT>& x, st d::istream& f, std::string& err_msg); template<typename eT> inline static bool load_raw_ascii (Cube<eT>& x, st d::istream& f, std::string& err_msg);
template<typename eT> inline static bool load_raw_binary (Cube<eT>& x, st d::istream& f, std::string& err_msg);
template<typename eT> inline static bool load_arma_ascii (Cube<eT>& x, st d::istream& f, std::string& err_msg); template<typename eT> inline static bool load_arma_ascii (Cube<eT>& x, st d::istream& f, std::string& err_msg);
template<typename eT> inline static bool load_arma_binary(Cube<eT>& x, st d::istream& f, std::string& err_msg); template<typename eT> inline static bool load_arma_binary(Cube<eT>& x, st d::istream& f, std::string& err_msg);
template<typename eT> inline static bool load_auto_detect(Cube<eT>& x, st d::istream& f, std::string& err_msg); template<typename eT> inline static bool load_auto_detect(Cube<eT>& x, st d::istream& f, std::string& err_msg);
// //
// field saving and loading // field saving and loading
template<typename T1> inline static bool save_arma_binary(const field<T1> & x, const std::string& name); template<typename T1> inline static bool save_arma_binary(const field<T1> & x, const std::string& name);
template<typename T1> inline static bool save_arma_binary(const field<T1> & x, std::ostream& f); template<typename T1> inline static bool save_arma_binary(const field<T1> & x, std::ostream& f);
 End of changes. 9 change blocks. 
0 lines changed or deleted 10 lines changed or added


 field_meat.hpp   field_meat.hpp 
skipping to change at line 185 skipping to change at line 185
//! linear element accessor (treats the field as a vector); no bounds check //! linear element accessor (treats the field as a vector); no bounds check
template<typename oT> template<typename oT>
arma_inline arma_inline
const oT& const oT&
field<oT>::operator[] (const u32 i) const field<oT>::operator[] (const u32 i) const
{ {
return (*mem[i]); return (*mem[i]);
} }
//! linear element accessor (treats the field as a vector); no bounds check
template<typename oT>
arma_inline
oT&
field<oT>::at(const u32 i)
{
return (*mem[i]);
}
//! linear element accessor (treats the field as a vector); no bounds check
template<typename oT>
arma_inline
const oT&
field<oT>::at(const u32 i) const
{
return (*mem[i]);
}
//! linear element accessor (treats the field as a vector); bounds checking not done when ARMA_NO_DEBUG is defined //! linear element accessor (treats the field as a vector); bounds checking not done when ARMA_NO_DEBUG is defined
template<typename oT> template<typename oT>
arma_inline arma_inline
oT& oT&
field<oT>::operator() (const u32 i) field<oT>::operator() (const u32 i)
{ {
arma_debug_check( (i >= n_elem), "field::operator(): index out of bounds" ); arma_debug_check( (i >= n_elem), "field::operator(): index out of bounds" );
return (*mem[i]); return (*mem[i]);
} }
 End of changes. 1 change blocks. 
0 lines changed or deleted 18 lines changed or added


 field_proto.hpp   field_proto.hpp 
skipping to change at line 65 skipping to change at line 65
inline void set_size(const u32 n_obj_in); inline void set_size(const u32 n_obj_in);
inline void set_size(const u32 n_rows_in, const u32 n_cols_in); inline void set_size(const u32 n_rows_in, const u32 n_cols_in);
template<typename oT2> template<typename oT2>
inline void copy_size(const field<oT2>& x); inline void copy_size(const field<oT2>& x);
arma_inline oT& operator[](const u32 i); arma_inline oT& operator[](const u32 i);
arma_inline const oT& operator[](const u32 i) const; arma_inline const oT& operator[](const u32 i) const;
arma_inline oT& at(const u32 i);
arma_inline const oT& at(const u32 i) const;
arma_inline oT& operator()(const u32 i); arma_inline oT& operator()(const u32 i);
arma_inline const oT& operator()(const u32 i) const; arma_inline const oT& operator()(const u32 i) const;
arma_inline oT& at(const u32 row, const u32 col); arma_inline oT& at(const u32 row, const u32 col);
arma_inline const oT& at(const u32 row, const u32 col) const; arma_inline const oT& at(const u32 row, const u32 col) const;
arma_inline oT& operator()(const u32 row, const u32 col); arma_inline oT& operator()(const u32 row, const u32 col);
arma_inline const oT& operator()(const u32 row, const u32 col) const; arma_inline const oT& operator()(const u32 row, const u32 col) const;
inline field_injector<field> operator<<(const oT& val); inline field_injector<field> operator<<(const oT& val);
 End of changes. 1 change blocks. 
0 lines changed or deleted 3 lines changed or added


 fn_dot.hpp   fn_dot.hpp 
skipping to change at line 47 skipping to change at line 47
const Base<typename T1::elem_type,T1>& A, const Base<typename T1::elem_type,T1>& A,
const Base<typename T1::elem_type,T2>& B, const Base<typename T1::elem_type,T2>& B,
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();
return op_norm_dot::apply(A,B); return op_norm_dot::apply(A,B);
} }
//
// cdot
template<typename T1, typename T2>
arma_inline
arma_warn_unused
typename T1::elem_type
cdot
(
const Base<typename T1::elem_type,T1>& A,
const Base<typename T1::elem_type,T2>& B,
const typename arma_cx_only<typename T1::elem_type>::result* junk = 0
)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
return op_cdot::apply(A,B);
}
template<typename T1, typename T2>
arma_inline
arma_warn_unused
typename T1::elem_type
cdot
(
const Base<typename T1::elem_type,T1>& A,
const Base<typename T1::elem_type,T2>& B,
const typename arma_not_cx<typename T1::elem_type>::result* junk = 0
)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
return op_dot::apply(A,B);
}
// convert dot(htrans(x), y) to cdot(x,y)
template<typename T1, typename T2>
arma_inline
arma_warn_unused
typename T1::elem_type
dot
(
const Op<T1, op_htrans>& A,
const Base<typename T1::elem_type,T2>& B,
const typename arma_cx_only<typename T1::elem_type>::result* junk = 0
)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
return cdot(A.m, B);
}
//! @} //! @}
 End of changes. 1 change blocks. 
0 lines changed or deleted 56 lines changed or added


 fn_inv.hpp   fn_inv.hpp 
skipping to change at line 16 skipping to change at line 16
// 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 fn_inv //! \addtogroup fn_inv
//! @{ //! @{
//! delayed matrix inverse //! delayed matrix inverse (general matrices)
template<typename T1> template<typename T1>
arma_inline arma_inline
const Op<T1, op_inv> const Op<T1, op_inv>
inv(const Base<typename T1::elem_type,T1>& X, const typename arma_blas_type inv
_only<typename T1::elem_type>::result* junk = 0) (
const Base<typename T1::elem_type,T1>& X,
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);
return Op<T1, op_inv>(X.get_ref()); return Op<T1, op_inv>(X.get_ref());
} }
//! remove the inverse operation if applied twice consecutively //! remove the inverse operation if applied twice consecutively
template<typename T1> template<typename T1>
arma_inline arma_inline
const T1& const T1&
inv(const Op<T1, op_inv>& X) inv(const Op<T1, op_inv>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return X.m; return X.m;
} }
//! delayed matrix inverse (triangular matrices)
template<typename T1>
arma_inline
const Op<T1, op_inv_tr>
inv
(
const Op<T1, op_trimat>& X,
const typename arma_blas_type_only<typename T1::elem_type>::result* junk
= 0
)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
return Op<T1, op_inv_tr>(X.m, X.aux_u32_a, 0);
}
//! @} //! @}
 End of changes. 4 change blocks. 
4 lines changed or deleted 24 lines changed or added


 fn_max.hpp   fn_max.hpp 
skipping to change at line 148 skipping to change at line 148
eT eT
max(const diagview<eT>& A) max(const diagview<eT>& A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (A.n_elem == 0), "max(): given vector has no elements" ); arma_debug_check( (A.n_elem == 0), "max(): given vector has no elements" );
return op_max::direct_max(A); return op_max::direct_max(A);
} }
template<typename eT, typename T1>
inline
arma_warn_unused
eT
max(const subview_elem1<eT,T1>& A)
{
arma_extra_debug_sigprint();
const Mat<eT> X(A);
arma_debug_check( (X.n_elem == 0), "max(): given matrix has no elements"
);
return op_max::direct_max(X.mem, X.n_elem);
}
//! @} //! @}
 End of changes. 1 change blocks. 
0 lines changed or deleted 16 lines changed or added


 fn_mean.hpp   fn_mean.hpp 
skipping to change at line 141 skipping to change at line 141
eT eT
mean(const diagview<eT>& A) mean(const diagview<eT>& A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (A.n_elem == 0), "mean(): given vector has no elements" ); arma_debug_check( (A.n_elem == 0), "mean(): given vector has no elements" );
return op_mean::direct_mean(A); return op_mean::direct_mean(A);
} }
template<typename eT, typename T1>
inline
arma_warn_unused
eT
mean(const subview_elem1<eT,T1>& A)
{
arma_extra_debug_sigprint();
const Mat<eT> X(A);
arma_debug_check( (X.n_elem == 0), "mean(): given matrix has no elements"
);
return op_mean::direct_mean(X.mem, X.n_elem);
}
//! @} //! @}
 End of changes. 1 change blocks. 
0 lines changed or deleted 16 lines changed or added


 fn_median.hpp   fn_median.hpp 
skipping to change at line 184 skipping to change at line 184
arma_debug_check( (A.n_elem == 0), "median(): given vector has no element s" ); arma_debug_check( (A.n_elem == 0), "median(): given vector has no element s" );
u32 index1; u32 index1;
u32 index2; u32 index2;
op_median::direct_cx_median_index(index1, index2, A); op_median::direct_cx_median_index(index1, index2, A);
return (A[index1] + A[index2]) / T(2); return (A[index1] + A[index2]) / T(2);
} }
template<typename eT, typename T1>
inline
arma_warn_unused
eT
median(const subview_elem1<eT,T1>& A)
{
arma_extra_debug_sigprint();
const Col<eT> X(A);
return median(X);
}
//! @} //! @}
 End of changes. 1 change blocks. 
0 lines changed or deleted 13 lines changed or added


 fn_min.hpp   fn_min.hpp 
skipping to change at line 148 skipping to change at line 148
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_extra_debug_print("min(): two consecutive min() calls detected"); arma_extra_debug_print("min(): two consecutive min() calls detected");
const subview<eT>& X = in.m; const subview<eT>& X = in.m;
arma_debug_check( (X.n_elem == 0), "min(): given matrix has no elements" ); arma_debug_check( (X.n_elem == 0), "min(): given matrix has no elements" );
return op_min::direct_min(X); return op_min::direct_min(X);
} }
template<typename eT, typename T1>
inline
arma_warn_unused
eT
min(const subview_elem1<eT,T1>& A)
{
arma_extra_debug_sigprint();
const Mat<eT> X(A);
arma_debug_check( (X.n_elem == 0), "min(): given matrix has no elements"
);
return op_min::direct_min(X.mem, X.n_elem);
}
//! @} //! @}
 End of changes. 1 change blocks. 
0 lines changed or deleted 16 lines changed or added


 fn_misc.hpp   fn_misc.hpp 
skipping to change at line 82 skipping to change at line 82
} }
inline inline
mat mat
linspace(const double start, const double end, const u32 num) linspace(const double start, const double end, const u32 num)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return linspace<mat>(start, end, num); return linspace<mat>(start, end, num);
} }
template<typename eT, typename T1>
inline
const mtOp<u32, T1, op_find>
find(const Base<eT,T1>& X, const u32 k = 0, const char* direction = "first"
)
{
arma_extra_debug_sigprint();
const char sig = direction[0];
arma_debug_check( (sig != 'f' && sig != 'F' && sig != 'l' && sig != 'L'),
"find(): 3rd input argument must be \"first\" or \"last\"" );
const u32 type = (sig == 'f' || sig == 'F') ? 0 : 1;
return mtOp<u32, T1, op_find>(X.get_ref(), k, type);
}
//
// real
template<typename T1>
arma_inline
const T1&
real(const Base<typename T1::pod_type, T1>& X)
{
arma_extra_debug_sigprint();
return X.get_ref();
}
template<typename T1>
arma_inline
const T1&
real(const BaseCube<typename T1::pod_type, T1>& X)
{
arma_extra_debug_sigprint();
return X.get_ref();
}
template<typename T1>
inline
const mtOp<typename T1::pod_type, T1, op_real>
real(const Base<std::complex<typename T1::pod_type>, T1>& X)
{
arma_extra_debug_sigprint();
return mtOp<typename T1::pod_type, T1, op_real>( X.get_ref() );
}
template<typename T1>
inline
const mtOpCube<typename T1::pod_type, T1, op_real>
real(const BaseCube<std::complex<typename T1::pod_type>, T1>& X)
{
arma_extra_debug_sigprint();
return mtOpCube<typename T1::pod_type, T1, op_real>( X.get_ref() );
}
//
// imag
template<typename T1>
inline
const eOp<Mat<typename T1::pod_type>, eop_zeros>
imag(const Base<typename T1::pod_type,T1>& X)
{
arma_extra_debug_sigprint();
const Proxy<T1> A(X.get_ref());
return eOp<Mat<typename T1::pod_type>, eop_zeros>(A.get_n_rows(), A.get_n
_cols());
}
template<typename T1>
inline
const eOpCube<Cube<typename T1::pod_type>, eop_zeros>
imag(const BaseCube<typename T1::pod_type,T1>& X)
{
arma_extra_debug_sigprint();
const ProxyCube<T1> A(X.get_ref());
return eOpCube<Cube<typename T1::pod_type>, eop_zeros>(A.get_n_rows(), A.
get_n_cols(), A.get_n_slices());
}
template<typename T1>
inline
const mtOp<typename T1::pod_type, T1, op_imag>
imag(const Base<std::complex<typename T1::pod_type>, T1>& X)
{
arma_extra_debug_sigprint();
return mtOp<typename T1::pod_type, T1, op_imag>( X.get_ref() );
}
template<typename T1>
inline
const mtOpCube<typename T1::pod_type, T1, op_imag>
imag(const BaseCube<std::complex<typename T1::pod_type>,T1>& X)
{
arma_extra_debug_sigprint();
return mtOpCube<typename T1::pod_type, T1, op_imag>( X.get_ref() );
}
// //
// log_add // log_add
template<typename eT> template<typename eT>
inline inline
typename arma_float_only<eT>::result typename arma_float_only<eT>::result
log_add(eT log_a, eT log_b) log_add(eT log_a, eT log_b)
{ {
if(log_a < log_b) if(log_a < log_b)
{ {
skipping to change at line 217 skipping to change at line 111
else else
{ {
#if defined(ARMA_HAVE_LOG1P) #if defined(ARMA_HAVE_LOG1P)
return (log_a + log1p(std::exp(negdelta))); return (log_a + log1p(std::exp(negdelta)));
#else #else
return (log_a + std::log(1.0 + std::exp(negdelta))); return (log_a + std::log(1.0 + std::exp(negdelta)));
#endif #endif
} }
} }
//
// log
template<typename T1>
arma_inline
const eOp<T1, eop_log>
log(const Base<typename T1::elem_type,T1>& A)
{
arma_extra_debug_sigprint();
return eOp<T1, eop_log>(A.get_ref());
}
template<typename T1>
arma_inline
const eOpCube<T1, eop_log>
log(const BaseCube<typename T1::elem_type,T1>& A)
{
arma_extra_debug_sigprint();
return eOpCube<T1, eop_log>(A.get_ref());
}
//
// log2
template<typename T1>
arma_inline
const eOp<T1, eop_log2>
log2(const Base<typename T1::elem_type,T1>& A)
{
arma_extra_debug_sigprint();
return eOp<T1, eop_log2>(A.get_ref());
}
template<typename T1>
arma_inline
const eOpCube<T1, eop_log2>
log2(const BaseCube<typename T1::elem_type,T1>& A)
{
arma_extra_debug_sigprint();
return eOpCube<T1, eop_log2>(A.get_ref());
}
//
// log10
template<typename T1>
arma_inline
const eOp<T1, eop_log10>
log10(const Base<typename T1::elem_type,T1>& A)
{
arma_extra_debug_sigprint();
return eOp<T1, eop_log10>(A.get_ref());
}
template<typename T1>
arma_inline
const eOpCube<T1, eop_log10>
log10(const BaseCube<typename T1::elem_type,T1>& A)
{
arma_extra_debug_sigprint();
return eOpCube<T1, eop_log10>(A.get_ref());
}
//
// exp
template<typename T1>
arma_inline
const eOp<T1, eop_exp>
exp(const Base<typename T1::elem_type,T1>& A)
{
arma_extra_debug_sigprint();
return eOp<T1, eop_exp>(A.get_ref());
}
template<typename T1>
arma_inline
const eOpCube<T1, eop_exp>
exp(const BaseCube<typename T1::elem_type,T1>& A)
{
arma_extra_debug_sigprint();
return eOpCube<T1, eop_exp>(A.get_ref());
}
// exp2
template<typename T1>
arma_inline
const eOp<T1, eop_exp2>
exp2(const Base<typename T1::elem_type,T1>& A)
{
arma_extra_debug_sigprint();
return eOp<T1, eop_exp2>(A.get_ref());
}
template<typename T1>
arma_inline
const eOpCube<T1, eop_exp2>
exp2(const BaseCube<typename T1::elem_type,T1>& A)
{
arma_extra_debug_sigprint();
return eOpCube<T1, eop_exp2>(A.get_ref());
}
// exp10
template<typename T1>
arma_inline
const eOp<T1, eop_exp10>
exp10(const Base<typename T1::elem_type,T1>& A)
{
arma_extra_debug_sigprint();
return eOp<T1, eop_exp10>(A.get_ref());
}
template<typename T1>
arma_inline
const eOpCube<T1, eop_exp10>
exp10(const BaseCube<typename T1::elem_type,T1>& A)
{
arma_extra_debug_sigprint();
return eOpCube<T1, eop_exp10>(A.get_ref());
}
//
// abs
template<typename T1>
arma_inline
const eOp<T1, eop_abs>
abs(const Base<typename T1::elem_type,T1>& X, const typename arma_not_cx<ty
pename T1::elem_type>::result* junk = 0)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
return eOp<T1, eop_abs>(X.get_ref());
}
template<typename T1>
arma_inline
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)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
return eOpCube<T1, eop_abs>(X.get_ref());
}
template<typename T1>
inline
const mtOp<typename T1::pod_type, T1, op_abs>
abs(const Base<std::complex<typename T1::pod_type>, T1>& X, const typename
arma_cx_only<typename T1::elem_type>::result* junk = 0)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
return mtOp<typename T1::pod_type, T1, op_abs>( X.get_ref() );
}
template<typename T1>
inline
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)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
return mtOpCube<typename T1::pod_type, T1, op_abs>( X.get_ref() );
}
//
// fabs
template<typename T1>
arma_inline
const eOp<T1, eop_abs>
fabs(const Base<typename T1::pod_type,T1>& X, const typename arma_not_cx<ty
pename T1::elem_type>::result* junk = 0)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
return eOp<T1, eop_abs>(X.get_ref());
}
template<typename T1>
arma_inline
const eOpCube<T1, eop_abs>
fabs(const BaseCube<typename T1::pod_type,T1>& X, const typename arma_not_c
x<typename T1::elem_type>::result* junk = 0)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
return eOpCube<T1, eop_abs>(X.get_ref());
}
template<typename T1>
inline
const mtOp<typename T1::pod_type, T1, op_abs>
fabs(const Base<std::complex<typename T1::pod_type>, T1>& X, const typename
arma_cx_only<typename T1::elem_type>::result* junk = 0)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
return mtOp<typename T1::pod_type, T1, op_abs>( X.get_ref() );
}
template<typename T1>
arma_inline
const mtOpCube<typename T1::pod_type, T1, op_abs>
fabs(const BaseCube< std::complex<typename T1::pod_type>,T1>& X, const type
name arma_cx_only<typename T1::elem_type>::result* junk = 0)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
return abs(X);
}
//
// square
template<typename T1>
arma_inline
const eOp<T1, eop_square>
square(const Base<typename T1::elem_type,T1>& A)
{
arma_extra_debug_sigprint();
return eOp<T1, eop_square>(A.get_ref());
}
template<typename T1>
arma_inline
const eOpCube<T1, eop_square>
square(const BaseCube<typename T1::elem_type,T1>& A)
{
arma_extra_debug_sigprint();
return eOpCube<T1, eop_square>(A.get_ref());
}
//
// sqrt
template<typename T1>
arma_inline
const eOp<T1, eop_sqrt>
sqrt(const Base<typename T1::elem_type,T1>& A)
{
arma_extra_debug_sigprint();
return eOp<T1, eop_sqrt>(A.get_ref());
}
template<typename T1>
arma_inline
const eOpCube<T1, eop_sqrt>
sqrt(const BaseCube<typename T1::elem_type,T1>& A)
{
arma_extra_debug_sigprint();
return eOpCube<T1, eop_sqrt>(A.get_ref());
}
//
// conj
template<typename T1>
arma_inline
const T1&
conj(const Base<typename T1::pod_type,T1>& A)
{
arma_extra_debug_sigprint();
return A.get_ref();
}
template<typename T1>
arma_inline
const T1&
conj(const BaseCube<typename T1::pod_type,T1>& A)
{
arma_extra_debug_sigprint();
return A.get_ref();
}
template<typename T1>
arma_inline
const eOp<T1, eop_conj>
conj(const Base<std::complex<typename T1::pod_type>,T1>& A)
{
arma_extra_debug_sigprint();
return eOp<T1, eop_conj>(A.get_ref());
}
template<typename T1>
arma_inline
const eOpCube<T1, eop_conj>
conj(const BaseCube<std::complex<typename T1::pod_type>,T1>& A)
{
arma_extra_debug_sigprint();
return eOpCube<T1, eop_conj>(A.get_ref());
}
template<typename T1>
arma_inline
const T1&
conj(const eOp<T1, eop_conj>& A)
{
arma_extra_debug_sigprint();
return A.m;
}
template<typename T1>
arma_inline
const T1&
conj(const eOpCube<T1, eop_conj>& A)
{
arma_extra_debug_sigprint();
return A.m;
}
// TODO: this needs a more elaborate template restriction mechanism to work
properly,
// i.e. an overloaded version of thus function should do nothing if t
he input type is non-complex
//
// //! the conjugate of the transpose of a complex matrix is the same as th
e hermitian transpose
// template<typename T1>
// arma_inline
// const Op<T1, op_htrans>
// conj(const Op<T1, op_trans>& A)
// {
// arma_extra_debug_sigprint();
//
// return Op<T1, op_htrans>(A.m);
// }
// pow
template<typename T1>
arma_inline
const eOp<T1, eop_pow>
pow(const Base<typename T1::elem_type,T1>& A, const typename T1::elem_type
exponent)
{
arma_extra_debug_sigprint();
return eOp<T1, eop_pow>(A.get_ref(), exponent);
}
template<typename T1>
arma_inline
const eOpCube<T1, eop_pow>
pow(const BaseCube<typename T1::elem_type,T1>& A, const typename T1::elem_t
ype exponent)
{
arma_extra_debug_sigprint();
return eOpCube<T1, eop_pow>(A.get_ref(), exponent);
}
// pow, specialised handling (non-complex exponent for complex matrices)
template<typename T1>
arma_inline
const eOp<T1, eop_pow>
pow(const Base<typename T1::elem_type,T1>& A, const typename T1::elem_type:
:value_type exponent)
{
arma_extra_debug_sigprint();
typedef typename T1::elem_type eT;
return eOp<T1, eop_pow>(A.get_ref(), eT(exponent));
}
template<typename T1>
arma_inline
const eOpCube<T1, eop_pow>
pow(const BaseCube<typename T1::elem_type,T1>& A, const typename T1::elem_t
ype::value_type exponent)
{
arma_extra_debug_sigprint();
typedef typename T1::elem_type eT;
return eOpCube<T1, eop_pow>(A.get_ref(), eT(exponent));
}
//! @} //! @}
 End of changes. 2 change blocks. 
534 lines changed or deleted 0 lines changed or added


 fn_prod.hpp   fn_prod.hpp 
skipping to change at line 195 skipping to change at line 195
eT val = X[0]; eT val = X[0];
for(u32 i=1; i<n_elem; ++i) for(u32 i=1; i<n_elem; ++i)
{ {
val *= X[i]; val *= X[i];
} }
return val; return val;
} }
template<typename eT, typename T1>
inline
arma_warn_unused
eT
prod(const subview_elem1<eT,T1>& A)
{
arma_extra_debug_sigprint();
const Col<eT> X(A);
return prod(X);
}
//! @} //! @}
 End of changes. 1 change blocks. 
0 lines changed or deleted 13 lines changed or added


 fn_solve.hpp   fn_solve.hpp 
skipping to change at line 35 skipping to change at line 35
inline inline
const Glue<T1, T2, glue_solve> const Glue<T1, T2, glue_solve>
solve solve
( (
const Base<typename T1::elem_type,T1>& A, const Base<typename T1::elem_type,T1>& A,
const Base<typename T1::elem_type,T2>& B, const Base<typename T1::elem_type,T2>& B,
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);
return Glue<T1, T2, glue_solve>(A.get_ref(), B.get_ref()); return Glue<T1, T2, glue_solve>(A.get_ref(), B.get_ref());
} }
template<typename T1, typename T2> template<typename T1, typename T2>
inline inline
const Glue<T1, T2, glue_solve_tr>
solve
(
const Op<T1, op_trimat>& A,
const Base<typename T1::elem_type,T2>& B,
const typename arma_blas_type_only<typename T1::elem_type>::result* junk
= 0
)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
return Glue<T1, T2, glue_solve_tr>(A.m, B.get_ref(), A.aux_u32_a);
}
template<typename T1, typename T2>
inline
bool bool
solve solve
( (
Mat<typename T1::elem_type>& out, Mat<typename T1::elem_type>& out,
const Base<typename T1::elem_type,T1>& A, const Base<typename T1::elem_type,T1>& A,
const Base<typename T1::elem_type,T2>& B, const Base<typename T1::elem_type,T2>& B,
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);
out = solve(A,B); out = solve( A.get_ref(), B.get_ref() );
return (out.n_elem == 0) ? false : true; return (out.n_elem == 0) ? false : true;
} }
//! @} //! @}
 End of changes. 4 change blocks. 
3 lines changed or deleted 18 lines changed or added


 fn_stddev.hpp   fn_stddev.hpp 
skipping to change at line 106 skipping to change at line 106
typename get_pod_type<eT>::result typename get_pod_type<eT>::result
stddev(const diagview<eT>& A, const u32 norm_type = 0) stddev(const diagview<eT>& A, const u32 norm_type = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (A.n_elem == 0), "stddev(): given vector has no element s" ); arma_debug_check( (A.n_elem == 0), "stddev(): given vector has no element s" );
return std::sqrt( op_var::direct_var(A, norm_type) ); return std::sqrt( op_var::direct_var(A, norm_type) );
} }
template<typename eT, typename T1>
inline
arma_warn_unused
typename get_pod_type<eT>::result
stddev(const subview_elem1<eT,T1>& A, const u32 norm_type = 0)
{
arma_extra_debug_sigprint();
const Col<eT> X(A);
return stddev(X, norm_type);
}
//! @} //! @}
 End of changes. 1 change blocks. 
0 lines changed or deleted 13 lines changed or added


 fn_sum.hpp   fn_sum.hpp 
skipping to change at line 37 skipping to change at line 37
sum(const Base<typename T1::elem_type,T1>& X, const u32 dim = 0) sum(const Base<typename T1::elem_type,T1>& X, const u32 dim = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return Op<T1, op_sum>(X.get_ref(), dim, 0); return Op<T1, op_sum>(X.get_ref(), dim, 0);
} }
//! \brief //! \brief
//! Immediate 'sum all values' operation for a row vector //! Immediate 'sum all values' operation for a row vector
template<typename eT> template<typename eT>
arma_inline inline
arma_warn_unused arma_warn_unused
eT eT
sum(const Row<eT>& X) sum(const Row<eT>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return accu(X); return accu(X);
} }
//! \brief //! \brief
//! Immediate 'sum all values' operation for a column vector //! Immediate 'sum all values' operation for a column vector
template<typename eT> template<typename eT>
arma_inline inline
arma_warn_unused arma_warn_unused
eT eT
sum(const Col<eT>& X) sum(const Col<eT>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return accu(X); return accu(X);
} }
//! \brief //! \brief
//! Immediate 'sum all values' operation, //! Immediate 'sum all values' operation,
//! invoked, for example, by: sum(sum(A)) //! invoked, for example, by: sum(sum(A))
template<typename T1> template<typename T1>
arma_inline inline
arma_warn_unused arma_warn_unused
typename T1::elem_type typename T1::elem_type
sum(const Op<T1, op_sum>& in) sum(const Op<T1, op_sum>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_extra_debug_print("sum(): two consecutive sum() calls detected"); arma_extra_debug_print("sum(): two consecutive sum() calls detected");
return accu(in.m); return accu(in.m);
} }
skipping to change at line 88 skipping to change at line 88
const Op<Op<T1, op_sum>, op_sum> const Op<Op<T1, op_sum>, op_sum>
sum(const Op<T1, op_sum>& in, const u32 dim) sum(const Op<T1, op_sum>& in, const u32 dim)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return Op<Op<T1, op_sum>, op_sum>(in, dim, 0); return Op<Op<T1, op_sum>, op_sum>(in, dim, 0);
} }
//! sum all values of a subview_row //! sum all values of a subview_row
template<typename eT> template<typename eT>
arma_inline inline
arma_warn_unused arma_warn_unused
eT eT
sum(const subview_row<eT>& X) sum(const subview_row<eT>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return accu(X); return accu(X);
} }
//! sum all values of a subview_col //! sum all values of a subview_col
template<typename eT> template<typename eT>
arma_inline inline
arma_warn_unused arma_warn_unused
eT eT
sum(const subview_col<eT>& X) sum(const subview_col<eT>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return accu(X); return accu(X);
} }
//! sum all values of a diagview //! sum all values of a diagview
template<typename eT> template<typename eT>
arma_inline inline
arma_warn_unused arma_warn_unused
eT eT
sum(const diagview<eT>& X) sum(const diagview<eT>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return accu(X); return accu(X);
} }
template<typename eT, typename T1>
inline
arma_warn_unused
eT
sum(const subview_elem1<eT,T1>& A)
{
arma_extra_debug_sigprint();
return accu(A);
}
//! @} //! @}
 End of changes. 7 change blocks. 
6 lines changed or deleted 17 lines changed or added


 fn_var.hpp   fn_var.hpp 
skipping to change at line 103 skipping to change at line 103
typename get_pod_type<eT>::result typename get_pod_type<eT>::result
var(const diagview<eT>& A, const u32 norm_type = 0) var(const diagview<eT>& A, const u32 norm_type = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (A.n_elem == 0), "var(): given vector has no elements" ); arma_debug_check( (A.n_elem == 0), "var(): given vector has no elements" );
return op_var::direct_var(A, norm_type); return op_var::direct_var(A, norm_type);
} }
template<typename eT, typename T1>
inline
arma_warn_unused
typename get_pod_type<eT>::result
var(const subview_elem1<eT,T1>& A, const u32 norm_type = 0)
{
arma_extra_debug_sigprint();
const Col<eT> X(A);
return var(X, norm_type);
}
//! @} //! @}
 End of changes. 1 change blocks. 
0 lines changed or deleted 13 lines changed or added


 forward_proto.hpp   forward_proto.hpp 
skipping to change at line 32 skipping to change at line 32
template<typename oT> class field; template<typename oT> class field;
template<typename eT> class subview; template<typename eT> class subview;
template<typename eT> class subview_col; template<typename eT> class subview_col;
template<typename eT> class subview_row; template<typename eT> class subview_row;
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 diagview; template<typename eT> class diagview;
template<typename eT, typename T1> class subview_elem1;
template<typename eT, typename T1, typename T2> class subview_elem2;
class diskio; class diskio;
class op_min; class op_min;
class op_max; class op_max;
class op_trans; class op_trans;
class op_htrans; class op_htrans;
class op_inv; class op_inv;
class op_sum; class op_sum;
class op_diagmat; class op_diagmat;
skipping to change at line 108 skipping to change at line 111
//! \addtogroup diskio //! \addtogroup diskio
//! @{ //! @{
//! file types supported by Armadillo //! file types supported by Armadillo
enum file_type enum file_type
{ {
auto_detect, //!< Automatically detect the file type (file must be one o f the following types) auto_detect, //!< Automatically detect the file type (file must be one o f the following types)
raw_ascii, //!< ASCII format (text), without any other information. raw_ascii, //!< ASCII format (text), without any other information.
arma_ascii, //!< Armadillo ASCII format (text), with information about matrix type and size arma_ascii, //!< Armadillo ASCII format (text), with information about matrix type and size
arma_binary, //!< Armadillo binary format raw_binary, //!< raw binary format, without any other information.
arma_binary, //!< Armadillo binary format, with information about matrix
type and size
pgm_binary, //!< Portable Grey Map (greyscale image) pgm_binary, //!< Portable Grey Map (greyscale image)
ppm_binary //!< Portable Pixel Map (colour image), used by the field a nd cube classes ppm_binary //!< Portable Pixel Map (colour image), used by the field a nd cube classes
}; };
//! @} //! @}
 End of changes. 2 change blocks. 
1 lines changed or deleted 6 lines changed or added


 glue_solve_meat.hpp   glue_solve_meat.hpp 
skipping to change at line 31 skipping to change at line 31
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
const unwrap_check<T1> A_tmp(X.A, out); const unwrap_check<T1> A_tmp(X.A, out);
const unwrap_check<T2> B_tmp(X.B, out); const unwrap_check<T2> B_tmp(X.B, out);
const Mat<eT>& A = A_tmp.M; const Mat<eT>& A = A_tmp.M;
const Mat<eT>& B = B_tmp.M; const Mat<eT>& B = B_tmp.M;
arma_debug_check( ( (&A) == (&B) ), "solve(): A is an alias of B" ); arma_debug_check( ( (&A) == (&B) ), "solve(): A is an alias of B" ) ;
arma_debug_check( (A.n_rows != B.n_rows), "solve(): number of rows in A a nd B must be the same" ); arma_debug_check( (A.n_rows != B.n_rows), "solve(): number of rows in A a nd B must be the same" );
bool status; bool status;
if(A.n_rows == A.n_cols) if(A.n_rows == A.n_cols)
{ {
status = auxlib::solve(out, A, B); status = auxlib::solve(out, A, B);
} }
else else
if(A.n_rows > A.n_cols) if(A.n_rows > A.n_cols)
skipping to change at line 59 skipping to change at line 59
status = auxlib::solve_ud(out, A, B); status = auxlib::solve_ud(out, A, B);
} }
if(status == false) if(status == false)
{ {
out.reset(); out.reset();
arma_print("solve(): solution not found"); arma_print("solve(): solution not found");
} }
} }
template<typename T1, typename T2>
inline
void
glue_solve_tr::apply(Mat<typename T1::elem_type>& out, const Glue<T1,T2,glu
e_solve_tr>& X)
{
arma_extra_debug_sigprint();
typedef typename T1::elem_type eT;
const unwrap_check<T1> A_tmp(X.A, out);
const unwrap_check<T2> B_tmp(X.B, out);
const Mat<eT>& A = A_tmp.M;
const Mat<eT>& B = B_tmp.M;
arma_debug_check( ( (&A) == (&B) ), "solve(): A is an alias of B"
);
arma_debug_check( (A.n_rows != B.n_rows), "solve(): number of rows in A
and B must be the same" );
arma_debug_check( (A.is_square() == false), "solve(): A is not a square m
atrix" );
const bool status = auxlib::solve_tr(out, A, B, X.aux_u32);
if(status == false)
{
out.reset();
arma_print("solve(): solution not found");
}
}
//! @} //! @}
 End of changes. 2 change blocks. 
1 lines changed or deleted 33 lines changed or added


 glue_solve_proto.hpp   glue_solve_proto.hpp 
skipping to change at line 23 skipping to change at line 23
//! \addtogroup glue_solve //! \addtogroup glue_solve
//! @{ //! @{
class glue_solve class glue_solve
{ {
public: public:
template<typename T1, typename T2> inline static void apply(Mat<typename T1::elem_type>& out, const Glue<T1,T2,glue_solve>& X); template<typename T1, typename T2> inline static void apply(Mat<typename T1::elem_type>& out, const Glue<T1,T2,glue_solve>& X);
}; };
class glue_solve_tr
{
public:
template<typename T1, typename T2> inline static void apply(Mat<typename
T1::elem_type>& out, const Glue<T1,T2,glue_solve_tr>& X);
};
//! @} //! @}
 End of changes. 1 change blocks. 
0 lines changed or deleted 8 lines changed or added


 lapack_proto.hpp   lapack_proto.hpp 
skipping to change at line 30 skipping to change at line 30
//! @{ //! @{
extern "C" extern "C"
{ {
// LU factorisation // LU factorisation
void arma_fortran(sgetrf)(blas_int* m, blas_int* n, float* a, blas_int * lda, blas_int* ipiv, blas_int* info); void arma_fortran(sgetrf)(blas_int* m, blas_int* n, float* a, blas_int * lda, blas_int* ipiv, blas_int* info);
void arma_fortran(dgetrf)(blas_int* m, blas_int* n, double* a, blas_int * lda, blas_int* ipiv, blas_int* info); void arma_fortran(dgetrf)(blas_int* m, blas_int* n, double* a, blas_int * lda, blas_int* ipiv, blas_int* info);
void arma_fortran(cgetrf)(blas_int* m, blas_int* n, void* a, blas_int * lda, blas_int* ipiv, blas_int* info); void arma_fortran(cgetrf)(blas_int* m, blas_int* n, void* a, blas_int * lda, blas_int* ipiv, blas_int* info);
void arma_fortran(zgetrf)(blas_int* m, blas_int* n, void* a, blas_int * lda, blas_int* ipiv, blas_int* info); void arma_fortran(zgetrf)(blas_int* m, blas_int* n, void* a, blas_int * lda, blas_int* ipiv, blas_int* info);
// matrix inversion // matrix inversion (using LU factorisation result)
void arma_fortran(sgetri)(blas_int* n, float* a, blas_int* lda, blas_i nt* ipiv, float* work, blas_int* lwork, blas_int* info); void arma_fortran(sgetri)(blas_int* n, float* a, blas_int* lda, blas_i nt* ipiv, float* work, blas_int* lwork, blas_int* info);
void arma_fortran(dgetri)(blas_int* n, double* a, blas_int* lda, blas_i nt* ipiv, double* work, blas_int* lwork, blas_int* info); void arma_fortran(dgetri)(blas_int* n, double* a, blas_int* lda, blas_i nt* ipiv, double* work, blas_int* lwork, blas_int* info);
void arma_fortran(cgetri)(blas_int* n, void* a, blas_int* lda, blas_i nt* ipiv, void* work, blas_int* lwork, blas_int* info); void arma_fortran(cgetri)(blas_int* n, void* a, blas_int* lda, blas_i nt* ipiv, void* work, blas_int* lwork, blas_int* info);
void arma_fortran(zgetri)(blas_int* n, void* a, blas_int* lda, blas_i nt* ipiv, void* work, blas_int* lwork, blas_int* info); void arma_fortran(zgetri)(blas_int* n, void* a, blas_int* lda, blas_i nt* ipiv, void* work, blas_int* lwork, blas_int* info);
// matrix inversion (triangular matrices)
void arma_fortran(strtri)(char* uplo, char* diag, blas_int* n, float*
a, blas_int* lda, blas_int* info);
void arma_fortran(dtrtri)(char* uplo, char* diag, blas_int* n, double*
a, blas_int* lda, blas_int* info);
void arma_fortran(ctrtri)(char* uplo, char* diag, blas_int* n, void*
a, blas_int* lda, blas_int* info);
void arma_fortran(ztrtri)(char* uplo, char* diag, blas_int* n, void*
a, blas_int* lda, blas_int* info);
// eigenvector decomposition of symmetric real matrices // eigenvector decomposition of symmetric real matrices
void arma_fortran(ssyev)(char* jobz, char* uplo, blas_int* n, float* a , blas_int* lda, float* w, float* work, blas_int* lwork, blas_int* info); void arma_fortran(ssyev)(char* jobz, char* uplo, blas_int* n, float* a , blas_int* lda, float* w, float* work, blas_int* lwork, blas_int* info);
void arma_fortran(dsyev)(char* jobz, char* uplo, blas_int* n, double* a , blas_int* lda, double* w, double* work, blas_int* lwork, blas_int* info); void arma_fortran(dsyev)(char* jobz, char* uplo, blas_int* n, double* a , blas_int* lda, double* w, double* work, blas_int* lwork, blas_int* info);
// eigenvector decomposition of hermitian matrices (complex) // eigenvector decomposition of hermitian matrices (complex)
void arma_fortran(cheev)(char* jobz, char* uplo, blas_int* n, void* a , blas_int* lda, float* w, void* work, blas_int* lwork, float* rwork, b las_int* info); void arma_fortran(cheev)(char* jobz, char* uplo, blas_int* n, void* a , blas_int* lda, float* w, void* work, blas_int* lwork, float* rwork, b las_int* info);
void arma_fortran(zheev)(char* jobz, char* uplo, blas_int* n, void* a , blas_int* lda, double* w, void* work, blas_int* lwork, double* rwork, b las_int* info); void arma_fortran(zheev)(char* jobz, char* uplo, blas_int* n, void* a , blas_int* lda, double* w, void* work, blas_int* lwork, double* rwork, b las_int* info);
// eigenvector decomposition of general real matrices // eigenvector decomposition of general real matrices
void arma_fortran(sgeev)(char* jobvl, char* jobvr, blas_int* n, float* a, blas_int* lda, float* wr, float* wi, float* vl, blas_int* ldvl, flo at* vr, blas_int* ldvr, float* work, blas_int* lwork, blas_int* info); void arma_fortran(sgeev)(char* jobvl, char* jobvr, blas_int* n, float* a, blas_int* lda, float* wr, float* wi, float* vl, blas_int* ldvl, flo at* vr, blas_int* ldvr, float* work, blas_int* lwork, blas_int* info);
skipping to change at line 92 skipping to change at line 98
void arma_fortran(dgesv)(blas_int* n, blas_int* nrhs, double* a, blas_i nt* lda, blas_int* ipiv, double* b, blas_int* ldb, blas_int* info); void arma_fortran(dgesv)(blas_int* n, blas_int* nrhs, double* a, blas_i nt* lda, blas_int* ipiv, double* b, blas_int* ldb, blas_int* info);
void arma_fortran(cgesv)(blas_int* n, blas_int* nrhs, void* a, blas_i nt* lda, blas_int* ipiv, void* b, blas_int* ldb, blas_int* info); void arma_fortran(cgesv)(blas_int* n, blas_int* nrhs, void* a, blas_i nt* lda, blas_int* ipiv, void* b, blas_int* ldb, blas_int* info);
void arma_fortran(zgesv)(blas_int* n, blas_int* nrhs, void* a, blas_i nt* lda, blas_int* ipiv, void* b, blas_int* ldb, blas_int* info); void arma_fortran(zgesv)(blas_int* n, blas_int* nrhs, void* a, blas_i nt* lda, blas_int* ipiv, void* b, blas_int* ldb, blas_int* info);
// solve over/underdetermined system of linear equations // solve over/underdetermined system of linear equations
void arma_fortran(sgels)(char* trans, blas_int* m, blas_int* n, blas_in t* nrhs, float* a, blas_int* lda, float* b, blas_int* ldb, float* work, blas_int* lwork, blas_int* info); void arma_fortran(sgels)(char* trans, blas_int* m, blas_int* n, blas_in t* nrhs, float* a, blas_int* lda, float* b, blas_int* ldb, float* work, blas_int* lwork, blas_int* info);
void arma_fortran(dgels)(char* trans, blas_int* m, blas_int* n, blas_in t* nrhs, double* a, blas_int* lda, double* b, blas_int* ldb, double* work, blas_int* lwork, blas_int* info); void arma_fortran(dgels)(char* trans, blas_int* m, blas_int* n, blas_in t* nrhs, double* a, blas_int* lda, double* b, blas_int* ldb, double* work, blas_int* lwork, blas_int* info);
void arma_fortran(cgels)(char* trans, blas_int* m, blas_int* n, blas_in t* nrhs, void* a, blas_int* lda, void* b, blas_int* ldb, void* work, blas_int* lwork, blas_int* info); void arma_fortran(cgels)(char* trans, blas_int* m, blas_int* n, blas_in t* nrhs, void* a, blas_int* lda, void* b, blas_int* ldb, void* work, blas_int* lwork, blas_int* info);
void arma_fortran(zgels)(char* trans, blas_int* m, blas_int* n, blas_in t* nrhs, void* a, blas_int* lda, void* b, blas_int* ldb, void* work, blas_int* lwork, blas_int* info); void arma_fortran(zgels)(char* trans, blas_int* m, blas_int* n, blas_in t* nrhs, void* a, blas_int* lda, void* b, blas_int* ldb, void* work, blas_int* lwork, blas_int* info);
// solve a triangular system of linear equations
void arma_fortran(strtrs)(char* uplo, char* trans, char* diag, blas_int
* n, blas_int* nrhs, const float* a, blas_int* lda, float* b, blas_int* l
db, blas_int* info);
void arma_fortran(dtrtrs)(char* uplo, char* trans, char* diag, blas_int
* n, blas_int* nrhs, const double* a, blas_int* lda, double* b, blas_int* l
db, blas_int* info);
void arma_fortran(ctrtrs)(char* uplo, char* trans, char* diag, blas_int
* n, blas_int* nrhs, const void* a, blas_int* lda, void* b, blas_int* l
db, blas_int* info);
void arma_fortran(ztrtrs)(char* uplo, char* trans, char* diag, blas_int
* n, blas_int* nrhs, const void* a, blas_int* lda, void* b, blas_int* l
db, blas_int* info);
// void arma_fortran(dgeqp3)(blas_int* m, blas_int* n, double* a, blas_ int* lda, blas_int* jpvt, double* tau, double* work, blas_int* lwork, blas_ int* info); // void arma_fortran(dgeqp3)(blas_int* m, blas_int* n, double* a, blas_ int* lda, blas_int* jpvt, double* tau, double* work, blas_int* lwork, blas_ int* info);
// void arma_fortran(dormqr)(char* side, char* trans, blas_int* m, blas _int* n, blas_int* k, double* a, blas_int* lda, double* tau, double* c, bla s_int* ldc, double* work, blas_int* lwork, blas_int* info); // void arma_fortran(dormqr)(char* side, char* trans, blas_int* m, blas _int* n, blas_int* k, double* a, blas_int* lda, double* tau, double* c, bla s_int* ldc, double* work, blas_int* lwork, blas_int* info);
// void arma_fortran(dposv)(char* uplo, blas_int* n, blas_int* nrhs, d ouble* a, blas_int* lda, double* b, blas_int* ldb, blas_int* info); // void arma_fortran(dposv)(char* uplo, blas_int* n, blas_int* nrhs, d ouble* a, blas_int* lda, double* b, blas_int* ldb, blas_int* info);
// void arma_fortran(dtrtrs)(char* uplo, char* trans, char* diag, blas_ int* n, blas_int* nrhs, double* a, blas_int* lda, double* b, blas_int* ldb, blas_int* info);
// void arma_fortran(dgees)(char* jobvs, char* sort, blas_int* select, blas_int* n, double* a, blas_int* lda, blas_int* sdim, double* wr, double* wi, double* vs, blas_int* ldvs, double* work, blas_int* lwork, blas_int* b work, blas_int* info); // void arma_fortran(dgees)(char* jobvs, char* sort, blas_int* select, blas_int* n, double* a, blas_int* lda, blas_int* sdim, double* wr, double* wi, double* vs, blas_int* ldvs, double* work, blas_int* lwork, blas_int* b work, blas_int* info);
} }
template<typename eT> template<typename eT>
inline inline
void void
getrf(blas_int* m, blas_int* n, eT* a, blas_int* lda, blas_int* ipiv, bla s_int* info) getrf(blas_int* m, blas_int* n, eT* a, blas_int* lda, blas_int* ipiv, bla s_int* info)
{ {
arma_type_check<is_supported_blas_type<eT>::value == false>::apply(); arma_type_check<is_supported_blas_type<eT>::value == false>::apply();
skipping to change at line 166 skipping to change at line 177
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_fortran(zgetri)(n, (T*)a, lda, ipiv, (T*)work, lwork, info); arma_fortran(zgetri)(n, (T*)a, lda, ipiv, (T*)work, lwork, info);
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
trtri(char* uplo, char* diag, blas_int* n, eT* a, blas_int* lda, blas_int
* info)
{
arma_type_check<is_supported_blas_type<eT>::value == false>::apply();
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(strtri)(uplo, diag, n, (T*)a, lda, info);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(dtrtri)(uplo, diag, n, (T*)a, lda, info);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
arma_fortran(ctrtri)(uplo, diag, n, (T*)a, lda, info);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
arma_fortran(ztrtri)(uplo, diag, n, (T*)a, lda, info);
}
}
template<typename eT>
inline
void
syev(char* jobz, char* uplo, blas_int* n, eT* a, blas_int* lda, eT* w, e T* work, blas_int* lwork, blas_int* info) syev(char* jobz, char* uplo, blas_int* n, eT* a, blas_int* lda, eT* w, e T* work, blas_int* lwork, blas_int* info)
{ {
arma_type_check<is_supported_blas_type<eT>::value == false>::apply(); arma_type_check<is_supported_blas_type<eT>::value == false>::apply();
if(is_float<eT>::value == true) if(is_float<eT>::value == true)
{ {
typedef float T; typedef float T;
arma_fortran(ssyev)(jobz, uplo, n, (T*)a, lda, (T*)w, (T*)work, lwork , info); arma_fortran(ssyev)(jobz, uplo, n, (T*)a, lda, (T*)w, (T*)work, lwork , info);
} }
else else
skipping to change at line 499 skipping to change at line 542
arma_fortran(cgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)wo rk, lwork, info); arma_fortran(cgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)wo rk, lwork, info);
} }
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_fortran(zgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)wo rk, lwork, info); arma_fortran(zgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)wo rk, lwork, info);
} }
} }
template<typename eT>
inline
void
trtrs(char* uplo, char* trans, char* diag, blas_int* n, blas_int* nrhs, c
onst eT* a, blas_int* lda, eT* b, blas_int* ldb, blas_int* info)
{
arma_type_check<is_supported_blas_type<eT>::value == false>::apply();
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(strtrs)(uplo, trans, diag, n, nrhs, (T*)a, lda, (T*)b, l
db, info);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(dtrtrs)(uplo, trans, diag, n, nrhs, (T*)a, lda, (T*)b, l
db, info);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
arma_fortran(ctrtrs)(uplo, trans, diag, n, nrhs, (T*)a, lda, (T*)b, l
db, info);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
arma_fortran(ztrtrs)(uplo, trans, diag, n, nrhs, (T*)a, lda, (T*)b, l
db, info);
}
}
//! @} //! @}
} }
#endif #endif
 End of changes. 6 change blocks. 
2 lines changed or deleted 95 lines changed or added


 op_dot_meat.hpp   op_dot_meat.hpp 
skipping to change at line 258 skipping to change at line 258
const eT tmpB = PB[i]; const eT tmpB = PB[i];
acc1 += tmpA * tmpA; acc1 += tmpA * tmpA;
acc2 += tmpB * tmpB; acc2 += tmpB * tmpB;
acc3 += tmpA * tmpB; acc3 += tmpA * tmpB;
} }
return acc3 / ( std::sqrt(acc1 * acc2) ); return acc3 / ( std::sqrt(acc1 * acc2) );
} }
//
// op_cdot
template<typename T1, typename T2>
arma_hot
arma_inline
typename T1::elem_type
op_cdot::apply(const Base<typename T1::elem_type,T1>& X, const Base<typenam
e T1::elem_type,T2>& Y)
{
arma_extra_debug_sigprint();
typedef typename T1::elem_type eT;
typedef typename Proxy<T1>::ea_type ea_type1;
typedef typename Proxy<T2>::ea_type ea_type2;
const Proxy<T1> A(X.get_ref());
const Proxy<T2> B(Y.get_ref());
arma_debug_check( (A.get_n_elem() != B.get_n_elem()), "cdot(): objects mu
st have the same number of elements" );
const u32 N = A.get_n_elem();
ea_type1 PA = A.get_ea();
ea_type2 PB = B.get_ea();
eT val1 = eT(0);
eT val2 = eT(0);
u32 i,j;
for(i=0, j=1; j<N; i+=2, j+=2)
{
val1 += std::conj(PA[i]) * PB[i];
val2 += std::conj(PA[j]) * PB[j];
}
if(i < N)
{
val1 += conj(PA[i]) * PB[i];
}
return val1 + val2;
}
//! @} //! @}
 End of changes. 1 change blocks. 
0 lines changed or deleted 44 lines changed or added


 op_dot_proto.hpp   op_dot_proto.hpp 
skipping to change at line 60 skipping to change at line 60
//! \brief //! \brief
//! normalised dot product operation //! normalised dot product operation
class op_norm_dot class op_norm_dot
{ {
public: public:
template<typename T1, typename T2> template<typename T1, typename T2>
arma_hot arma_inline static typename T1::elem_type apply(const Base<typen ame T1::elem_type,T1>& X, const Base<typename T1::elem_type,T2>& Y); arma_hot arma_inline static typename T1::elem_type apply(const Base<typen ame T1::elem_type,T1>& X, const Base<typename T1::elem_type,T2>& Y);
};
class op_cdot
{
public:
template<typename T1, typename T2>
arma_hot arma_inline static typename T1::elem_type apply(const Base<typen
ame T1::elem_type,T1>& X, const Base<typename T1::elem_type,T2>& Y);
}; };
//! @} //! @}
 End of changes. 2 change blocks. 
0 lines changed or deleted 8 lines changed or added


 op_find_meat.hpp   op_find_meat.hpp 
skipping to change at line 28 skipping to change at line 28
inline inline
u32 u32
op_find::helper op_find::helper
( (
Mat<u32>& indices, Mat<u32>& indices,
const Base<typename T1::elem_type, T1>& X const Base<typename T1::elem_type, T1>& X
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef typename Proxy<T1>::ea_type ea_type;
const Proxy<T1> P(X.get_ref()); const Proxy<T1> A(X.get_ref());
const u32 n_elem = P.get_n_elem(); ea_type PA = A.get_ea();
const u32 n_elem = A.get_n_elem();
indices.set_size(n_elem, 1); indices.set_size(n_elem, 1);
u32* indices_mem = indices.memptr(); u32* indices_mem = indices.memptr();
u32 n_nz = 0; u32 n_nz = 0;
for(u32 i=0; i<n_elem; ++i) for(u32 i=0; i<n_elem; ++i)
{ {
if(P[i] != eT(0)) if(PA[i] != eT(0))
{ {
indices_mem[n_nz] = i; indices_mem[n_nz] = i;
++n_nz; ++n_nz;
} }
} }
return n_nz; return n_nz;
} }
template<typename T1, typename op_type> template<typename T1, typename op_type>
skipping to change at line 63 skipping to change at line 65
u32 u32
op_find::helper op_find::helper
( (
Mat<u32>& indices, Mat<u32>& indices,
const mtOp<u32, T1, op_type>& X, const mtOp<u32, T1, op_type>& X,
const typename arma_op_rel_only<op_type>::result junk1, const typename arma_op_rel_only<op_type>::result junk1,
const typename arma_not_cx<typename T1::elem_type>::result junk2 const typename arma_not_cx<typename T1::elem_type>::result junk2
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef typename Proxy<T1>::ea_type ea_type;
const eT val = X.aux; const eT val = X.aux;
const Proxy<T1> P(X.m); const Proxy<T1> A(X.m);
const u32 n_elem = P.get_n_elem(); ea_type PA = A.get_ea();
const u32 n_elem = A.get_n_elem();
indices.set_size(n_elem, 1); indices.set_size(n_elem, 1);
u32* indices_mem = indices.memptr(); u32* indices_mem = indices.memptr();
u32 n_nz = 0; u32 n_nz = 0;
for(u32 i=0; i<n_elem; ++i) for(u32 i=0; i<n_elem; ++i)
{ {
const eT tmp = P[i]; const eT tmp = PA[i];
bool not_zero; bool not_zero;
if(is_same_type<op_type, op_rel_lt_pre >::value == true) { not_ zero = (val < tmp); } if(is_same_type<op_type, op_rel_lt_pre >::value == true) { not_ zero = (val < tmp); }
else if(is_same_type<op_type, op_rel_lt_post >::value == true) { not_ zero = (tmp < val); } else if(is_same_type<op_type, op_rel_lt_post >::value == true) { not_ zero = (tmp < val); }
else if(is_same_type<op_type, op_rel_gt_pre >::value == true) { not_ zero = (val > tmp); } else if(is_same_type<op_type, op_rel_gt_pre >::value == true) { not_ zero = (val > tmp); }
else if(is_same_type<op_type, op_rel_gt_post >::value == true) { not_ zero = (tmp > val); } else if(is_same_type<op_type, op_rel_gt_post >::value == true) { not_ zero = (tmp > val); }
else if(is_same_type<op_type, op_rel_lteq_pre >::value == true) { not_ zero = (val <= tmp); } else if(is_same_type<op_type, op_rel_lteq_pre >::value == true) { not_ zero = (val <= tmp); }
else if(is_same_type<op_type, op_rel_lteq_post>::value == true) { not_ zero = (tmp <= val); } else if(is_same_type<op_type, op_rel_lteq_post>::value == true) { not_ zero = (tmp <= val); }
else if(is_same_type<op_type, op_rel_gteq_pre >::value == true) { not_ zero = (val >= tmp); } else if(is_same_type<op_type, op_rel_gteq_pre >::value == true) { not_ zero = (val >= tmp); }
skipping to change at line 115 skipping to change at line 118
return n_nz; return n_nz;
} }
template<typename T1, typename op_type> template<typename T1, typename op_type>
inline inline
u32 u32
op_find::helper op_find::helper
( (
Mat<u32>& indices, Mat<u32>& indices,
const mtOp<u32, T1, op_type>& X, const mtOp<u32, T1, op_type>& X,
const typename arma_op_rel_only<op_type>::result junk1, const typename arma_op_rel_only<op_type>::result junk1,
const typename arma_cx_only<typename T1::elem_type>::result junk2 const typename arma_cx_only<typename T1::elem_type>::result junk2
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1);
arma_ignore(junk2);
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef typename Proxy<T1>::ea_type ea_type;
const eT val = X.aux; const eT val = X.aux;
const Proxy<T1> P(X.m); const Proxy<T1> A(X.m);
const u32 n_elem = P.get_n_elem(); ea_type PA = A.get_ea();
const u32 n_elem = A.get_n_elem();
indices.set_size(n_elem, 1); indices.set_size(n_elem, 1);
u32* indices_mem = indices.memptr(); u32* indices_mem = indices.memptr();
u32 n_nz = 0; u32 n_nz = 0;
for(u32 i=0; i<n_elem; ++i) for(u32 i=0; i<n_elem; ++i)
{ {
const eT tmp = P[i]; const eT tmp = PA[i];
bool not_zero; bool not_zero;
if(is_same_type<op_type, op_rel_eq >::value == true) { not_zero = (tmp == val); } if(is_same_type<op_type, op_rel_eq >::value == true) { not_zero = (tmp == val); }
else if(is_same_type<op_type, op_rel_noteq>::value == true) { not_zero = (tmp != val); } else if(is_same_type<op_type, op_rel_noteq>::value == true) { not_zero = (tmp != val); }
else not_zero = false; else not_zero = false;
if(not_zero == true) if(not_zero == true)
{ {
indices_mem[n_nz] = i; indices_mem[n_nz] = i;
skipping to change at line 167 skipping to change at line 174
op_find::helper op_find::helper
( (
Mat<u32>& indices, Mat<u32>& indices,
const mtGlue<u32, T1, T2, glue_type>& X, const mtGlue<u32, T1, T2, glue_type>& X,
const typename arma_glue_rel_only<glue_type>::result junk1, const typename arma_glue_rel_only<glue_type>::result junk1,
const typename arma_not_cx<typename T1::elem_type>::result junk2, const typename arma_not_cx<typename T1::elem_type>::result junk2,
const typename arma_not_cx<typename T2::elem_type>::result junk3 const typename arma_not_cx<typename T2::elem_type>::result junk3
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
arma_ignore(junk3); arma_ignore(junk3);
typedef typename T1::elem_type eT1; typedef typename T1::elem_type eT1;
typedef typename T2::elem_type eT2; typedef typename T2::elem_type eT2;
typedef typename Proxy<T1>::ea_type ea_type1;
typedef typename Proxy<T2>::ea_type ea_type2;
const Proxy<T1> A(X.A); const Proxy<T1> A(X.A);
const Proxy<T2> B(X.B); const Proxy<T2> B(X.B);
arma_debug_assert_same_size(A, B, "relational operator"); arma_debug_assert_same_size(A, B, "relational operator");
const u32 n_elem = A.get_n_elem(); ea_type1 PA = A.get_ea();
ea_type2 PB = B.get_ea();
const u32 n_elem = B.get_n_elem();
indices.set_size(n_elem, 1); indices.set_size(n_elem, 1);
u32* indices_mem = indices.memptr(); u32* indices_mem = indices.memptr();
u32 n_nz = 0; u32 n_nz = 0;
for(u32 i=0; i<n_elem; ++i) for(u32 i=0; i<n_elem; ++i)
{ {
const eT1 tmp1 = A[i]; const eT1 tmp1 = PA[i];
const eT1 tmp2 = B[i]; const eT2 tmp2 = PB[i];
bool not_zero; bool not_zero;
if(is_same_type<glue_type, glue_rel_lt >::value == true) { not _zero = (tmp1 < tmp2); } if(is_same_type<glue_type, glue_rel_lt >::value == true) { not _zero = (tmp1 < tmp2); }
else if(is_same_type<glue_type, glue_rel_gt >::value == true) { not _zero = (tmp1 > tmp2); } else if(is_same_type<glue_type, glue_rel_gt >::value == true) { not _zero = (tmp1 > tmp2); }
else if(is_same_type<glue_type, glue_rel_lteq >::value == true) { not _zero = (tmp1 <= tmp2); } else if(is_same_type<glue_type, glue_rel_lteq >::value == true) { not _zero = (tmp1 <= tmp2); }
else if(is_same_type<glue_type, glue_rel_gteq >::value == true) { not _zero = (tmp1 >= tmp2); } else if(is_same_type<glue_type, glue_rel_gteq >::value == true) { not _zero = (tmp1 >= tmp2); }
else if(is_same_type<glue_type, glue_rel_eq >::value == true) { not _zero = (tmp1 == tmp2); } else if(is_same_type<glue_type, glue_rel_eq >::value == true) { not _zero = (tmp1 == tmp2); }
else if(is_same_type<glue_type, glue_rel_noteq >::value == true) { not _zero = (tmp1 != tmp2); } else if(is_same_type<glue_type, glue_rel_noteq >::value == true) { not _zero = (tmp1 != tmp2); }
else not_zero = false; else not_zero = false;
skipping to change at line 225 skipping to change at line 236
op_find::helper op_find::helper
( (
Mat<u32>& indices, Mat<u32>& indices,
const mtGlue<u32, T1, T2, glue_type>& X, const mtGlue<u32, T1, T2, glue_type>& X,
const typename arma_glue_rel_only<glue_type>::result junk1, const typename arma_glue_rel_only<glue_type>::result junk1,
const typename arma_cx_only<typename T1::elem_type>::result junk2, const typename arma_cx_only<typename T1::elem_type>::result junk2,
const typename arma_cx_only<typename T2::elem_type>::result junk3 const typename arma_cx_only<typename T2::elem_type>::result junk3
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk1); arma_ignore(junk1);
arma_ignore(junk2); arma_ignore(junk2);
arma_ignore(junk3); arma_ignore(junk3);
typedef typename Proxy<T1>::ea_type ea_type1;
typedef typename Proxy<T2>::ea_type ea_type2;
const Proxy<T1> A(X.A); const Proxy<T1> A(X.A);
const Proxy<T2> B(X.B); const Proxy<T2> B(X.B);
arma_debug_assert_same_size(A, B, "relational operator"); arma_debug_assert_same_size(A, B, "relational operator");
const u32 n_elem = A.get_n_elem(); ea_type1 PA = A.get_ea();
ea_type2 PB = B.get_ea();
const u32 n_elem = B.get_n_elem();
indices.set_size(n_elem, 1); indices.set_size(n_elem, 1);
u32* indices_mem = indices.memptr(); u32* indices_mem = indices.memptr();
u32 n_nz = 0; u32 n_nz = 0;
for(u32 i=0; i<n_elem; ++i) for(u32 i=0; i<n_elem; ++i)
{ {
bool not_zero; bool not_zero;
if(is_same_type<glue_type, glue_rel_eq >::value == true) { not if(is_same_type<glue_type, glue_rel_eq >::value == true) { not
_zero = (A[i] == B[i]); } _zero = (PA[i] == PB[i]); }
else if(is_same_type<glue_type, glue_rel_noteq >::value == true) { not else if(is_same_type<glue_type, glue_rel_noteq >::value == true) { not
_zero = (A[i] != B[i]); } _zero = (PA[i] != PB[i]); }
else not_zero = false; else not_zero = false;
if(not_zero == true) if(not_zero == true)
{ {
indices_mem[n_nz] = i; indices_mem[n_nz] = i;
++n_nz; ++n_nz;
} }
} }
return n_nz; return n_nz;
 End of changes. 23 change blocks. 
24 lines changed or deleted 39 lines changed or added


 op_inv_meat.hpp   op_inv_meat.hpp 
skipping to change at line 79 skipping to change at line 79
{ {
for(u32 row=0; row<col; ++row) { out.at(row,col) = eT(0); } for(u32 row=0; row<col; ++row) { out.at(row,col) = eT(0); }
out.at(col,col) = eT(1) / A[col]; out.at(col,col) = eT(1) / A[col];
for(u32 row=col+1; row<N; ++row) { out.at(row,col) = eT(0); } for(u32 row=col+1; row<N; ++row) { out.at(row,col) = eT(0); }
} }
} }
//! inverse of T1 (triangular matrices)
template<typename T1>
inline
void
op_inv_tr::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_inv_tr>&
X)
{
arma_extra_debug_sigprint();
auxlib::inv_tr(out, X.m, X.aux_u32_a);
}
//! @} //! @}
 End of changes. 1 change blocks. 
0 lines changed or deleted 12 lines changed or added


 op_inv_proto.hpp   op_inv_proto.hpp 
skipping to change at line 16 skipping to change at line 16
// 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_inv //! \addtogroup op_inv
//! @{ //! @{
//! 'invert matrix' operation //! 'invert matrix' operation (general matrices)
class op_inv class op_inv
{ {
public: public:
template<typename eT> template<typename eT>
inline static void apply(Mat<eT>& out, const Mat<eT>& A); inline static void apply(Mat<eT>& out, const Mat<eT>& A);
template<typename T1> template<typename T1>
inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op _inv>& in); inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op _inv>& in);
template<typename T1> template<typename T1>
inline static void apply_diag(Mat<typename T1::elem_type>& out, const Bas e<typename T1::elem_type, T1>& X); inline static void apply_diag(Mat<typename T1::elem_type>& out, const Bas e<typename T1::elem_type, T1>& X);
}; };
//! 'invert matrix' operation (triangular matrices)
class op_inv_tr
{
public:
template<typename T1>
inline static void apply(Mat<typename T1::elem_type>& out, const Op<T1,op
_inv_tr>& in);
};
//! @} //! @}
 End of changes. 2 change blocks. 
2 lines changed or deleted 11 lines changed or added


 podarray_meat.hpp   podarray_meat.hpp 
skipping to change at line 156 skipping to change at line 156
init(0); init(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();
for(u32 i=0; i<n_elem; ++i) arrayops::inplace_set(memptr(), val, n_elem);
{
access::rw(mem[i]) = val;
}
} }
template<typename eT> template<typename eT>
inline inline
void void
podarray<eT>::zeros() podarray<eT>::zeros()
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
fill(eT(0)); fill(eT(0));
} }
template<typename eT> template<typename eT>
inline inline
void void
podarray<eT>::zeros(const u32 new_n_elem) podarray<eT>::zeros(const u32 new_n_elem)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
init(new_n_elem); init(new_n_elem);
fill(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 const_cast<eT*>(mem);
} }
 End of changes. 2 change blocks. 
5 lines changed or deleted 2 lines changed or added


 span.hpp   span.hpp 
skipping to change at line 16 skipping to change at line 16
// 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 span //! \addtogroup span
//! @{ //! @{
enum span_helper
{
span_whole_vector
};
class span class span
{ {
public: public:
static const span_helper all = span_whole_vector;
inline inline
span(const u32 in_a, const u32 in_b) span(const u32 in_a, const u32 in_b)
: a(in_a) : a(in_a)
, b(in_b) , b(in_b)
{ {
} }
const u32 a; const u32 a;
const u32 b; const u32 b;
}; };
 End of changes. 2 change blocks. 
0 lines changed or deleted 7 lines changed or added


 subview_cube_meat.hpp   subview_cube_meat.hpp 
skipping to change at line 502 skipping to change at line 502
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const unwrap<T1> tmp(in.get_ref()); const unwrap<T1> tmp(in.get_ref());
const Mat<eT>& x = tmp.M; const Mat<eT>& x = tmp.M;
subview_cube<eT>& t = *this; subview_cube<eT>& t = *this;
arma_debug_assert_same_size(t, x, "copy into subcube"); arma_debug_assert_same_size(t, x, "copy into subcube");
const u32 t_n_rows = t.n_rows; const u32 t_n_rows = t.n_rows;
const u32 t_n_cols = t.n_cols; const u32 t_n_cols = t.n_cols;
const u32 t_aux_slice1 = t.aux_slice1;
for(u32 col = 0; col < t_n_cols; ++col) for(u32 col = 0; col < t_n_cols; ++col)
{ {
syslib::copy_elem( t.slice_colptr(0, col), x.colptr(col), t_n_rows ); syslib:copy_elem( t.slice_colptr(t_aux_slice1, col), x.colptr(col), t_n _rows );
} }
} }
template<typename eT> template<typename eT>
template<typename T1> template<typename T1>
inline inline
void void
subview_cube<eT>::operator+= (const Base<eT,T1>& in) subview_cube<eT>::operator+= (const Base<eT,T1>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const unwrap<T1> tmp(in.get_ref()); const unwrap<T1> tmp(in.get_ref());
const Mat<eT>& x = tmp.M; const Mat<eT>& x = tmp.M;
subview_cube<eT>& t = *this; subview_cube<eT>& t = *this;
arma_debug_assert_same_size(t, x, "cube addition"); arma_debug_assert_same_size(t, x, "cube addition");
const u32 t_n_rows = t.n_rows; const u32 t_n_rows = t.n_rows;
const u32 t_n_cols = t.n_cols; const u32 t_n_cols = t.n_cols;
const u32 t_aux_slice1 = t.aux_slice1;
for(u32 col = 0; col < t_n_cols; ++col) for(u32 col = 0; col < t_n_cols; ++col)
{ {
arrayops::inplace_plus( t.slice_colptr(0, col), x.colptr(col), t_n_rows ); arrayops::inplace_plus( t.slice_colptr(t_aux_slice1, col), x.colptr(col ), t_n_rows );
} }
} }
template<typename eT> template<typename eT>
template<typename T1> template<typename T1>
inline inline
void void
subview_cube<eT>::operator-= (const Base<eT,T1>& in) subview_cube<eT>::operator-= (const Base<eT,T1>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const unwrap<T1> tmp(in.get_ref()); const unwrap<T1> tmp(in.get_ref());
const Mat<eT>& x = tmp.M; const Mat<eT>& x = tmp.M;
subview_cube<eT>& t = *this; subview_cube<eT>& t = *this;
arma_debug_assert_same_size(t, x, "cube subtraction"); arma_debug_assert_same_size(t, x, "cube subtraction");
const u32 t_n_rows = t.n_rows; const u32 t_n_rows = t.n_rows;
const u32 t_n_cols = t.n_cols; const u32 t_n_cols = t.n_cols;
const u32 t_aux_slice1 = t.aux_slice1;
for(u32 col = 0; col < t_n_cols; ++col) for(u32 col = 0; col < t_n_cols; ++col)
{ {
arrayops::inplace_minus( t.slice_colptr(0, col), x.colptr(col), t_n_row s ); arrayops::inplace_minus( t.slice_colptr(t_aux_slice1, col), x.colptr(co l), t_n_rows );
} }
} }
template<typename eT> template<typename eT>
template<typename T1> template<typename T1>
inline inline
void void
subview_cube<eT>::operator%= (const Base<eT,T1>& in) subview_cube<eT>::operator%= (const Base<eT,T1>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const unwrap<T1> tmp(in.get_ref()); const unwrap<T1> tmp(in.get_ref());
const Mat<eT>& x = tmp.M; const Mat<eT>& x = tmp.M;
subview_cube<eT>& t = *this; subview_cube<eT>& t = *this;
arma_debug_assert_same_size(t, x, "cube schur product"); arma_debug_assert_same_size(t, x, "cube schur product");
const u32 t_n_rows = t.n_rows; const u32 t_n_rows = t.n_rows;
const u32 t_n_cols = t.n_cols; const u32 t_n_cols = t.n_cols;
const u32 t_aux_slice1 = t.aux_slice1;
for(u32 col = 0; col < t_n_cols; ++col) for(u32 col = 0; col < t_n_cols; ++col)
{ {
arrayops::inplace_mul( t.slice_colptr(0, col), x.colptr(col), t_n_rows ); arrayops::inplace_mul( t.slice_colptr(t_aux_slice1, col), x.colptr(col) , t_n_rows );
} }
} }
template<typename eT> template<typename eT>
template<typename T1> template<typename T1>
inline inline
void void
subview_cube<eT>::operator/= (const Base<eT,T1>& in) subview_cube<eT>::operator/= (const Base<eT,T1>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const unwrap<T1> tmp(in.get_ref()); const unwrap<T1> tmp(in.get_ref());
const Mat<eT>& x = tmp.M; const Mat<eT>& x = tmp.M;
subview_cube<eT>& t = *this; subview_cube<eT>& t = *this;
arma_debug_assert_same_size(t, x, "element-wise cube division"); arma_debug_assert_same_size(t, x, "element-wise cube division");
const u32 t_n_rows = t.n_rows; const u32 t_n_rows = t.n_rows;
const u32 t_n_cols = t.n_cols; const u32 t_n_cols = t.n_cols;
const u32 t_aux_slice1 = t.aux_slice1;
for(u32 col = 0; col < t_n_cols; ++col) for(u32 col = 0; col < t_n_cols; ++col)
{ {
arrayops::inplace_div( t.slice_colptr(0, col), x.colptr(col), t_n_rows ); arrayops::inplace_div( t.slice_colptr(t_aux_slice1, col), x.colptr(col) , t_n_rows );
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
subview_cube<eT>::fill(const eT val) subview_cube<eT>::fill(const eT val)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
skipping to change at line 882 skipping to change at line 887
//! mat X = Y.subcube(...) //! mat X = Y.subcube(...)
template<typename eT> template<typename eT>
inline inline
void void
subview_cube<eT>::extract(Mat<eT>& out, const subview_cube<eT>& in) subview_cube<eT>::extract(Mat<eT>& out, const subview_cube<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (in.n_slices != 1), "subview_cube::extract(): given sub cube doesn't have exactly one slice" ); arma_debug_check( (in.n_slices != 1), "subview_cube::extract(): given sub cube doesn't have exactly one slice" );
const u32 n_rows = in.n_rows; const u32 n_rows = in.n_rows;
const u32 n_cols = in.n_cols; const u32 n_cols = in.n_cols;
const u32 aux_slice1 = in.aux_slice1;
out.set_size(n_rows, n_cols); out.set_size(n_rows, n_cols);
for(u32 col = 0; col < n_cols; ++col) for(u32 col = 0; col < n_cols; ++col)
{ {
syslib::copy_elem( out.colptr(col), in.slice_colptr(0, col), n_rows ); syslib::copy_elem( out.colptr(col), in.slice_colptr(aux_slice1, col), n _rows );
} }
} }
//! cube X += Y.subcube(...) //! cube X += Y.subcube(...)
template<typename eT> template<typename eT>
inline inline
void void
subview_cube<eT>::plus_inplace(Cube<eT>& out, const subview_cube<eT>& in) subview_cube<eT>::plus_inplace(Cube<eT>& out, const subview_cube<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
skipping to change at line 995 skipping to change at line 1001
//! mat X += Y.subcube(...) //! mat X += Y.subcube(...)
template<typename eT> template<typename eT>
inline inline
void void
subview_cube<eT>::plus_inplace(Mat<eT>& out, const subview_cube<eT>& in) subview_cube<eT>::plus_inplace(Mat<eT>& out, const subview_cube<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_assert_same_size(out, in, "matrix addition"); arma_debug_assert_same_size(out, in, "matrix addition");
const u32 in_n_rows = in.n_rows; const u32 in_n_rows = in.n_rows;
const u32 in_n_cols = in.n_cols; const u32 in_n_cols = in.n_cols;
const u32 in_aux_slice1 = in.aux_slice1;
for(u32 col = 0; col < in_n_cols; ++col) for(u32 col = 0; col < in_n_cols; ++col)
{ {
arrayops::inplace_plus( out.colptr(col), in.slice_colptr(0, col), in_n_ rows ); arrayops::inplace_plus( out.colptr(col), in.slice_colptr(in_aux_slice1, col), in_n_rows );
} }
} }
//! mat X -= Y.subcube(...) //! mat X -= Y.subcube(...)
template<typename eT> template<typename eT>
inline inline
void void
subview_cube<eT>::minus_inplace(Mat<eT>& out, const subview_cube<eT>& in) subview_cube<eT>::minus_inplace(Mat<eT>& out, const subview_cube<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_assert_same_size(out, in, "matrix subtraction"); arma_debug_assert_same_size(out, in, "matrix subtraction");
const u32 in_n_rows = in.n_rows; const u32 in_n_rows = in.n_rows;
const u32 in_n_cols = in.n_cols; const u32 in_n_cols = in.n_cols;
const u32 in_aux_slice1 = in.aux_slice1;
for(u32 col = 0; col < in_n_cols; ++col) for(u32 col = 0; col < in_n_cols; ++col)
{ {
arrayops::inplace_minus( out.colptr(col), in.slice_colptr(0, col), in_n _rows ); arrayops::inplace_minus( out.colptr(col), in.slice_colptr(in_aux_slice1 , col), in_n_rows );
} }
} }
//! mat X %= Y.subcube(...) //! mat X %= Y.subcube(...)
template<typename eT> template<typename eT>
inline inline
void void
subview_cube<eT>::schur_inplace(Mat<eT>& out, const subview_cube<eT>& in) subview_cube<eT>::schur_inplace(Mat<eT>& out, const subview_cube<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_assert_same_size(out, in, "matrix schur product"); arma_debug_assert_same_size(out, in, "matrix schur product");
const u32 in_n_rows = in.n_rows; const u32 in_n_rows = in.n_rows;
const u32 in_n_cols = in.n_cols; const u32 in_n_cols = in.n_cols;
const u32 in_aux_slice1 = in.aux_slice1;
for(u32 col = 0; col < in_n_cols; ++col) for(u32 col = 0; col < in_n_cols; ++col)
{ {
arrayops::inplace_mul( out.colptr(col), in.slice_colptr(0, col), in_n_r ows ); arrayops::inplace_mul( out.colptr(col), in.slice_colptr(in_aux_slice1, col), in_n_rows );
} }
} }
//! mat X /= Y.subcube(...) //! mat X /= Y.subcube(...)
template<typename eT> template<typename eT>
inline inline
void void
subview_cube<eT>::div_inplace(Mat<eT>& out, const subview_cube<eT>& in) subview_cube<eT>::div_inplace(Mat<eT>& out, const subview_cube<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_assert_same_size(out, in, "matrix element-wise division"); arma_debug_assert_same_size(out, in, "matrix element-wise division");
const u32 in_n_rows = in.n_rows; const u32 in_n_rows = in.n_rows;
const u32 in_n_cols = in.n_cols; const u32 in_n_cols = in.n_cols;
const u32 in_aux_slice1 = in.aux_slice1;
for(u32 col = 0; col < in_n_cols; ++col) for(u32 col = 0; col < in_n_cols; ++col)
{ {
arrayops::inplace_div( out.colptr(col), in.slice_colptr(0, col), in_n_r ows ); arrayops::inplace_div( out.colptr(col), in.slice_colptr(in_aux_slice1, col), in_n_rows );
} }
} }
//! @} //! @}
 End of changes. 20 change blocks. 
30 lines changed or deleted 40 lines changed or added


 subview_meat.hpp   subview_meat.hpp 
skipping to change at line 161 skipping to change at line 161
{ {
for(u32 col=0; col<local_n_cols; ++col) for(u32 col=0; col<local_n_cols; ++col)
{ {
arrayops::inplace_div( colptr(col), val, local_n_rows ); arrayops::inplace_div( colptr(col), val, local_n_rows );
} }
} }
} }
template<typename eT> template<typename eT>
template<typename T1> template<typename T1>
arma_inline inline
void void
subview<eT>::operator= (const Base<eT,T1>& in) subview<eT>::operator= (const Base<eT,T1>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const unwrap<T1> tmp(in.get_ref()); const Proxy<T1> P(in.get_ref());
const Mat<eT>& x = tmp.M;
subview<eT>& t = *this; subview<eT>& t = *this;
arma_debug_assert_same_size(t, x, "insert into submatrix");
const u32 t_n_rows = t.n_rows; const u32 t_n_rows = t.n_rows;
const u32 t_n_cols = t.n_cols; const u32 t_n_cols = t.n_cols;
if(t_n_rows == 1) arma_debug_assert_same_size(t, P, "insert into submatrix");
const bool alias = P.is_alias(t.m);
arma_extra_debug_warn(alias, "aliasing detected");
if( (alias == true) || (is_Mat<typename Proxy<T1>::stored_type>::value ==
true) )
{ {
const eT* x_mem = x.memptr(); const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, t.m);
const Mat<eT>& x = tmp.M;
for(u32 col=0; col<t_n_cols; ++col) if(t_n_rows == 1)
{
const eT* x_mem = x.memptr();
for(u32 col=0; col<t_n_cols; ++col)
{
at(0,col) = x_mem[col];
}
}
else
{ {
at(0,col) = x_mem[col]; for(u32 col=0; col<t_n_cols; ++col)
{
syslib::copy_elem( t.colptr(col), x.colptr(col), t_n_rows );
}
} }
} }
else else
{ {
for(u32 col=0; col<t_n_cols; ++col) if(t_n_rows == 1)
{ {
syslib::copy_elem( t.colptr(col), x.colptr(col), t_n_rows ); for(u32 col=0; col<t_n_cols; ++col)
{
at(0,col) = P[col];
}
}
else
{
for(u32 col=0; col<t_n_cols; ++col)
{
eT* t_col_data = t.colptr(col);
u32 i,j;
for(i=0, j=1; j<t_n_rows; i+=2, j+=2)
{
const eT tmp1 = P.at(i,col);
const eT tmp2 = P.at(j,col);
t_col_data[i] = tmp1;
t_col_data[j] = tmp2;
}
if(i < t_n_rows)
{
t_col_data[i] = P.at(i,col);
}
}
} }
} }
} }
template<typename eT> template<typename eT>
template<typename T1> template<typename T1>
inline inline
void void
subview<eT>::operator+= (const Base<eT,T1>& in) subview<eT>::operator+= (const Base<eT,T1>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const unwrap<T1> tmp(in.get_ref()); const Proxy<T1> P(in.get_ref());
const Mat<eT>& x = tmp.M;
subview<eT>& t = *this; subview<eT>& t = *this;
arma_debug_assert_same_size(t, x, "matrix addition");
const u32 t_n_rows = t.n_rows; const u32 t_n_rows = t.n_rows;
const u32 t_n_cols = t.n_cols; const u32 t_n_cols = t.n_cols;
if(t_n_rows == 1) arma_debug_assert_same_size(t, P, "addition");
const bool alias = P.is_alias(t.m);
arma_extra_debug_warn(alias, "aliasing detected");
if( (alias == true) || (is_Mat<typename Proxy<T1>::stored_type>::value ==
true) )
{ {
const eT* x_mem = x.memptr(); const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, t.m);
const Mat<eT>& x = tmp.M;
for(u32 col=0; col<t_n_cols; ++col) if(t_n_rows == 1)
{
const eT* x_mem = x.memptr();
for(u32 col=0; col<t_n_cols; ++col)
{
at(0,col) += x_mem[col];
}
}
else
{ {
at(0,col) += x_mem[col]; for(u32 col=0; col<t_n_cols; ++col)
{
arrayops::inplace_plus( t.colptr(col), x.colptr(col), t_n_rows );
}
} }
} }
else else
{ {
for(u32 col=0; col<t_n_cols; ++col) if(t_n_rows == 1)
{ {
arrayops::inplace_plus( t.colptr(col), x.colptr(col), t_n_rows ); for(u32 col=0; col<t_n_cols; ++col)
{
at(0,col) += P[col];
}
}
else
{
for(u32 col=0; col<t_n_cols; ++col)
{
eT* t_col_data = t.colptr(col);
u32 i,j;
for(i=0, j=1; j<t_n_rows; i+=2, j+=2)
{
const eT val1 = P.at(i,col);
const eT val2 = P.at(j,col);
t_col_data[i] += val1;
t_col_data[j] += val2;
}
if(i < t_n_rows)
{
t_col_data[i] += P.at(i,col);
}
}
} }
} }
} }
template<typename eT> template<typename eT>
template<typename T1> template<typename T1>
inline inline
void void
subview<eT>::operator-= (const Base<eT,T1>& in) subview<eT>::operator-= (const Base<eT,T1>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const unwrap<T1> tmp(in.get_ref()); const Proxy<T1> P(in.get_ref());
const Mat<eT>& x = tmp.M;
subview<eT>& t = *this; subview<eT>& t = *this;
arma_debug_assert_same_size(t, x, "matrix subtraction");
const u32 t_n_rows = t.n_rows; const u32 t_n_rows = t.n_rows;
const u32 t_n_cols = t.n_cols; const u32 t_n_cols = t.n_cols;
if(t_n_rows == 1) arma_debug_assert_same_size(t, P, "subtraction");
const bool alias = P.is_alias(t.m);
if( (alias == true) || (is_Mat<typename Proxy<T1>::stored_type>::value ==
true) )
{ {
const eT* x_mem = x.memptr(); const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, t.m);
const Mat<eT>& x = tmp.M;
for(u32 col=0; col<t_n_cols; ++col) if(t_n_rows == 1)
{
const eT* x_mem = x.memptr();
for(u32 col=0; col<t_n_cols; ++col)
{
at(0,col) -= x_mem[col];
}
}
else
{ {
at(0,col) -= x_mem[col]; for(u32 col=0; col<t_n_cols; ++col)
{
arrayops::inplace_minus( t.colptr(col), x.colptr(col), t_n_rows );
}
} }
} }
else else
{ {
for(u32 col=0; col<t_n_cols; ++col) if(t_n_rows == 1)
{ {
arrayops::inplace_minus( t.colptr(col), x.colptr(col), t_n_rows ); for(u32 col=0; col<t_n_cols; ++col)
{
at(0,col) -= P[col];
}
}
else
{
for(u32 col=0; col<t_n_cols; ++col)
{
eT* t_col_data = t.colptr(col);
u32 i,j;
for(i=0, j=1; j<t_n_rows; i+=2, j+=2)
{
const eT val1 = P.at(i,col);
const eT val2 = P.at(j,col);
t_col_data[i] -= val1;
t_col_data[j] -= val2;
}
if(i < t_n_rows)
{
t_col_data[i] -= P.at(i,col);
}
}
} }
} }
} }
template<typename eT> template<typename eT>
template<typename T1> template<typename T1>
inline inline
void void
subview<eT>::operator%= (const Base<eT,T1>& in) subview<eT>::operator%= (const Base<eT,T1>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const unwrap<T1> tmp(in.get_ref()); const Proxy<T1> P(in.get_ref());
const Mat<eT>& x = tmp.M;
subview<eT>& t = *this; subview<eT>& t = *this;
arma_debug_assert_same_size(t, x, "matrix schur product");
const u32 t_n_rows = t.n_rows; const u32 t_n_rows = t.n_rows;
const u32 t_n_cols = t.n_cols; const u32 t_n_cols = t.n_cols;
if(t_n_rows == 1) arma_debug_assert_same_size(t, P, "element-wise multiplication");
const bool alias = P.is_alias(t.m);
arma_extra_debug_warn(alias, "aliasing detected");
if( (alias == true) || (is_Mat<typename Proxy<T1>::stored_type>::value ==
true) )
{ {
const eT* x_mem = x.memptr(); const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, t.m);
const Mat<eT>& x = tmp.M;
for(u32 col=0; col<t_n_cols; ++col) if(t_n_rows == 1)
{
const eT* x_mem = x.memptr();
for(u32 col=0; col<t_n_cols; ++col)
{
at(0,col) *= x_mem[col];
}
}
else
{ {
at(0,col) *= x_mem[col]; for(u32 col=0; col<t_n_cols; ++col)
{
arrayops::inplace_mul( t.colptr(col), x.colptr(col), t_n_rows );
}
} }
} }
else else
{ {
for(u32 col=0; col<t_n_cols; ++col) if(t_n_rows == 1)
{ {
arrayops::inplace_mul( t.colptr(col), x.colptr(col), t_n_rows ); for(u32 col=0; col<t_n_cols; ++col)
{
at(0,col) *= P[col];
}
}
else
{
for(u32 col=0; col<t_n_cols; ++col)
{
eT* t_col_data = t.colptr(col);
u32 i,j;
for(i=0, j=1; j<t_n_rows; i+=2, j+=2)
{
const eT val1 = P.at(i,col);
const eT val2 = P.at(j,col);
t_col_data[i] *= val1;
t_col_data[j] *= val2;
}
if(i < t_n_rows)
{
t_col_data[i] *= P.at(i,col);
}
}
} }
} }
} }
template<typename eT> template<typename eT>
template<typename T1> template<typename T1>
inline inline
void void
subview<eT>::operator/= (const Base<eT,T1>& in) subview<eT>::operator/= (const Base<eT,T1>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const unwrap<T1> tmp(in.get_ref()); const Proxy<T1> P(in.get_ref());
const Mat<eT>& x = tmp.M;
subview<eT>& t = *this; subview<eT>& t = *this;
arma_debug_assert_same_size(t, x, "element-wise matrix division");
const u32 t_n_rows = t.n_rows; const u32 t_n_rows = t.n_rows;
const u32 t_n_cols = t.n_cols; const u32 t_n_cols = t.n_cols;
if(t_n_rows == 1) arma_debug_assert_same_size(t, P, "element-wise division");
const bool alias = P.is_alias(t.m);
arma_extra_debug_warn(alias, "aliasing detected");
if( (alias == true) || (is_Mat<typename Proxy<T1>::stored_type>::value ==
true) )
{ {
const eT* x_mem = x.memptr(); const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, t.m);
const Mat<eT>& x = tmp.M;
for(u32 col=0; col<t_n_cols; ++col) if(t_n_rows == 1)
{
const eT* x_mem = x.memptr();
for(u32 col=0; col<t_n_cols; ++col)
{
at(0,col) /= x_mem[col];
}
}
else
{ {
at(0,col) /= x_mem[col]; for(u32 col=0; col<t_n_cols; ++col)
{
arrayops::inplace_div( t.colptr(col), x.colptr(col), t_n_rows );
}
} }
} }
else else
{ {
for(u32 col=0; col<t_n_cols; ++col) if(t_n_rows == 1)
{ {
arrayops::inplace_div( t.colptr(col), x.colptr(col), t_n_rows ); for(u32 col=0; col<t_n_cols; ++col)
{
at(0,col) /= P[col];
}
}
else
{
for(u32 col=0; col<t_n_cols; ++col)
{
eT* t_col_data = t.colptr(col);
u32 i,j;
for(i=0, j=1; j<t_n_rows; i+=2, j+=2)
{
const eT val1 = P.at(i,col);
const eT val2 = P.at(j,col);
t_col_data[i] /= val1;
t_col_data[j] /= val2;
}
if(i < t_n_rows)
{
t_col_data[i] /= P.at(i,col);
}
}
} }
} }
} }
//! x.submat(...) = y.submat(...) //! x.submat(...) = y.submat(...)
template<typename eT> template<typename eT>
inline inline
void void
subview<eT>::operator= (const subview<eT>& x_in) subview<eT>::operator= (const subview<eT>& x_in)
{ {
skipping to change at line 397 skipping to change at line 600
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const bool overlap = check_overlap(x_in); const bool overlap = check_overlap(x_in);
Mat<eT>* tmp_mat = overlap ? new Mat<eT>(x_in.m) : 0; Mat<eT>* tmp_mat = overlap ? new Mat<eT>(x_in.m) : 0;
const subview<eT>* tmp_subview = overlap ? new subview(*tmp_mat, x_in.aux _row1, x_in.aux_col1, x_in.aux_row2, x_in.aux_col2) : 0; const subview<eT>* tmp_subview = overlap ? new subview(*tmp_mat, x_in.aux _row1, x_in.aux_col1, x_in.aux_row2, x_in.aux_col2) : 0;
const subview<eT>& x = overlap ? (*tmp_subview) : x_in; const subview<eT>& x = overlap ? (*tmp_subview) : x_in;
subview<eT>& t = *this; subview<eT>& t = *this;
arma_debug_assert_same_size(t, x, "matrix addition"); arma_debug_assert_same_size(t, x, "addition");
const u32 t_n_rows = t.n_rows; const u32 t_n_rows = t.n_rows;
const u32 t_n_cols = t.n_cols; const u32 t_n_cols = t.n_cols;
if(t_n_rows == 1) if(t_n_rows == 1)
{ {
for(u32 col=0; col<t_n_cols; ++col) for(u32 col=0; col<t_n_cols; ++col)
{ {
t.at(0,col) += x.at(0,col); t.at(0,col) += x.at(0,col);
} }
skipping to change at line 439 skipping to change at line 642
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const bool overlap = check_overlap(x_in); const bool overlap = check_overlap(x_in);
Mat<eT>* tmp_mat = overlap ? new Mat<eT>(x_in.m) : 0; Mat<eT>* tmp_mat = overlap ? new Mat<eT>(x_in.m) : 0;
const subview<eT>* tmp_subview = overlap ? new subview(*tmp_mat, x_in.aux _row1, x_in.aux_col1, x_in.aux_row2, x_in.aux_col2) : 0; const subview<eT>* tmp_subview = overlap ? new subview(*tmp_mat, x_in.aux _row1, x_in.aux_col1, x_in.aux_row2, x_in.aux_col2) : 0;
const subview<eT>& x = overlap ? (*tmp_subview) : x_in; const subview<eT>& x = overlap ? (*tmp_subview) : x_in;
subview<eT>& t = *this; subview<eT>& t = *this;
arma_debug_assert_same_size(t, x, "matrix subtraction"); arma_debug_assert_same_size(t, x, "subtraction");
const u32 t_n_rows = t.n_rows; const u32 t_n_rows = t.n_rows;
const u32 t_n_cols = t.n_cols; const u32 t_n_cols = t.n_cols;
if(t_n_rows == 1) if(t_n_rows == 1)
{ {
for(u32 col=0; col<t_n_cols; ++col) for(u32 col=0; col<t_n_cols; ++col)
{ {
t.at(0,col) -= x.at(0,col); t.at(0,col) -= x.at(0,col);
} }
skipping to change at line 482 skipping to change at line 685
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const bool overlap = check_overlap(x_in); const bool overlap = check_overlap(x_in);
Mat<eT>* tmp_mat = overlap ? new Mat<eT>(x_in.m) : 0; Mat<eT>* tmp_mat = overlap ? new Mat<eT>(x_in.m) : 0;
const subview<eT>* tmp_subview = overlap ? new subview(*tmp_mat, x_in.aux _row1, x_in.aux_col1, x_in.aux_row2, x_in.aux_col2) : 0; const subview<eT>* tmp_subview = overlap ? new subview(*tmp_mat, x_in.aux _row1, x_in.aux_col1, x_in.aux_row2, x_in.aux_col2) : 0;
const subview<eT>& x = overlap ? (*tmp_subview) : x_in; const subview<eT>& x = overlap ? (*tmp_subview) : x_in;
subview<eT>& t = *this; subview<eT>& t = *this;
arma_debug_assert_same_size(t, x, "matrix schur product"); arma_debug_assert_same_size(t, x, "element-wise multiplication");
const u32 t_n_rows = t.n_rows; const u32 t_n_rows = t.n_rows;
const u32 t_n_cols = t.n_cols; const u32 t_n_cols = t.n_cols;
if(t_n_rows == 1) if(t_n_rows == 1)
{ {
for(u32 col=0; col<t_n_cols; ++col) for(u32 col=0; col<t_n_cols; ++col)
{ {
t.at(0,col) *= x.at(0,col); t.at(0,col) *= x.at(0,col);
} }
skipping to change at line 525 skipping to change at line 728
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const bool overlap = check_overlap(x_in); const bool overlap = check_overlap(x_in);
Mat<eT>* tmp_mat = overlap ? new Mat<eT>(x_in.m) : 0; Mat<eT>* tmp_mat = overlap ? new Mat<eT>(x_in.m) : 0;
const subview<eT>* tmp_subview = overlap ? new subview(*tmp_mat, x_in.aux _row1, x_in.aux_col1, x_in.aux_row2, x_in.aux_col2) : 0; const subview<eT>* tmp_subview = overlap ? new subview(*tmp_mat, x_in.aux _row1, x_in.aux_col1, x_in.aux_row2, x_in.aux_col2) : 0;
const subview<eT>& x = overlap ? (*tmp_subview) : x_in; const subview<eT>& x = overlap ? (*tmp_subview) : x_in;
subview<eT>& t = *this; subview<eT>& t = *this;
arma_debug_assert_same_size(t, x, "element-wise matrix division"); arma_debug_assert_same_size(t, x, "element-wise division");
const u32 t_n_rows = t.n_rows; const u32 t_n_rows = t.n_rows;
const u32 t_n_cols = t.n_cols; const u32 t_n_cols = t.n_cols;
if(t_n_rows == 1) if(t_n_rows == 1)
{ {
for(u32 col=0; col<t_n_cols; ++col) for(u32 col=0; col<t_n_cols; ++col)
{ {
t.at(0,col) /= x.at(0,col); t.at(0,col) /= x.at(0,col);
} }
skipping to change at line 812 skipping to change at line 1015
} }
//! X += Y.submat(...) //! X += Y.submat(...)
template<typename eT> template<typename eT>
inline inline
void void
subview<eT>::plus_inplace(Mat<eT>& out, const subview<eT>& in) subview<eT>::plus_inplace(Mat<eT>& out, const subview<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_assert_same_size(out, in, "matrix addition"); arma_debug_assert_same_size(out, in, "addition");
const u32 n_rows = out.n_rows; const u32 n_rows = out.n_rows;
const u32 n_cols = out.n_cols; const u32 n_cols = out.n_cols;
if(n_rows == 1) if(n_rows == 1)
{ {
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
for(u32 col=0; col<n_cols; ++col) for(u32 col=0; col<n_cols; ++col)
{ {
skipping to change at line 843 skipping to change at line 1046
} }
//! X -= Y.submat(...) //! X -= Y.submat(...)
template<typename eT> template<typename eT>
inline inline
void void
subview<eT>::minus_inplace(Mat<eT>& out, const subview<eT>& in) subview<eT>::minus_inplace(Mat<eT>& out, const subview<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_assert_same_size(out, in, "matrix subtraction"); arma_debug_assert_same_size(out, in, "subtraction");
const u32 n_rows = out.n_rows; const u32 n_rows = out.n_rows;
const u32 n_cols = out.n_cols; const u32 n_cols = out.n_cols;
if(n_rows == 1) if(n_rows == 1)
{ {
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
for(u32 col=0; col<n_cols; ++col) for(u32 col=0; col<n_cols; ++col)
{ {
skipping to change at line 874 skipping to change at line 1077
} }
//! X %= Y.submat(...) //! X %= Y.submat(...)
template<typename eT> template<typename eT>
inline inline
void void
subview<eT>::schur_inplace(Mat<eT>& out, const subview<eT>& in) subview<eT>::schur_inplace(Mat<eT>& out, const subview<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_assert_same_size(out, in, "matrix schur product"); arma_debug_assert_same_size(out, in, "element-wise multiplication");
const u32 n_rows = out.n_rows; const u32 n_rows = out.n_rows;
const u32 n_cols = out.n_cols; const u32 n_cols = out.n_cols;
if(n_rows == 1) if(n_rows == 1)
{ {
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
for(u32 col=0; col<n_cols; ++col) for(u32 col=0; col<n_cols; ++col)
{ {
skipping to change at line 905 skipping to change at line 1108
} }
//! X /= Y.submat(...) //! X /= Y.submat(...)
template<typename eT> template<typename eT>
inline inline
void void
subview<eT>::div_inplace(Mat<eT>& out, const subview<eT>& in) subview<eT>::div_inplace(Mat<eT>& out, const subview<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_assert_same_size(out, in, "element-wise matrix division"); arma_debug_assert_same_size(out, in, "element-wise division");
const u32 n_rows = out.n_rows; const u32 n_rows = out.n_rows;
const u32 n_cols = out.n_cols; const u32 n_cols = out.n_cols;
if(n_rows == 1) if(n_rows == 1)
{ {
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
for(u32 col=0; col<n_cols; ++col) for(u32 col=0; col<n_cols; ++col)
{ {
 End of changes. 49 change blocks. 
59 lines changed or deleted 267 lines changed or added


 typedef.hpp   typedef.hpp 
skipping to change at line 115 skipping to change at line 115
typedef Col<cx_float> cx_fcolvec; typedef Col<cx_float> cx_fcolvec;
typedef Row<cx_float> cx_frowvec; typedef Row<cx_float> cx_frowvec;
typedef Cube<cx_float> cx_fcube; typedef Cube<cx_float> cx_fcube;
typedef Mat<cx_double> cx_mat; typedef Mat<cx_double> cx_mat;
typedef Col<cx_double> cx_vec; typedef Col<cx_double> cx_vec;
typedef Col<cx_double> cx_colvec; typedef Col<cx_double> cx_colvec;
typedef Row<cx_double> cx_rowvec; typedef Row<cx_double> cx_rowvec;
typedef Cube<cx_double> cx_cube; typedef Cube<cx_double> cx_cube;
typedef void* void_ptr;
namespace junk namespace junk
{ {
struct arma_elem_size_test struct arma_elem_size_test
{ {
arma_static_assert<sizeof(u8) == 1> ERROR___TYPE_U8_HAS_UNSUPPORTED_SIZ E; arma_static_assert<sizeof(u8) == 1> ERROR___TYPE_U8_HAS_UNSUPPORTED_SIZ E;
arma_static_assert<sizeof(s8) == 1> ERROR___TYPE_S8_HAS_UNSUPPORTED_SIZ E; arma_static_assert<sizeof(s8) == 1> ERROR___TYPE_S8_HAS_UNSUPPORTED_SIZ E;
arma_static_assert<sizeof(u16) == 2> ERROR___TYPE_U16_HAS_UNSUPPORTED_S IZE; arma_static_assert<sizeof(u16) == 2> ERROR___TYPE_U16_HAS_UNSUPPORTED_S IZE;
arma_static_assert<sizeof(s16) == 2> ERROR___TYPE_S16_HAS_UNSUPPORTED_S IZE; arma_static_assert<sizeof(s16) == 2> ERROR___TYPE_S16_HAS_UNSUPPORTED_S IZE;
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added


 unwrap.hpp   unwrap.hpp 
skipping to change at line 219 skipping to change at line 219
} }
} }
// the order below is important // the order below is important
const Col<eT>* M_local; const Col<eT>* M_local;
const Col<eT>& M; const Col<eT>& M;
}; };
// //
//
//
template<typename T1>
class unwrap_check_mixed
{
public:
typedef typename T1::elem_type eT1;
template<typename eT2>
inline
unwrap_check_mixed(const T1& A, const Mat<eT2>& B)
: M(A)
{
arma_extra_debug_sigprint();
arma_ignore(B);
}
inline
~unwrap_check_mixed()
{
arma_extra_debug_sigprint();
}
const Mat<eT1> M;
};
template<typename eT1>
class unwrap_check_mixed< Mat<eT1> >
{
public:
template<typename eT2>
inline
unwrap_check_mixed(const Mat<eT1>& A, const Mat<eT2>& B)
: M_local( (void_ptr(&A) == void_ptr(&B)) ? new Mat<eT1>(A) : 0 )
, M ( (void_ptr(&A) == void_ptr(&B)) ? (*M_local) : A )
{
arma_extra_debug_sigprint();
}
inline
~unwrap_check_mixed()
{
arma_extra_debug_sigprint();
if(M_local)
{
delete M_local;
}
}
// the order below is important
const Mat<eT1>* M_local;
const Mat<eT1>& M;
};
template<typename eT1>
class unwrap_check_mixed< Row<eT1> >
{
public:
template<typename eT2>
inline
unwrap_check_mixed(const Row<eT1>& A, const Mat<eT2>& B)
: M_local( (void_ptr(&A) == void_ptr(&B)) ? new Row<eT1>(A) : 0 )
, M ( (void_ptr(&A) == void_ptr(&B)) ? (*M_local) : A )
{
arma_extra_debug_sigprint();
}
inline
~unwrap_check_mixed()
{
arma_extra_debug_sigprint();
if(M_local)
{
delete M_local;
}
}
// the order below is important
const Row<eT1>* M_local;
const Row<eT1>& M;
};
template<typename eT1>
class unwrap_check_mixed< Col<eT1> >
{
public:
template<typename eT2>
inline
unwrap_check_mixed(const Col<eT1>& A, const Mat<eT2>& B)
: M_local( (void_ptr(&A) == void_ptr(&B)) ? new Col<eT1>(A) : 0 )
, M ( (void_ptr(&A) == void_ptr(&B)) ? (*M_local) : A )
{
arma_extra_debug_sigprint();
}
inline
~unwrap_check_mixed()
{
arma_extra_debug_sigprint();
if(M_local)
{
delete M_local;
}
}
// the order below is important
const Col<eT1>* M_local;
const Col<eT1>& M;
};
//
template<typename T1> template<typename T1>
class partial_unwrap class partial_unwrap
{ {
public: public:
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
inline partial_unwrap(const T1& A) // TODO: change this to Base ? inline partial_unwrap(const T1& A) // TODO: change this to Base ?
: do_trans(false) : do_trans(false)
 End of changes. 1 change blocks. 
0 lines changed or deleted 119 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/