Col_meat.hpp   Col_meat.hpp 
skipping to change at line 506 skipping to change at line 506
{ {
access::rw(Mat<eT>::n_rows) = 0; access::rw(Mat<eT>::n_rows) = 0;
access::rw(Mat<eT>::n_cols) = 0; access::rw(Mat<eT>::n_cols) = 0;
access::rw(Mat<eT>::n_elem) = 0; access::rw(Mat<eT>::n_elem) = 0;
access::rw(Mat<eT>::vec_state) = 1; access::rw(Mat<eT>::vec_state) = 1;
access::rw(Mat<eT>::mem_state) = 3; access::rw(Mat<eT>::mem_state) = 3;
access::rw(Mat<eT>::mem) = 0; access::rw(Mat<eT>::mem) = 0;
} }
} }
template<typename eT>
template<u32 fixed_n_elem>
inline
Col<eT>::fixed<fixed_n_elem>::fixed(eT* aux_mem, const bool copy_aux_mem)
{
arma_extra_debug_sigprint_this(this);
if(fixed_n_elem > 0)
{
access::rw(Mat<eT>::n_rows) = fixed_n_elem;
access::rw(Mat<eT>::n_cols) = 1;
access::rw(Mat<eT>::n_elem) = fixed_n_elem;
access::rw(Mat<eT>::vec_state) = 1;
access::rw(Mat<eT>::mem_state) = 3;
if(copy_aux_mem == true)
{
access::rw(Mat<eT>::mem) = (fixed_n_elem > arma_config::mat_prealloc)
? mem_local_extra : Mat<eT>::mem_local;
arrayops::copy( const_cast<eT*>(Mat<eT>::mem), aux_mem, fixed_n_elem
);
}
else
{
access::rw(Mat<eT>::mem) = aux_mem;
}
}
else
{
access::rw(Mat<eT>::n_rows) = 0;
access::rw(Mat<eT>::n_cols) = 0;
access::rw(Mat<eT>::n_elem) = 0;
access::rw(Mat<eT>::vec_state) = 1;
access::rw(Mat<eT>::mem_state) = 3;
access::rw(Mat<eT>::mem) = 0;
}
}
template<typename eT>
template<u32 fixed_n_elem>
inline
Col<eT>::fixed<fixed_n_elem>::fixed(const eT* aux_mem)
{
mem_setup();
arrayops::copy( const_cast<eT*>(Mat<eT>::mem), aux_mem, fixed_n_elem );
}
#ifdef ARMA_EXTRA_COL_MEAT #ifdef ARMA_EXTRA_COL_MEAT
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_COL_MEAT) #include ARMA_INCFILE_WRAP(ARMA_EXTRA_COL_MEAT)
#endif #endif
//! @} //! @}
 End of changes. 1 change blocks. 
0 lines changed or deleted 49 lines changed or added


 Col_proto.hpp   Col_proto.hpp 
skipping to change at line 108 skipping to change at line 108
template<typename T1> template<typename T1>
inline fixed(const Base<eT,T1>& A) { mem_setup(); Col<eT>::operator=(A. get_ref()); } inline fixed(const Base<eT,T1>& A) { mem_setup(); Col<eT>::operator=(A. get_ref()); }
template<typename T1> template<typename T1>
inline const Col& operator=(const Base<eT,T1>& A) { Col<eT>::operator=( A.get_ref()); return *this; } inline const Col& operator=(const Base<eT,T1>& A) { Col<eT>::operator=( A.get_ref()); return *this; }
template<typename T1, typename T2> template<typename T1, typename T2>
inline explicit fixed(const Base<pod_type,T1>& A, const Base<pod_type,T 2>& B) { mem_setup(); Col<eT>::init(A,B); } inline explicit fixed(const Base<pod_type,T1>& A, const Base<pod_type,T 2>& B) { mem_setup(); Col<eT>::init(A,B); }
inline fixed( eT* aux_mem, const bool copy_aux_mem = true);
inline fixed(const eT* aux_mem);
inline fixed(const subview_cube<eT>& X) { mem_setup(); C ol<eT>::operator=(X); } inline fixed(const subview_cube<eT>& X) { mem_setup(); C ol<eT>::operator=(X); }
inline const Col& operator=(const subview_cube<eT>& X) { C ol<eT>::operator=(X); return *this; } inline const Col& operator=(const subview_cube<eT>& X) { C ol<eT>::operator=(X); return *this; }
}; };
#ifdef ARMA_EXTRA_COL_PROTO #ifdef ARMA_EXTRA_COL_PROTO
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_COL_PROTO) #include ARMA_INCFILE_WRAP(ARMA_EXTRA_COL_PROTO)
#endif #endif
}; };
 End of changes. 1 change blocks. 
0 lines changed or deleted 3 lines changed or added


 Cube_meat.hpp   Cube_meat.hpp 
skipping to change at line 1781 skipping to change at line 1781
//! 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
Cube<eT>::in_range(const u32 i) const Cube<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
Cube<eT>::in_range(const span& x) const
{
arma_extra_debug_sigprint();
if(x.whole == true)
{
return true;
}
else
{
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
Cube<eT>::in_range(const u32 in_row, const u32 in_col, const u32 in_slice) const Cube<eT>::in_range(const u32 in_row, const u32 in_col, const u32 in_slice) const
{ {
return ( (in_row < n_rows) && (in_col < n_cols) && (in_slice < n_slices) ); return ( (in_row < n_rows) && (in_col < n_cols) && (in_slice < n_slices) );
} }
template<typename eT>
inline
arma_warn_unused
bool
Cube<eT>::in_range(const span& row_span, const span& col_span, const span&
slice_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;
const u32 in_slice1 = slice_span.a;
const u32 in_slice2 = slice_span.b;
const bool rows_ok = row_span.whole ? true : ( (in_row1 <= in_row2)
&& (in_row2 < n_rows) );
const bool cols_ok = col_span.whole ? true : ( (in_col1 <= in_col2)
&& (in_col2 < n_cols) );
const bool slices_ok = slice_span.whole ? true : ( (in_slice1 <= in_slice
2) && (in_slice2 < n_slices) );
return ( (rows_ok == true) && (cols_ok == true) && (slices_ok == true) );
}
//! returns a pointer to array of eTs used by the cube //! returns a pointer to array of eTs used by the cube
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
eT* eT*
Cube<eT>::memptr() Cube<eT>::memptr()
{ {
return const_cast<eT*>(mem); return const_cast<eT*>(mem);
} }
 End of changes. 2 change blocks. 
0 lines changed or deleted 50 lines changed or added


 Cube_proto.hpp   Cube_proto.hpp 
skipping to change at line 174 skipping to change at line 174
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 span& x) 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 u3
2 in_col, const u32 in_slice) const;
inline arma_warn_unused bool in_range(const span& row_span, const sp
an& col_span, const span& slice_span) 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);
arma_inline arma_warn_unused const eT* slice_colptr(const u32 in_slice, c onst u32 in_col) const; arma_inline arma_warn_unused const eT* slice_colptr(const u32 in_slice, c onst u32 in_col) const;
 End of changes. 1 change blocks. 
4 lines changed or deleted 7 lines changed or added


 Mat_meat.hpp   Mat_meat.hpp 
skipping to change at line 4364 skipping to change at line 4364
{ {
access::rw(Mat<eT>::n_rows) = 0; access::rw(Mat<eT>::n_rows) = 0;
access::rw(Mat<eT>::n_cols) = 0; access::rw(Mat<eT>::n_cols) = 0;
access::rw(Mat<eT>::n_elem) = 0; access::rw(Mat<eT>::n_elem) = 0;
access::rw(Mat<eT>::vec_state) = 0; access::rw(Mat<eT>::vec_state) = 0;
access::rw(Mat<eT>::mem_state) = 3; access::rw(Mat<eT>::mem_state) = 3;
access::rw(Mat<eT>::mem) = 0; access::rw(Mat<eT>::mem) = 0;
} }
} }
template<typename eT>
template<u32 fixed_n_rows, u32 fixed_n_cols>
inline
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed(eT* aux_mem, const bool c
opy_aux_mem)
{
arma_extra_debug_sigprint_this(this);
if(fixed_n_elem > 0)
{
access::rw(Mat<eT>::n_rows) = fixed_n_rows;
access::rw(Mat<eT>::n_cols) = fixed_n_cols;
access::rw(Mat<eT>::n_elem) = fixed_n_elem;
access::rw(Mat<eT>::vec_state) = 0;
access::rw(Mat<eT>::mem_state) = 3;
if(copy_aux_mem == true)
{
access::rw(Mat<eT>::mem) = (fixed_n_elem > arma_config::mat_prealloc)
? mem_local_extra : mem_local;
arrayops::copy( const_cast<eT*>(Mat<eT>::mem), aux_mem, fixed_n_elem
);
}
else
{
access::rw(Mat<eT>::mem) = aux_mem;
}
}
else
{
access::rw(Mat<eT>::n_rows) = 0;
access::rw(Mat<eT>::n_cols) = 0;
access::rw(Mat<eT>::n_elem) = 0;
access::rw(Mat<eT>::vec_state) = 0;
access::rw(Mat<eT>::mem_state) = 3;
access::rw(Mat<eT>::mem) = 0;
}
}
template<typename eT>
template<u32 fixed_n_rows, u32 fixed_n_cols>
inline
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed(const eT* aux_mem)
{
mem_setup();
arrayops::copy( const_cast<eT*>(Mat<eT>::mem), aux_mem, fixed_n_elem );
}
//! prefix ++ //! prefix ++
template<typename eT> template<typename eT>
arma_inline arma_inline
void void
Mat_aux::prefix_pp(Mat<eT>& x) Mat_aux::prefix_pp(Mat<eT>& x)
{ {
eT* memptr = x.memptr(); eT* memptr = x.memptr();
const u32 n_elem = x.n_elem; const u32 n_elem = x.n_elem;
u32 i,j; u32 i,j;
 End of changes. 1 change blocks. 
0 lines changed or deleted 50 lines changed or added


 Mat_proto.hpp   Mat_proto.hpp 
skipping to change at line 247 skipping to change at line 247
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;
// TODO: test and add expanded .in_range() to user documentation
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 span& x) 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 arma_inline arma_warn_unused bool in_range(const u32 in_row, const u3
nst u32 in_col ) const; 2 in_col ) const;
arma_inline arma_warn_unused bool in_range(const span& row_span, co arma_inline arma_warn_unused bool in_range(const span& row_span, const u3
nst u32 in_col ) const; 2 in_col ) const;
arma_inline arma_warn_unused bool in_range(const u32 in_row, co arma_inline arma_warn_unused bool in_range(const u32 in_row, const sp
nst span& col_span) const; an& col_span) const;
arma_inline arma_warn_unused bool in_range(const span& row_span, co arma_inline arma_warn_unused bool in_range(const span& row_span, const sp
nst span& col_span) const; an& 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;
skipping to change at line 428 skipping to change at line 427
inline const Mat& operator=(const eT val) { Mat<eT>::operator=(val); re turn *this; } inline const Mat& operator=(const eT val) { Mat<eT>::operator=(val); re turn *this; }
template<typename T1> template<typename T1>
inline fixed(const Base<eT,T1>& A) { mem_setup(); Mat<eT>::operator=(A. get_ref()); } inline fixed(const Base<eT,T1>& A) { mem_setup(); Mat<eT>::operator=(A. get_ref()); }
template<typename T1> template<typename T1>
inline const Mat& operator=(const Base<eT,T1>& A) { Mat<eT>::operator=( A.get_ref()); return *this; } inline const Mat& operator=(const Base<eT,T1>& A) { Mat<eT>::operator=( A.get_ref()); return *this; }
template<typename T1, typename T2> template<typename T1, typename T2>
inline explicit fixed(const Base<pod_type,T1>& A, const Base<pod_type,T 2>& B) { mem_setup(); Mat<eT>::init(A,B); } inline explicit fixed(const Base<pod_type,T1>& A, const Base<pod_type,T 2>& B) { mem_setup(); Mat<eT>::init(A,B); }
inline fixed( eT* aux_mem, const bool copy_aux_mem = true);
inline fixed(const eT* aux_mem);
}; };
protected: protected:
inline void init(const u32 in_rows, const u32 in_cols); inline void init(const u32 in_rows, const u32 in_cols);
inline void init(const std::string& text); inline void init(const std::string& text);
inline void init(const Mat& x); inline void init(const Mat& x);
template<typename T1, typename T2> template<typename T1, typename T2>
inline void init(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B); inline void init(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B);
 End of changes. 3 change blocks. 
9 lines changed or deleted 11 lines changed or added


 Row_meat.hpp   Row_meat.hpp 
skipping to change at line 480 skipping to change at line 480
{ {
access::rw(Mat<eT>::n_rows) = 0; access::rw(Mat<eT>::n_rows) = 0;
access::rw(Mat<eT>::n_cols) = 0; access::rw(Mat<eT>::n_cols) = 0;
access::rw(Mat<eT>::n_elem) = 0; access::rw(Mat<eT>::n_elem) = 0;
access::rw(Mat<eT>::vec_state) = 2; access::rw(Mat<eT>::vec_state) = 2;
access::rw(Mat<eT>::mem_state) = 3; access::rw(Mat<eT>::mem_state) = 3;
access::rw(Mat<eT>::mem) = 0; access::rw(Mat<eT>::mem) = 0;
} }
} }
template<typename eT>
template<u32 fixed_n_elem>
inline
Row<eT>::fixed<fixed_n_elem>::fixed(eT* aux_mem, const bool copy_aux_mem)
{
arma_extra_debug_sigprint_this(this);
if(fixed_n_elem > 0)
{
access::rw(Mat<eT>::n_rows) = 1;
access::rw(Mat<eT>::n_cols) = fixed_n_elem;
access::rw(Mat<eT>::n_elem) = fixed_n_elem;
access::rw(Mat<eT>::vec_state) = 2;
access::rw(Mat<eT>::mem_state) = 3;
if(copy_aux_mem == true)
{
access::rw(Mat<eT>::mem) = (fixed_n_elem > arma_config::mat_prealloc)
? mem_local_extra : Mat<eT>::mem_local;
arrayops::copy( const_cast<eT*>(Mat<eT>::mem), aux_mem, fixed_n_elem
);
}
else
{
access::rw(Mat<eT>::mem) = aux_mem;
}
}
else
{
access::rw(Mat<eT>::n_rows) = 0;
access::rw(Mat<eT>::n_cols) = 0;
access::rw(Mat<eT>::n_elem) = 0;
access::rw(Mat<eT>::vec_state) = 2;
access::rw(Mat<eT>::mem_state) = 3;
access::rw(Mat<eT>::mem) = 0;
}
}
template<typename eT>
template<u32 fixed_n_elem>
inline
Row<eT>::fixed<fixed_n_elem>::fixed(const eT* aux_mem)
{
mem_setup();
arrayops::copy( const_cast<eT*>(Mat<eT>::mem), aux_mem, fixed_n_elem );
}
#ifdef ARMA_EXTRA_ROW_MEAT #ifdef ARMA_EXTRA_ROW_MEAT
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_ROW_MEAT) #include ARMA_INCFILE_WRAP(ARMA_EXTRA_ROW_MEAT)
#endif #endif
//! @} //! @}
 End of changes. 1 change blocks. 
0 lines changed or deleted 49 lines changed or added


 Row_proto.hpp   Row_proto.hpp 
skipping to change at line 107 skipping to change at line 107
template<typename T1> template<typename T1>
inline fixed(const Base<eT,T1>& A) { mem_setup(); Row<eT>::operator=(A. get_ref()); } inline fixed(const Base<eT,T1>& A) { mem_setup(); Row<eT>::operator=(A. get_ref()); }
template<typename T1> template<typename T1>
inline const Row& operator=(const Base<eT,T1>& A) { Row<eT>::operator=( A.get_ref()); return *this; } inline const Row& operator=(const Base<eT,T1>& A) { Row<eT>::operator=( A.get_ref()); return *this; }
template<typename T1, typename T2> template<typename T1, typename T2>
inline explicit fixed(const Base<pod_type,T1>& A, const Base<pod_type,T 2>& B) { mem_setup(); Row<eT>::init(A,B); } inline explicit fixed(const Base<pod_type,T1>& A, const Base<pod_type,T 2>& B) { mem_setup(); Row<eT>::init(A,B); }
inline fixed( eT* aux_mem, const bool copy_aux_mem = true);
inline fixed(const eT* aux_mem);
inline fixed(const subview_cube<eT>& X) { mem_setup(); R ow<eT>::operator=(X); } inline fixed(const subview_cube<eT>& X) { mem_setup(); R ow<eT>::operator=(X); }
inline const Row& operator=(const subview_cube<eT>& X) { R ow<eT>::operator=(X); return *this; } inline const Row& operator=(const subview_cube<eT>& X) { R ow<eT>::operator=(X); return *this; }
}; };
#ifdef ARMA_EXTRA_ROW_PROTO #ifdef ARMA_EXTRA_ROW_PROTO
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_ROW_PROTO) #include ARMA_INCFILE_WRAP(ARMA_EXTRA_ROW_PROTO)
#endif #endif
}; };
 End of changes. 1 change blocks. 
0 lines changed or deleted 3 lines changed or added


 arma_version.hpp   arma_version.hpp 
skipping to change at line 18 skipping to change at line 18
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup arma_version //! \addtogroup arma_version
//! @{ //! @{
#define ARMA_VERSION_MAJOR 1 #define ARMA_VERSION_MAJOR 1
#define ARMA_VERSION_MINOR 1 #define ARMA_VERSION_MINOR 1
#define ARMA_VERSION_PATCH 4 #define ARMA_VERSION_PATCH 6
#define ARMA_VERSION_NAME "Manta Lodge" #define ARMA_VERSION_NAME "Baby Carpet Shark"
// http://en.wikipedia.org/wiki/Carpet_shark
struct arma_version struct arma_version
{ {
static const unsigned int major = ARMA_VERSION_MAJOR; static const unsigned int major = ARMA_VERSION_MAJOR;
static const unsigned int minor = ARMA_VERSION_MINOR; static const unsigned int minor = ARMA_VERSION_MINOR;
static const unsigned int patch = ARMA_VERSION_PATCH; static const unsigned int patch = ARMA_VERSION_PATCH;
static static
inline inline
std::string std::string
 End of changes. 1 change blocks. 
2 lines changed or deleted 4 lines changed or added


 config.hpp   config.hpp 
skipping to change at line 15 skipping to change at line 15
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
#if !defined(ARMA_USE_LAPACK) #if !defined(ARMA_USE_LAPACK)
#define ARMA_USE_LAPACK #define ARMA_USE_LAPACK
//// Uncomment the above line if you have LAPACK or a fast replacement for
LAPACK,
//// such as Intel's MKL, AMD's ACML, or the Accelerate framework.
//// LAPACK is required for matrix decompositions (eg. SVD) and matrix inve
rse.
#endif #endif
#if !defined(ARMA_USE_BLAS) #if !defined(ARMA_USE_BLAS)
#define ARMA_USE_BLAS #define ARMA_USE_BLAS
//// Uncomment the above line if you have BLAS or a fast replacement for BL
AS,
//// such as GotoBLAS, Intel's MKL, AMD's ACML, or the Accelerate framework
.
//// BLAS is used for matrix multiplication.
//// Without BLAS, matrix multiplication will still work, but might be slow
er.
#endif #endif
// #define ARMA_BLAS_LONG // #define ARMA_BLAS_LONG
//// Uncomment the above line if your BLAS and LAPACK libraries use "long" instead of "int" //// Uncomment the above line if your BLAS and LAPACK libraries use "long" instead of "int"
// #define ARMA_BLAS_LONG_LONG // #define ARMA_BLAS_LONG_LONG
//// Uncomment the above line if your BLAS and LAPACK libraries use "long l ong" instead of "int" //// Uncomment the above line if your BLAS and LAPACK libraries use "long l ong" instead of "int"
#define ARMA_BLAS_UNDERSCORE #define ARMA_BLAS_UNDERSCORE
//// Uncomment the above line if your BLAS and LAPACK libraries have functi on names with a trailing underscore. //// Uncomment the above line if your BLAS and LAPACK libraries have functi on names with a trailing underscore.
//// Conversely, comment it out if the function names don't have a trailing underscore //// Conversely, comment it out if the function names don't have a trailing underscore.
#if !defined(ARMA_MAT_PREALLOC) #if !defined(ARMA_MAT_PREALLOC)
#define ARMA_MAT_PREALLOC 16 #define ARMA_MAT_PREALLOC 16
#endif #endif
//// This is the number of preallocated elements used by matrices and vecto rs; //// This is the number of preallocated elements used by matrices and vecto rs;
//// it must be an integer that is at least 1. //// it must be an integer that is at least 1.
//// If you mainly use lots of very small vectors (eg. <= 4 elements), //// If you mainly use lots of very small vectors (eg. <= 4 elements),
//// change the number to the size of your vectors. //// change the number to the size of your vectors.
#define ARMA_USE_ATLAS #define ARMA_USE_ATLAS
 End of changes. 3 change blocks. 
1 lines changed or deleted 13 lines changed or added


 field_meat.hpp   field_meat.hpp 
skipping to change at line 343 skipping to change at line 343
field<oT>::rows(const u32 in_row1, const u32 in_row2) field<oT>::rows(const u32 in_row1, const u32 in_row2)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check arma_debug_check
( (
( (in_row1 > in_row2) || (in_row2 >= n_rows) ), ( (in_row1 > in_row2) || (in_row2 >= n_rows) ),
"field::rows(): indicies out of bounds or incorrectly used" "field::rows(): indicies out of bounds or incorrectly used"
); );
const u32 subfield_n_rows = in_row2 - in_row1 + 1; const u32 sub_n_rows = in_row2 - in_row1 + 1;
return subview_field<oT>(*this, in_row1, 0, subfield_n_rows, n_cols); return subview_field<oT>(*this, in_row1, 0, sub_n_rows, n_cols);
} }
//! creation of subview_field (subfield comprised of specified rows) //! creation of subview_field (subfield comprised of specified rows)
template<typename oT> template<typename oT>
inline inline
const subview_field<oT> const subview_field<oT>
field<oT>::rows(const u32 in_row1, const u32 in_row2) const field<oT>::rows(const u32 in_row1, const u32 in_row2) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check arma_debug_check
( (
( (in_row1 > in_row2) || (in_row2 >= n_rows) ), ( (in_row1 > in_row2) || (in_row2 >= n_rows) ),
"field::rows(): indicies out of bounds or incorrectly used" "field::rows(): indicies out of bounds or incorrectly used"
); );
const u32 subfield_n_rows = in_row2 - in_row1 + 1; const u32 sub_n_rows = in_row2 - in_row1 + 1;
return subview_field<oT>(*this, in_row1, 0, subfield_n_rows, n_cols); return subview_field<oT>(*this, in_row1, 0, sub_n_rows, n_cols);
} }
//! creation of subview_field (subfield comprised of specified columns) //! creation of subview_field (subfield comprised of specified columns)
template<typename oT> template<typename oT>
inline inline
subview_field<oT> subview_field<oT>
field<oT>::cols(const u32 in_col1, const u32 in_col2) field<oT>::cols(const u32 in_col1, const u32 in_col2)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check arma_debug_check
( (
( (in_col1 > in_col2) || (in_col2 >= n_cols) ), ( (in_col1 > in_col2) || (in_col2 >= n_cols) ),
"field::cols(): indicies out of bounds or incorrectly used" "field::cols(): indicies out of bounds or incorrectly used"
); );
const u32 subfield_n_cols = in_col2 - in_col1 + 1; const u32 sub_n_cols = in_col2 - in_col1 + 1;
return subview_field<oT>(*this, 0, in_col1, n_rows, subfield_n_cols); return subview_field<oT>(*this, 0, in_col1, n_rows, sub_n_cols);
} }
//! creation of subview_field (subfield comprised of specified columns) //! creation of subview_field (subfield comprised of specified columns)
template<typename oT> template<typename oT>
inline inline
const subview_field<oT> const subview_field<oT>
field<oT>::cols(const u32 in_col1, const u32 in_col2) const field<oT>::cols(const u32 in_col1, const u32 in_col2) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check arma_debug_check
( (
( (in_col1 > in_col2) || (in_col2 >= n_cols) ), ( (in_col1 > in_col2) || (in_col2 >= n_cols) ),
"field::cols(): indicies out of bounds or incorrectly used" "field::cols(): indicies out of bounds or incorrectly used"
); );
const u32 subfield_n_cols = in_col2 - in_col1 + 1; const u32 sub_n_cols = in_col2 - in_col1 + 1;
return subview_field<oT>(*this, 0, in_col1, n_rows, subfield_n_cols); return subview_field<oT>(*this, 0, in_col1, n_rows, sub_n_cols);
} }
//! creation of subview_field (subfield with arbitrary dimensions) //! creation of subview_field (subfield with arbitrary dimensions)
template<typename oT> template<typename oT>
inline inline
subview_field<oT> subview_field<oT>
field<oT>::subfield(const u32 in_row1, const u32 in_col1, const u32 in_row2 , const u32 in_col2) field<oT>::subfield(const u32 in_row1, const u32 in_col1, const u32 in_row2 , const u32 in_col2)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check arma_debug_check
( (
(in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (i n_col2 >= n_cols), (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (i n_col2 >= n_cols),
"field::subfield(): indices out of bounds or incorrectly used" "field::subfield(): indices out of bounds or incorrectly used"
); );
const u32 subfield_n_rows = in_row2 - in_row1 + 1; const u32 sub_n_rows = in_row2 - in_row1 + 1;
const u32 subfield_n_cols = in_col2 - in_col1 + 1; const u32 sub_n_cols = in_col2 - in_col1 + 1;
return subview_field<oT>(*this, in_row1, in_col1, subfield_n_rows, subfie ld_n_cols); return subview_field<oT>(*this, in_row1, in_col1, sub_n_rows, sub_n_cols) ;
} }
//! creation of subview_field (generic submatrix) //! creation of subview_field (subfield with arbitrary dimensions)
template<typename oT> template<typename oT>
inline inline
const subview_field<oT> const subview_field<oT>
field<oT>::subfield(const u32 in_row1, const u32 in_col1, const u32 in_row2 , const u32 in_col2) const field<oT>::subfield(const u32 in_row1, const u32 in_col1, const u32 in_row2 , const u32 in_col2) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check arma_debug_check
( (
(in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (i n_col2 >= n_cols), (in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (i n_col2 >= n_cols),
"field::subfield(): indices out of bounds or incorrectly used" "field::subfield(): indices out of bounds or incorrectly used"
); );
const u32 subfield_n_rows = in_row2 - in_row1 + 1; const u32 sub_n_rows = in_row2 - in_row1 + 1;
const u32 subfield_n_cols = in_col2 - in_col1 + 1; const u32 sub_n_cols = in_col2 - in_col1 + 1;
return subview_field<oT>(*this, in_row1, in_col1, sub_n_rows, sub_n_cols)
;
}
//! creation of subview_field (subfield with arbitrary dimensions)
template<typename oT>
inline
subview_field<oT>
field<oT>::subfield(const span& row_span, const span& col_span)
{
arma_extra_debug_sigprint();
const bool row_all = row_span.whole;
const bool col_all = col_span.whole;
const u32 local_n_rows = n_rows;
const u32 local_n_cols = n_cols;
const u32 in_row1 = row_all ? 0 : row_span.a;
const u32 in_row2 = row_span.b;
const u32 sub_n_rows = row_all ? local_n_rows : in_row2 - in_row1 + 1;
const u32 in_col1 = col_all ? 0 : col_span.a;
const u32 in_col2 = col_span.b;
const u32 sub_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1;
arma_debug_check
(
( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows))
)
||
( col_all ? false : ((in_col1 > in_col2) || (in_col2 >= local_n_cols))
)
,
"field::subfield(): indices out of bounds or incorrectly used"
);
return subview_field<oT>(*this, in_row1, in_col1, sub_n_rows, sub_n_cols)
;
}
//! creation of subview_field (subfield with arbitrary dimensions)
template<typename oT>
inline
const subview_field<oT>
field<oT>::subfield(const span& row_span, const span& col_span) const
{
arma_extra_debug_sigprint();
const bool row_all = row_span.whole;
const bool col_all = col_span.whole;
const u32 local_n_rows = n_rows;
const u32 local_n_cols = n_cols;
const u32 in_row1 = row_all ? 0 : row_span.a;
const u32 in_row2 = row_span.b;
const u32 sub_n_rows = row_all ? local_n_rows : in_row2 - in_row1 + 1;
const u32 in_col1 = col_all ? 0 : col_span.a;
const u32 in_col2 = col_span.b;
const u32 sub_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1;
arma_debug_check
(
( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= local_n_rows))
)
||
( col_all ? false : ((in_col1 > in_col2) || (in_col2 >= local_n_cols))
)
,
"field::subfield(): indices out of bounds or incorrectly used"
);
return subview_field<oT>(*this, in_row1, in_col1, sub_n_rows, sub_n_cols)
;
}
template<typename oT>
inline
subview_field<oT>
field<oT>::operator()(const span& row_span, const span& col_span)
{
arma_extra_debug_sigprint();
return subview_field<oT>(*this, in_row1, in_col1, subfield_n_rows, subfie return (*this).subfield(row_span, col_span);
ld_n_cols); }
template<typename oT>
inline
const subview_field<oT>
field<oT>::operator()(const span& row_span, const span& col_span) const
{
arma_extra_debug_sigprint();
return (*this).subfield(row_span, col_span);
} }
//! print contents of the field (to the cout stream), //! print contents of the field (to the cout stream),
//! optionally preceding with a user specified line of text. //! optionally preceding with a user specified line of text.
//! the field class preserves the stream's flags //! the field class preserves the stream's flags
//! but the associated operator<< function for type oT //! but the associated operator<< function for type oT
//! may still modify the stream's parameters. //! may still modify the stream's parameters.
//! NOTE: this function assumes that type oT can be printed, //! NOTE: this function assumes that type oT can be printed,
//! i.e. the function "std::ostream& operator<< (std::ostream&, const oT&)" //! i.e. the function "std::ostream& operator<< (std::ostream&, const oT&)"
//! has been defined. //! has been defined.
skipping to change at line 551 skipping to change at line 639
arma_inline arma_inline
bool bool
field<oT>::is_empty() const field<oT>::is_empty() const
{ {
return (n_elem == 0); return (n_elem == 0);
} }
//! returns true if the given index is currently in range //! returns true if the given index is currently in range
template<typename oT> template<typename oT>
arma_inline arma_inline
arma_warn_unused
bool bool
field<oT>::in_range(const u32 i) const field<oT>::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 oT>
arma_inline
arma_warn_unused
bool
field<oT>::in_range(const span& x) const
{
arma_extra_debug_sigprint();
if(x.whole == true)
{
return true;
}
else
{
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 oT> template<typename oT>
arma_inline arma_inline
arma_warn_unused
bool bool
field<oT>::in_range(const u32 in_row, const u32 in_col) const field<oT>::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 oT> template<typename oT>
arma_inline
arma_warn_unused
bool
field<oT>::in_range(const span& row_span, const u32 in_col) const
{
arma_extra_debug_sigprint();
if(row_span.whole == true)
{
return (in_col < n_cols);
}
else
{
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 oT>
arma_inline
arma_warn_unused
bool
field<oT>::in_range(const u32 in_row, const span& col_span) const
{
arma_extra_debug_sigprint();
if(col_span.whole == true)
{
return (in_row < n_rows);
}
else
{
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 oT>
arma_inline
arma_warn_unused
bool
field<oT>::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;
const bool rows_ok = row_span.whole ? true : ( (in_row1 <= in_row2) && (i
n_row2 < n_rows) );
const bool cols_ok = col_span.whole ? true : ( (in_col1 <= in_col2) && (i
n_col2 < n_cols) );
return ( (rows_ok == true) && (cols_ok == true) );
}
template<typename oT>
inline inline
bool bool
field<oT>::save(const std::string name, const file_type type, const bool pr int_status) const field<oT>::save(const std::string name, const file_type type, const bool pr int_status) const
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
std::string err_msg; std::string err_msg;
const bool save_okay = field_aux::save(*this, name, type, err_msg); const bool save_okay = field_aux::save(*this, name, type, err_msg);
if( (print_status == true) && (save_okay == false) ) if( (print_status == true) && (save_okay == false) )
 End of changes. 17 change blocks. 
16 lines changed or deleted 200 lines changed or added


 field_proto.hpp   field_proto.hpp 
// Copyright (C) 2008-2010 NICTA (www.nicta.com.au) // Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
// Copyright (C) 2008-2010 Conrad Sanderson // Copyright (C) 2008-2011 Conrad Sanderson
// Copyright (C) 2009-2010 Ian Cullinan // Copyright (C) 2009-2010 Ian Cullinan
// //
// This file is part of the Armadillo C++ library. // This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
skipping to change at line 95 skipping to change at line 95
inline subview_field<oT> rows(const u32 in_row1, const u32 in_row2) ; inline subview_field<oT> rows(const u32 in_row1, const u32 in_row2) ;
inline const subview_field<oT> rows(const u32 in_row1, const u32 in_row2) const; inline const subview_field<oT> rows(const u32 in_row1, const u32 in_row2) const;
inline subview_field<oT> cols(const u32 in_col1, const u32 in_col2) ; inline subview_field<oT> cols(const u32 in_col1, const u32 in_col2) ;
inline const subview_field<oT> cols(const u32 in_col1, const u32 in_col2) const; inline const subview_field<oT> cols(const u32 in_col1, const u32 in_col2) const;
inline subview_field<oT> subfield(const u32 in_row1, const u32 in_c ol1, const u32 in_row2, const u32 in_col2); inline subview_field<oT> subfield(const u32 in_row1, const u32 in_c ol1, const u32 in_row2, const u32 in_col2);
inline const subview_field<oT> subfield(const u32 in_row1, const u32 in_c ol1, const u32 in_row2, const u32 in_col2) const; inline const subview_field<oT> subfield(const u32 in_row1, const u32 in_c ol1, const u32 in_row2, const u32 in_col2) const;
inline subview_field<oT> subfield (const span& row_span, const spa
n& col_span);
inline const subview_field<oT> subfield (const span& row_span, const spa
n& col_span) const;
inline subview_field<oT> operator()(const span& row_span, const spa
n& col_span);
inline const subview_field<oT> operator()(const span& row_span, const spa
n& col_span) 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;
inline void fill(const oT& x); inline void fill(const oT& x);
inline void reset(); inline void reset();
inline void reset_objects(); inline void reset_objects();
arma_inline bool is_empty() const; arma_inline bool is_empty() const;
arma_inline bool in_range(const u32 i) const; arma_inline arma_warn_unused bool in_range(const u32 i) const;
arma_inline bool in_range(const u32 in_row, const u32 in_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, const u3
2 in_col ) const;
arma_inline arma_warn_unused bool in_range(const span& row_span, const u3
2 in_col ) const;
arma_inline arma_warn_unused bool in_range(const u32 in_row, const sp
an& col_span) const;
arma_inline arma_warn_unused bool in_range(const span& row_span, const sp
an& col_span) const;
inline bool save(const std::string name, const file_type type = arma_bi nary, const bool print_status = true) const; inline bool save(const std::string name, const file_type type = arma_bi nary, const bool print_status = true) const;
inline bool save( std::ostream& os, const file_type type = arma_bi nary, const bool print_status = true) const; inline bool save( std::ostream& os, const file_type type = arma_bi nary, const bool print_status = true) const;
inline bool load(const std::string name, const file_type type = auto_de tect, const bool print_status = true); inline bool load(const std::string name, const file_type type = auto_de tect, const bool print_status = true);
inline bool load( std::istream& is, const file_type type = auto_de tect, const bool print_status = true); inline bool load( std::istream& is, const file_type type = auto_de tect, const bool print_status = true);
inline bool quiet_save(const std::string name, const file_type type = a rma_binary) const; inline bool quiet_save(const std::string name, const file_type type = a rma_binary) const;
inline bool quiet_save( std::ostream& os, const file_type type = a rma_binary) const; inline bool quiet_save( std::ostream& os, const file_type type = a rma_binary) const;
 End of changes. 3 change blocks. 
4 lines changed or deleted 23 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/