Base.hpp   Base.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 BaseCube.hpp   BaseCube.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 Col_meat.hpp   Col_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 Col_proto.hpp   Col_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 Cube_meat.hpp   Cube_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 1529 skipping to change at line 1526
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const Cube<eT> m(X); const Cube<eT> m(X);
return (*this).operator/=(m); return (*this).operator/=(m);
} }
//! linear element accessor (treats the cube as a vector); bounds checking not done when ARMA_NO_DEBUG is defined //! linear element accessor (treats the cube as a vector); bounds checking not done when ARMA_NO_DEBUG is defined
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
eT& eT&
Cube<eT>::operator() (const u32 i) Cube<eT>::operator() (const u32 i)
{ {
arma_debug_check( (i >= n_elem), "Cube::operator(): index out of bounds") ; arma_debug_check( (i >= n_elem), "Cube::operator(): index out of bounds") ;
return access::rw(mem[i]); return access::rw(mem[i]);
} }
//! linear element accessor (treats the cube as a vector); bounds checking not done when ARMA_NO_DEBUG is defined //! linear element accessor (treats the cube as a vector); bounds checking not done when ARMA_NO_DEBUG is defined
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
eT eT
Cube<eT>::operator() (const u32 i) const Cube<eT>::operator() (const u32 i) const
{ {
arma_debug_check( (i >= n_elem), "Cube::operator(): index out of bounds") ; arma_debug_check( (i >= n_elem), "Cube::operator(): index out of bounds") ;
return mem[i]; return mem[i];
} }
//! 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
eT& eT&
Cube<eT>::operator[] (const u32 i) Cube<eT>::operator[] (const u32 i)
{ {
return access::rw(mem[i]); return access::rw(mem[i]);
} }
//! 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
eT eT
Cube<eT>::operator[] (const u32 i) const Cube<eT>::operator[] (const u32 i) const
{ {
return mem[i]; 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
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) ||
(in_col >= n_cols) || (in_col >= n_cols) ||
(in_slice >= n_slices) (in_slice >= n_slices)
, ,
"Cube::operator(): index out of bounds" "Cube::operator(): index out of bounds"
); );
return access::rw(mem[in_slice*n_elem_slice + in_col*n_rows + in_row]); return access::rw(mem[in_slice*n_elem_slice + in_col*n_rows + in_row]);
} }
//! 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
eT eT
Cube<eT>::operator() (const u32 in_row, const u32 in_col, const u32 in_slic e) const Cube<eT>::operator() (const u32 in_row, const u32 in_col, const u32 in_slic e) const
{ {
arma_debug_check arma_debug_check
( (
(in_row >= n_rows) || (in_row >= n_rows) ||
(in_col >= n_cols) || (in_col >= n_cols) ||
(in_slice >= n_slices) (in_slice >= n_slices)
, ,
"Cube::operator(): index out of bounds" "Cube::operator(): index out of bounds"
); );
return mem[in_slice*n_elem_slice + in_col*n_rows + in_row]; return mem[in_slice*n_elem_slice + in_col*n_rows + in_row];
} }
//! element accessor; no bounds check //! element accessor; no bounds check
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
eT& eT&
Cube<eT>::at(const u32 in_row, const u32 in_col, const u32 in_slice) Cube<eT>::at(const u32 in_row, const u32 in_col, const u32 in_slice)
{ {
return access::rw( mem[in_slice*n_elem_slice + in_col*n_rows + in_row] ); return access::rw( mem[in_slice*n_elem_slice + in_col*n_rows + in_row] );
} }
//! element accessor; no bounds check //! element accessor; no bounds check
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
eT eT
Cube<eT>::at(const u32 in_row, const u32 in_col, const u32 in_slice) const Cube<eT>::at(const u32 in_row, const u32 in_col, const u32 in_slice) const
{ {
return mem[in_slice*n_elem_slice + in_col*n_rows + in_row]; return mem[in_slice*n_elem_slice + in_col*n_rows + in_row];
} }
//! prefix ++ //! prefix ++
template<typename eT> template<typename eT>
arma_inline arma_inline
const Cube<eT>& const Cube<eT>&
skipping to change at line 1659 skipping to change at line 1664
arma_inline arma_inline
void void
Cube<eT>::operator--(int) Cube<eT>::operator--(int)
{ {
Cube_aux::postfix_mm(*this); Cube_aux::postfix_mm(*this);
} }
//! returns true if all of the elements are finite //! returns true if all of the elements are finite
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
bool bool
Cube<eT>::is_finite() const Cube<eT>::is_finite() const
{ {
for(u32 i=0; i<n_elem; ++i) for(u32 i=0; i<n_elem; ++i)
{ {
if(arma_isfinite(mem[i]) == false) if(arma_isfinite(mem[i]) == false)
{ {
return false; return false;
} }
} }
return true; return true;
} }
//! returns true if the cube has no elements //! returns true if the cube has no elements
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
bool bool
Cube<eT>::is_empty() const Cube<eT>::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 eT> template<typename eT>
arma_inline arma_inline
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 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
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) );
} }
//! 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
eT* eT*
Cube<eT>::memptr() Cube<eT>::memptr()
{ {
return const_cast<eT*>(mem); return const_cast<eT*>(mem);
} }
//! 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
const eT* const eT*
Cube<eT>::memptr() const Cube<eT>::memptr() const
{ {
return mem; return mem;
} }
//! returns a pointer to array of eTs used by the specified slice in the cu be //! returns a pointer to array of eTs used by the specified slice in the cu be
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
eT* eT*
Cube<eT>::slice_memptr(const u32 slice) Cube<eT>::slice_memptr(const u32 slice)
{ {
return const_cast<eT*>( &mem[ slice*n_elem_slice ] ); return const_cast<eT*>( &mem[ slice*n_elem_slice ] );
} }
//! returns a pointer to array of eTs used by the specified slice in the cu be //! returns a pointer to array of eTs used by the specified slice in the cu be
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
const eT* const eT*
Cube<eT>::slice_memptr(const u32 slice) const Cube<eT>::slice_memptr(const u32 slice) const
{ {
return &mem[ slice*n_elem_slice ]; return &mem[ slice*n_elem_slice ];
} }
//! returns a pointer to array of eTs used by the specified slice in the cu be //! returns a pointer to array of eTs used by the specified slice in the cu be
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
eT* eT*
Cube<eT>::slice_colptr(const u32 slice, const u32 col) Cube<eT>::slice_colptr(const u32 slice, const u32 col)
{ {
return const_cast<eT*>( &mem[ slice*n_elem_slice + col*n_rows] ); return const_cast<eT*>( &mem[ slice*n_elem_slice + col*n_rows] );
} }
//! returns a pointer to array of eTs used by the specified slice in the cu be //! returns a pointer to array of eTs used by the specified slice in the cu be
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
const eT* const eT*
Cube<eT>::slice_colptr(const u32 slice, const u32 col) const Cube<eT>::slice_colptr(const u32 slice, const u32 col) const
{ {
return &mem[ slice*n_elem_slice + col*n_rows ]; return &mem[ slice*n_elem_slice + col*n_rows ];
} }
//! print contents of the cube (to the cout stream), //! print contents of the cube (to the cout stream),
//! optionally preceding with a user specified line of text. //! optionally preceding with a user specified line of text.
//! the precision and cell width are modified. //! the precision and cell width are modified.
//! on return, the stream's state are restored to their original values. //! on return, the stream's state are restored to their original values.
 End of changes. 19 change blocks. 
5 lines changed or deleted 20 lines changed or added


 Cube_proto.hpp   Cube_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 150 skipping to change at line 147
template<typename T1, typename T2, typename eglue_type> inline const Cube & operator%=(const eGlueCube<T1, T2, eglue_type>& X); template<typename T1, typename T2, typename eglue_type> inline const Cube & operator%=(const eGlueCube<T1, T2, eglue_type>& X);
template<typename T1, typename T2, typename eglue_type> inline const Cube & operator/=(const eGlueCube<T1, T2, eglue_type>& X); template<typename T1, typename T2, typename eglue_type> inline const Cube & operator/=(const eGlueCube<T1, T2, eglue_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 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 eT& operator[] (const u32 i); arma_inline arma_warn_unused eT& operator[] (const u32 i);
arma_inline eT operator[] (const u32 i) const; arma_inline arma_warn_unused eT operator[] (const u32 i) const;
arma_inline eT& operator() (const u32 i); arma_inline arma_warn_unused eT& operator() (const u32 i);
arma_inline eT operator() (const u32 i) const; arma_inline arma_warn_unused eT operator() (const u32 i) const;
arma_inline eT& at (const u32 in_row, const u32 in_col, const u32 arma_inline arma_warn_unused eT& at (const u32 in_row, const u32
in_slice); in_col, const u32 in_slice);
arma_inline eT at (const u32 in_row, const u32 in_col, const u32 arma_inline arma_warn_unused eT at (const u32 in_row, const u32
in_slice) const; in_col, const u32 in_slice) const;
arma_inline eT& operator() (const u32 in_row, const u32 in_col, const u32 arma_inline arma_warn_unused eT& operator() (const u32 in_row, const u32
in_slice); in_col, const u32 in_slice);
arma_inline eT operator() (const u32 in_row, const u32 in_col, const u32 arma_inline arma_warn_unused eT operator() (const u32 in_row, const u32
in_slice) const; 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 bool is_finite() const; arma_inline arma_warn_unused bool is_finite() const;
arma_inline bool is_empty() const; arma_inline arma_warn_unused 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 u32 i arma_inline arma_warn_unused bool in_range(const u32 in_row, const u32 in
n_slice) const; _col, const u32 in_slice) const;
arma_inline eT* memptr(); arma_inline arma_warn_unused eT* memptr();
arma_inline const eT* memptr() const; arma_inline arma_warn_unused const eT* memptr() const;
arma_inline eT* slice_memptr(const u32 slice); arma_inline arma_warn_unused eT* slice_memptr(const u32 slice);
arma_inline const eT* slice_memptr(const u32 slice) const; arma_inline arma_warn_unused const eT* slice_memptr(const u32 slice) cons
t;
arma_inline eT* slice_colptr(const u32 in_slice, const u32 in_col); arma_inline arma_warn_unused eT* slice_colptr(const u32 in_slice, c
arma_inline const eT* slice_colptr(const u32 in_slice, const u32 in_col) onst u32 in_col);
const; arma_inline arma_warn_unused const eT* slice_colptr(const u32 in_slice, c
onst u32 in_col) 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 raw_print(const std::string extra_text = "") const; inline void raw_print(const std::string extra_text = "") const;
inline void raw_print(std::ostream& user_stream, const std::string extra_ text = "") const; inline void raw_print(std::ostream& user_stream, const std::string extra_ text = "") const;
inline void set_size(const u32 in_rows, const u32 in_cols, const u32 in_ slices); inline void set_size(const u32 in_rows, const u32 in_cols, const u32 in_ slices);
inline void reshape(const u32 in_rows, const u32 in_cols, const u32 in_ slices, const u32 dim = 0); inline void reshape(const u32 in_rows, const u32 in_cols, const u32 in_ slices, const u32 dim = 0);
skipping to change at line 271 skipping to change at line 268
template<typename T1> template<typename T1>
inline fixed(const BaseCube<eT,T1>& A) { mem_setup(); Cube<eT>::operato r=(A.get_ref()); } inline fixed(const BaseCube<eT,T1>& A) { mem_setup(); Cube<eT>::operato r=(A.get_ref()); }
template<typename T1> template<typename T1>
inline const Cube& operator=(const BaseCube<eT,T1>& A) { Cube<eT>::oper ator=(A.get_ref()); return *this; } inline const Cube& operator=(const BaseCube<eT,T1>& A) { Cube<eT>::oper ator=(A.get_ref()); return *this; }
template<typename T1, typename T2> template<typename T1, typename T2>
inline explicit fixed(const BaseCube<pod_type,T1>& A, const BaseCube<po d_type,T2>& B) { mem_setup(); Cube<eT>::init(A,B); } inline explicit fixed(const BaseCube<pod_type,T1>& A, const BaseCube<po d_type,T2>& B) { mem_setup(); Cube<eT>::init(A,B); }
}; };
#ifdef ARMA_EXTRA_CUBE_PROTO
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_CUBE_PROTO)
#endif
protected: protected:
inline void init(const u32 in_rows, const u32 in_cols, const u32 in_slice s); inline void init(const u32 in_rows, const u32 in_cols, const u32 in_slice s);
inline void init(const Cube& x); inline void init(const Cube& x);
template<typename T1, typename T2> template<typename T1, typename T2>
inline void init(const BaseCube<pod_type,T1>& A, const BaseCube<pod_type, T2>& B); inline void init(const BaseCube<pod_type,T1>& A, const BaseCube<pod_type, T2>& B);
inline void steal_mem(Cube& X); inline void steal_mem(Cube& X);
inline void delete_mat(); inline void delete_mat();
inline void create_mat(); inline void create_mat();
friend class op_reshape; friend class op_reshape;
friend class glue_join; friend class glue_join;
public:
#ifdef ARMA_EXTRA_CUBE_PROTO
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_CUBE_PROTO)
#endif
}; };
class Cube_aux class Cube_aux
{ {
public: public:
template<typename eT> arma_inline static void prefix_pp(Cube<eT>& x); template<typename eT> arma_inline static void prefix_pp(Cube<eT>& x);
template<typename T> arma_inline static void prefix_pp(Cube< std::comple x<T> >& x); template<typename T> arma_inline static void prefix_pp(Cube< std::comple x<T> >& x);
template<typename eT> arma_inline static void postfix_pp(Cube<eT>& x); template<typename eT> arma_inline static void postfix_pp(Cube<eT>& x);
 End of changes. 9 change blocks. 
34 lines changed or deleted 35 lines changed or added


 GlueCube_meat.hpp   GlueCube_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 GlueCube_proto.hpp   GlueCube_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 Glue_meat.hpp   Glue_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 Glue_proto.hpp   Glue_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 Mat_meat.hpp   Mat_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 585 skipping to change at line 582
inline inline
Mat<eT>::Mat(const char junk, const eT* aux_mem, const u32 aux_n_rows, cons t u32 aux_n_cols) Mat<eT>::Mat(const char junk, const eT* aux_mem, const u32 aux_n_rows, cons t u32 aux_n_cols)
: n_rows (aux_n_rows ) : n_rows (aux_n_rows )
, n_cols (aux_n_cols ) , n_cols (aux_n_cols )
, n_elem (aux_n_rows*aux_n_cols) , n_elem (aux_n_rows*aux_n_cols)
, vec_state(0 ) , vec_state(0 )
, mem_state(3 ) , mem_state(3 )
, mem (aux_mem ) , mem (aux_mem )
{ {
arma_extra_debug_sigprint_this(this); arma_extra_debug_sigprint_this(this);
arma_ignore(junk);
} }
//! in-place matrix addition //! in-place matrix addition
template<typename eT> template<typename eT>
inline inline
const Mat<eT>& const Mat<eT>&
Mat<eT>::operator+=(const Mat<eT>& m) Mat<eT>::operator+=(const Mat<eT>& m)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
skipping to change at line 1036 skipping to change at line 1034
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);
} }
//! create a Col object which uses memory from an existing matrix object.
//! this approach is currently not alias safe
//! 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,
//! it will cause memory corruption and/or a crash
template<typename eT>
inline
Col<eT>
Mat<eT>::unsafe_col(const u32 col_num)
{
arma_extra_debug_sigprint();
arma_debug_check( col_num >= n_cols, "Mat::unsafe_col(): out of bounds");
return Col<eT>(colptr(col_num), n_rows, false, true);
}
//! create a Col object which uses memory from an existing matrix object.
//! this approach is currently not alias safe
//! 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,
//! it will cause memory corruption and/or a crash
template<typename eT>
inline
const Col<eT>
Mat<eT>::unsafe_col(const u32 col_num) const
{
arma_extra_debug_sigprint();
arma_debug_check( col_num >= n_cols, "Mat::unsafe_col(): out of bounds");
return Col<eT>(const_cast<eT*>(colptr(col_num)), n_rows, false, true);
}
//! creation of subview (submatrix comprised of specified row vectors) //! creation of subview (submatrix comprised of specified row vectors)
template<typename eT> template<typename eT>
arma_inline arma_inline
subview<eT> subview<eT>
Mat<eT>::rows(const u32 in_row1, const u32 in_row2) Mat<eT>::rows(const u32 in_row1, const u32 in_row2)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check arma_debug_check
( (
skipping to change at line 2243 skipping to change at line 2275
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const Mat<eT> m(X); const Mat<eT> m(X);
return (*this).operator/=(m); return (*this).operator/=(m);
} }
//! linear element accessor (treats the matrix as a vector); bounds checkin g not done when ARMA_NO_DEBUG is defined //! linear element accessor (treats the matrix as a vector); bounds checkin g not done when ARMA_NO_DEBUG is defined
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
eT& eT&
Mat<eT>::operator() (const u32 i) Mat<eT>::operator() (const u32 i)
{ {
arma_debug_check( (i >= n_elem), "Mat::operator(): out of bounds"); arma_debug_check( (i >= n_elem), "Mat::operator(): out of bounds");
return access::rw(mem[i]); return access::rw(mem[i]);
} }
//! linear element accessor (treats the matrix as a vector); bounds checkin g not done when ARMA_NO_DEBUG is defined //! linear element accessor (treats the matrix as a vector); bounds checkin g not done when ARMA_NO_DEBUG is defined
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
eT eT
Mat<eT>::operator() (const u32 i) const Mat<eT>::operator() (const u32 i) const
{ {
arma_debug_check( (i >= n_elem), "Mat::operator(): out of bounds"); arma_debug_check( (i >= n_elem), "Mat::operator(): out of bounds");
return mem[i]; return mem[i];
} }
//! 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
eT& eT&
Mat<eT>::operator[] (const u32 i) Mat<eT>::operator[] (const u32 i)
{ {
return access::rw(mem[i]); return access::rw(mem[i]);
} }
//! 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
eT eT
Mat<eT>::operator[] (const u32 i) const Mat<eT>::operator[] (const u32 i) const
{ {
return mem[i]; 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
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]);
} }
//! 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
eT eT
Mat<eT>::operator() (const u32 in_row, const u32 in_col) const Mat<eT>::operator() (const u32 in_row, const u32 in_col) const
{ {
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 mem[in_row + in_col*n_rows]; return mem[in_row + in_col*n_rows];
} }
//! element accessor; no bounds check //! element accessor; no bounds check
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
eT& eT&
Mat<eT>::at(const u32 in_row, const u32 in_col) Mat<eT>::at(const u32 in_row, const u32 in_col)
{ {
return access::rw( mem[in_row + in_col*n_rows] ); return access::rw( mem[in_row + in_col*n_rows] );
} }
//! element accessor; no bounds check //! element accessor; no bounds check
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
eT eT
Mat<eT>::at(const u32 in_row, const u32 in_col) const Mat<eT>::at(const u32 in_row, const u32 in_col) const
{ {
return mem[in_row + in_col*n_rows]; return mem[in_row + in_col*n_rows];
} }
//! prefix ++ //! prefix ++
template<typename eT> template<typename eT>
arma_inline arma_inline
const Mat<eT>& const Mat<eT>&
skipping to change at line 2357 skipping to change at line 2397
arma_inline arma_inline
void void
Mat<eT>::operator--(int) Mat<eT>::operator--(int)
{ {
Mat_aux::postfix_mm(*this); Mat_aux::postfix_mm(*this);
} }
//! returns true if the object can be interpreted as a column or row vector //! returns true if the object can be interpreted as a column or row vector
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
bool bool
Mat<eT>::is_vec() const Mat<eT>::is_vec() const
{ {
return ( (n_rows == 1) || (n_cols == 1) ); return ( (n_rows == 1) || (n_cols == 1) );
} }
//! returns true if the object has the same number of non-zero rows and col umnns //! returns true if the object has the same number of non-zero rows and col umnns
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
bool bool
Mat<eT>::is_square() const Mat<eT>::is_square() const
{ {
return ( (n_rows == n_cols) && (n_elem > 0) ); return ( (n_rows == n_cols) && (n_elem > 0) );
} }
//! returns true if all of the elements are finite //! returns true if all of the elements are finite
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
bool bool
Mat<eT>::is_finite() const Mat<eT>::is_finite() const
{ {
for(u32 i=0; i<n_elem; ++i) const u32 N = n_elem;
const eT* ptr = memptr();
u32 i,j;
for(i=0, j=1; j<N; i+=2, j+=2)
{
const eT ptr_i = ptr[i];
const eT ptr_j = ptr[j];
if( (arma_isfinite(ptr_i) == false) || (arma_isfinite(ptr_j) == false))
{
return false;
}
}
if(i<N)
{ {
if(arma_isfinite(mem[i]) == false) if(arma_isfinite(ptr[i]) == false)
{ {
return false; return false;
} }
} }
return true; return true;
} }
//! returns true if the matrix has no elements //! returns true if the matrix has no elements
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
bool bool
Mat<eT>::is_empty() const Mat<eT>::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 eT> template<typename eT>
arma_inline arma_inline
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 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
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) );
} }
//! 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
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]);
} }
//! 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
const eT* const eT*
Mat<eT>::colptr(const u32 in_col) const Mat<eT>::colptr(const u32 in_col) const
{ {
return & mem[in_col*n_rows]; return & mem[in_col*n_rows];
} }
//! returns a pointer to array of eTs used by the matrix //! returns a pointer to array of eTs used by the matrix
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
eT* eT*
Mat<eT>::memptr() Mat<eT>::memptr()
{ {
return const_cast<eT*>(mem); return const_cast<eT*>(mem);
} }
//! returns a pointer to array of eTs used by the matrix //! returns a pointer to array of eTs used by the matrix
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused
const eT* const eT*
Mat<eT>::memptr() const Mat<eT>::memptr() const
{ {
return mem; return mem;
} }
//! print contents of the matrix (to the cout stream), //! print contents of the matrix (to the cout stream),
//! optionally preceding with a user specified line of text. //! optionally preceding with a user specified line of text.
//! the precision and cell width are modified. //! the precision and cell width are modified.
//! on return, the stream's state are restored to their original values. //! on return, the stream's state are restored to their original values.
 End of changes. 23 change blocks. 
7 lines changed or deleted 75 lines changed or added


 Mat_proto.hpp   Mat_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 117 skipping to change at line 114
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_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;
inline Col<eT> unsafe_col(const u32 col_num);
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 l_span); arma_inline subview<eT> submat(const span& row_span, const span& co l_span);
skipping to change at line 198 skipping to change at line 198
template<typename T1, typename T2, typename eglue_type> inline const Mat& operator/=(const eGlue<T1, T2, eglue_type>& X); template<typename T1, typename T2, typename eglue_type> inline const Mat& operator/=(const eGlue<T1, T2, eglue_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 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 eT& operator[] (const u32 i); arma_inline arma_warn_unused eT& operator[] (const u32 i);
arma_inline eT operator[] (const u32 i) const; arma_inline arma_warn_unused eT operator[] (const u32 i) const;
arma_inline eT& operator() (const u32 i); arma_inline arma_warn_unused eT& operator() (const u32 i);
arma_inline eT operator() (const u32 i) const; arma_inline arma_warn_unused eT operator() (const u32 i) const;
arma_inline eT& at (const u32 in_row, const u32 in_col); arma_inline arma_warn_unused eT& at (const u32 in_row, const u32
arma_inline eT at (const u32 in_row, const u32 in_col) const; in_col);
arma_inline eT& operator() (const u32 in_row, const u32 in_col); arma_inline arma_warn_unused eT at (const u32 in_row, const u32
arma_inline eT operator() (const u32 in_row, const u32 in_col) const; 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) 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 bool is_vec() const; arma_inline arma_warn_unused bool is_vec() const;
arma_inline bool is_square() const; arma_inline arma_warn_unused bool is_square() const;
arma_inline bool is_finite() const; arma_inline arma_warn_unused bool is_finite() const;
arma_inline bool is_empty() const; arma_inline arma_warn_unused 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 u32 in_row, const u32 in
_col) const;
arma_inline eT* colptr(const u32 in_col); arma_inline arma_warn_unused eT* colptr(const u32 in_col);
arma_inline const eT* colptr(const u32 in_col) const; arma_inline arma_warn_unused const eT* colptr(const u32 in_col) const;
arma_inline eT* memptr(); arma_inline arma_warn_unused eT* memptr();
arma_inline 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;
inline void print_trans(const std::string extra_text = "") const; inline void print_trans(const std::string extra_text = "") const;
inline void print_trans(std::ostream& user_stream, const std::string extr a_text = "") const; inline void print_trans(std::ostream& user_stream, const std::string extr a_text = "") const;
inline void raw_print(const std::string extra_text = "") const; inline void raw_print(const std::string extra_text = "") const;
inline void raw_print(std::ostream& user_stream, const std::string extra_ text = "") const; inline void raw_print(std::ostream& user_stream, const std::string extra_ text = "") const;
skipping to change at line 396 skipping to change at line 396
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); }
}; };
#ifdef ARMA_EXTRA_MAT_PROTO
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_MAT_PROTO)
#endif
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);
inline void steal_mem(Mat& X); inline void steal_mem(Mat& X);
inline Mat(const char junk, const eT* aux_mem, const u32 aux_n_rows, cons t u32 aux_n_cols); inline Mat(const char junk, const eT* aux_mem, const u32 aux_n_rows, cons t u32 aux_n_cols);
friend class Cube<eT>; friend class Cube<eT>;
friend class glue_join; friend class glue_join;
public:
#ifdef ARMA_EXTRA_MAT_PROTO
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_MAT_PROTO)
#endif
}; };
class Mat_aux class Mat_aux
{ {
public: public:
template<typename eT> arma_inline static void prefix_pp(Mat<eT>& x); template<typename eT> arma_inline static void prefix_pp(Mat<eT>& x);
template<typename T> arma_inline static void prefix_pp(Mat< std::complex <T> >& x); template<typename T> arma_inline static void prefix_pp(Mat< std::complex <T> >& x);
template<typename eT> arma_inline static void postfix_pp(Mat<eT>& x); template<typename eT> arma_inline static void postfix_pp(Mat<eT>& x);
 End of changes. 9 change blocks. 
28 lines changed or deleted 35 lines changed or added


 OpCube_meat.hpp   OpCube_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 OpCube_proto.hpp   OpCube_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 Op_meat.hpp   Op_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 Op_proto.hpp   Op_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 Proxy.hpp   Proxy.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 ProxyCube.hpp   ProxyCube.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 Row_meat.hpp   Row_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 Row_proto.hpp   Row_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 access.hpp   access.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 arma_config.hpp   arma_config.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 arma_ostream_meat.hpp   arma_ostream_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 115 skipping to change at line 112
return cell_width; return cell_width;
} }
//! "better than nothing" settings for complex numbers //! "better than nothing" settings for complex numbers
template<typename T> template<typename T>
inline inline
u32 u32
arma_ostream::modify_stream(std::ostream& o, const std::complex<T>* data, c onst u32 n_elem) arma_ostream::modify_stream(std::ostream& o, const std::complex<T>* data, c onst u32 n_elem)
{ {
arma_ignore(data);
arma_ignore(n_elem);
o.unsetf(ios::showbase); o.unsetf(ios::showbase);
o.unsetf(ios::uppercase); o.unsetf(ios::uppercase);
o.fill(' '); o.fill(' ');
o.setf(ios::scientific); o.setf(ios::scientific);
o.setf(ios::showpos); o.setf(ios::showpos);
o.setf(ios::right); o.setf(ios::right);
o.unsetf(ios::fixed); o.unsetf(ios::fixed);
u32 cell_width; u32 cell_width;
 End of changes. 2 change blocks. 
5 lines changed or deleted 5 lines changed or added


 arma_ostream_proto.hpp   arma_ostream_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 arma_static_assert.hpp   arma_static_assert.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 arma_version.hpp   arma_version.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// This file is part of the Armadillo C++ library. // This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup arma_version //! \addtogroup arma_version
//! @{ //! @{
#define ARMA_VERSION_MAJOR 0 #define ARMA_VERSION_MAJOR 0
#define ARMA_VERSION_MINOR 9 #define ARMA_VERSION_MINOR 9
#define ARMA_VERSION_PATCH 80 #define ARMA_VERSION_PATCH 90
#define ARMA_VERSION_NAME "Chihuahua Muncher" #define ARMA_VERSION_NAME "Water Dragon"
// http://www.brisbanetimes.com.au/environment/leaping-sharks-are-no-bull-2 // http://en.wikipedia.org/wiki/Australian_Water_Dragon
0100906-14wyq.html
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. 2 change blocks. 
9 lines changed or deleted 5 lines changed or added


 armadillo   armadillo 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 117 skipping to change at line 114
#include "armadillo_bits/traits.hpp" #include "armadillo_bits/traits.hpp"
#include "armadillo_bits/promote_type.hpp" #include "armadillo_bits/promote_type.hpp"
#include "armadillo_bits/upgrade_val.hpp" #include "armadillo_bits/upgrade_val.hpp"
#include "armadillo_bits/restrictors.hpp" #include "armadillo_bits/restrictors.hpp"
#include "armadillo_bits/access.hpp" #include "armadillo_bits/access.hpp"
#include "armadillo_bits/span.hpp" #include "armadillo_bits/span.hpp"
// //
// class prototypes // class prototypes
#include "armadillo_bits/Base.hpp"
#include "armadillo_bits/BaseCube.hpp"
#include "armadillo_bits/syslib_proto.hpp" #include "armadillo_bits/syslib_proto.hpp"
#include "armadillo_bits/arrayops_proto.hpp" #include "armadillo_bits/arrayops_proto.hpp"
#include "armadillo_bits/podarray_proto.hpp" #include "armadillo_bits/podarray_proto.hpp"
#include "armadillo_bits/blas_proto.hpp" #include "armadillo_bits/blas_proto.hpp"
#include "armadillo_bits/lapack_proto.hpp" #include "armadillo_bits/lapack_proto.hpp"
#include "armadillo_bits/atlas_proto.hpp" #include "armadillo_bits/atlas_proto.hpp"
#include "armadillo_bits/auxlib_proto.hpp" #include "armadillo_bits/auxlib_proto.hpp"
#include "armadillo_bits/Base.hpp"
#include "armadillo_bits/BaseCube.hpp"
#include "armadillo_bits/injector_proto.hpp" #include "armadillo_bits/injector_proto.hpp"
#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"
 End of changes. 3 change blocks. 
8 lines changed or deleted 5 lines changed or added


 arrayops_proto.hpp   arrayops_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 atlas_proto.hpp   atlas_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 auxlib_meat.hpp   auxlib_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
// // Copyright (C) 2009 Edmund Highcock
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Edmund Highcock (edmund dot highcock at merton dot ox dot ac dot uk)
// //
// This file is part of the Armadillo C++ library. // This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup auxlib //! \addtogroup auxlib
//! @{ //! @{
//! immediate matrix inverse //! immediate matrix inverse
template<typename eT, typename T1>
inline
bool
auxlib::inv(Mat<eT>& out, const Base<eT,T1>& X)
{
arma_extra_debug_sigprint();
bool status;
out = X.get_ref();
arma_debug_check( (out.is_square() == false), "inv(): given matrix is not
square" );
const u32 N = out.n_rows;
if(N <= 4)
{
status = auxlib::inv_inplace_tinymat(out, N);
}
if( (N > 4) || (status == false) )
{
status = auxlib::inv_inplace_lapack(out);
}
if(status == false)
{
arma_print("inv(): matrix appears to be singular" );
out.reset();
}
return status;
}
template<typename eT> template<typename eT>
inline inline
bool bool
auxlib::inv(Mat<eT>& out, const Mat<eT>& X) auxlib::inv(Mat<eT>& out, const Mat<eT>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_check( (X.is_square() == false), "inv(): given matrix is not s
quare" );
bool status;
const u32 N = X.n_rows; const u32 N = X.n_rows;
if(N <= 4) if(N <= 4)
{ {
const bool status = (&out != &X) ? auxlib::inv_noalias_tinymat(out, X, status = (&out != &X) ? auxlib::inv_noalias_tinymat(out, X, N) : auxlib
N) : auxlib::inv_inplace_tinymat(out, N); ::inv_inplace_tinymat(out, N);
}
return (status == true) ? true : auxlib::inv_lapack(out, X); if( (N > 4) || (status == false) )
{
out = X;
status = auxlib::inv_inplace_lapack(out);
} }
else
if(status == false)
{ {
return auxlib::inv_lapack(out, X); arma_print("inv(): matrix appears to be singular" );
out.reset();
} }
return status;
} }
template<typename eT> template<typename eT>
inline inline
bool bool
auxlib::inv_noalias_tinymat(Mat<eT>& out, const Mat<eT>& X, const u32 N) auxlib::inv_noalias_tinymat(Mat<eT>& out, const Mat<eT>& X, const u32 N)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
bool det_ok = true; bool det_ok = true;
skipping to change at line 299 skipping to change at line 342
default: default:
; ;
} }
return det_ok; return det_ok;
} }
template<typename eT> template<typename eT>
inline inline
bool bool
auxlib::inv_lapack(Mat<eT>& out, const Mat<eT>& X) auxlib::inv_inplace_lapack(Mat<eT>& out)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
if(&out != &X)
{
out = X;
}
#if defined(ARMA_USE_ATLAS) #if defined(ARMA_USE_ATLAS)
{ {
podarray<int> ipiv(out.n_rows); podarray<int> ipiv(out.n_rows);
int info = atlas::clapack_getrf(atlas::CblasColMajor, out.n_rows, out.n _cols, out.memptr(), out.n_rows, ipiv.memptr()); int info = atlas::clapack_getrf(atlas::CblasColMajor, out.n_rows, out.n _cols, out.memptr(), out.n_rows, ipiv.memptr());
if(info == 0) if(info == 0)
{ {
info = atlas::clapack_getri(atlas::CblasColMajor, out.n_rows, out.mem ptr(), out.n_rows, ipiv.memptr()); info = atlas::clapack_getri(atlas::CblasColMajor, out.n_rows, out.mem ptr(), out.n_rows, ipiv.memptr());
} }
skipping to change at line 335 skipping to change at line 373
blas_int info = 0; blas_int info = 0;
podarray<blas_int> ipiv(out.n_rows); podarray<blas_int> ipiv(out.n_rows);
// 84 was empirically found -- it is the maximum value suggested by LAP ACK (as provided by ATLAS v3.6) // 84 was empirically found -- it is the maximum value suggested by LAP ACK (as provided by ATLAS v3.6)
// based on tests with various matrix types on 32-bit and 64-bit machin es // based on tests with various matrix types on 32-bit and 64-bit machin es
// //
// the "work" array is deliberately long so that a secondary (time-cons uming) // the "work" array is deliberately long so that a secondary (time-cons uming)
// memory allocation is avoided, if possible // memory allocation is avoided, if possible
blas_int work_len = (std::max)(1, n_rows*84); blas_int work_len = (std::max)(blas_int(1), n_rows*84);
podarray<eT> work(work_len); podarray<eT> work(work_len);
lapack::getrf_(&n_rows, &n_cols, out.memptr(), &n_rows, ipiv.memptr(), &info); lapack::getrf(&n_rows, &n_cols, out.memptr(), &n_rows, ipiv.memptr(), & info);
if(info == 0) if(info == 0)
{ {
// query for optimum size of work_len // query for optimum size of work_len
blas_int work_len_tmp = -1; blas_int work_len_tmp = -1;
lapack::getri_(&n_rows, out.memptr(), &n_rows, ipiv.memptr(), work.me mptr(), &work_len_tmp, &info); lapack::getri(&n_rows, out.memptr(), &n_rows, ipiv.memptr(), work.mem ptr(), &work_len_tmp, &info);
if(info == 0) if(info == 0)
{ {
blas_int proposed_work_len = static_cast<blas_int>(access::tmp_real (work[0])); blas_int proposed_work_len = static_cast<blas_int>(access::tmp_real (work[0]));
// if necessary, allocate more memory // if necessary, allocate more memory
if(work_len < proposed_work_len) if(work_len < proposed_work_len)
{ {
work_len = proposed_work_len; work_len = proposed_work_len;
work.set_size(work_len); work.set_size(work_len);
} }
} }
lapack::getri_(&n_rows, out.memptr(), &n_rows, ipiv.memptr(), work.me mptr(), &work_len, &info); lapack::getri(&n_rows, out.memptr(), &n_rows, ipiv.memptr(), work.mem ptr(), &work_len, &info);
} }
return (info == 0); return (info == 0);
} }
#else #else
{ {
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> template<typename eT, typename T1>
inline inline
eT eT
auxlib::det(const Mat<eT>& X) auxlib::det(const Base<eT,T1>& X)
{ {
const u32 N = X.n_rows; const unwrap<T1> tmp(X.get_ref());
const Mat<eT>& A = tmp.M;
arma_debug_check( !A.is_square(), "det(): matrix is not square" );
const bool make_copy = (is_Mat<T1>::value == true) ? true : false;
const u32 N = A.n_rows;
switch(N) switch(N)
{ {
case 0: case 0:
case 1: case 1:
case 2: case 2:
return auxlib::det_tinymat(X, N); return auxlib::det_tinymat(A, N);
break; break;
case 3: case 3:
case 4: case 4:
{ {
const eT tmp_det = auxlib::det_tinymat(X, N); const eT tmp_det = auxlib::det_tinymat(A, N);
return (tmp_det != eT(0)) ? tmp_det : auxlib::det_lapack(X); return (tmp_det != eT(0)) ? tmp_det : auxlib::det_lapack(A, make_copy
);
} }
break; break;
default: default:
return auxlib::det_lapack(X); return auxlib::det_lapack(A, make_copy);
} }
return eT(0); // prevent compiler warnings
} }
template<typename eT> template<typename eT>
inline inline
eT eT
auxlib::det_tinymat(const Mat<eT>& X, const u32 N) auxlib::det_tinymat(const Mat<eT>& X, const u32 N)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
switch(N) switch(N)
skipping to change at line 488 skipping to change at line 536
default: default:
return eT(0); return eT(0);
; ;
} }
} }
//! immediate determinant of a matrix using ATLAS or LAPACK //! immediate determinant of a matrix using ATLAS or LAPACK
template<typename eT> template<typename eT>
inline inline
eT eT
auxlib::det_lapack(const Mat<eT>& X) auxlib::det_lapack(const Mat<eT>& X, const bool make_copy)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
Mat<eT> X_copy;
if(make_copy == true)
{
X_copy = X;
}
Mat<eT>& tmp = (make_copy == true) ? X_copy : const_cast< Mat<eT>& >(X);
#if defined(ARMA_USE_ATLAS) #if defined(ARMA_USE_ATLAS)
{ {
Mat<eT> tmp = X;
podarray<int> ipiv(tmp.n_rows); podarray<int> ipiv(tmp.n_rows);
atlas::clapack_getrf(atlas::CblasColMajor, tmp.n_rows, tmp.n_cols, tmp. memptr(), tmp.n_rows, ipiv.memptr()); atlas::clapack_getrf(atlas::CblasColMajor, tmp.n_rows, tmp.n_cols, tmp. memptr(), tmp.n_rows, ipiv.memptr());
// on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero // on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero
eT val = tmp.at(0,0); eT val = tmp.at(0,0);
for(u32 i=1; i < tmp.n_rows; ++i) for(u32 i=1; i < tmp.n_rows; ++i)
{ {
val *= tmp.at(i,i); val *= tmp.at(i,i);
} }
skipping to change at line 519 skipping to change at line 575
if( int(i) != ipiv.mem[i] ) // NOTE: no adjustment required, as the clapack version of getrf() assumes counting from 0 if( int(i) != ipiv.mem[i] ) // NOTE: no adjustment required, as the clapack version of getrf() assumes counting from 0
{ {
sign *= -1; sign *= -1;
} }
} }
return ( (sign < 0) ? -val : val ); return ( (sign < 0) ? -val : val );
} }
#elif defined(ARMA_USE_LAPACK) #elif defined(ARMA_USE_LAPACK)
{ {
Mat<eT> tmp = X;
podarray<blas_int> ipiv(tmp.n_rows); podarray<blas_int> ipiv(tmp.n_rows);
blas_int info = 0; blas_int info = 0;
blas_int n_rows = blas_int(tmp.n_rows); blas_int n_rows = blas_int(tmp.n_rows);
blas_int n_cols = blas_int(tmp.n_cols); blas_int n_cols = blas_int(tmp.n_cols);
lapack::getrf_(&n_rows, &n_cols, tmp.memptr(), &n_rows, ipiv.memptr(), &info); lapack::getrf(&n_rows, &n_cols, tmp.memptr(), &n_rows, ipiv.memptr(), & info);
// on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero // on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero
eT val = tmp.at(0,0); eT val = tmp.at(0,0);
for(u32 i=1; i < tmp.n_rows; ++i) for(u32 i=1; i < tmp.n_rows; ++i)
{ {
val *= tmp.at(i,i); val *= tmp.at(i,i);
} }
blas_int sign = +1; blas_int sign = +1;
for(u32 i=0; i < tmp.n_rows; ++i) for(u32 i=0; i < tmp.n_rows; ++i)
skipping to change at line 548 skipping to change at line 603
if( blas_int(i) != (ipiv.mem[i] - 1) ) // NOTE: adjustment of -1 is required as Fortran counts from 1 if( blas_int(i) != (ipiv.mem[i] - 1) ) // NOTE: adjustment of -1 is required as Fortran counts from 1
{ {
sign *= -1; sign *= -1;
} }
} }
return ( (sign < 0) ? -val : val ); return ( (sign < 0) ? -val : val );
} }
#else #else
{ {
arma_ignore(X);
arma_ignore(make_copy);
arma_ignore(tmp);
arma_stop("det(): need ATLAS or LAPACK"); arma_stop("det(): need ATLAS or LAPACK");
return eT(0); return eT(0);
} }
#endif #endif
} }
//! immediate log determinant of a matrix using ATLAS or LAPACK //! immediate log determinant of a matrix using ATLAS or LAPACK
template<typename eT> template<typename eT, typename T1>
inline inline
void void
auxlib::log_det(eT& out_val, typename get_pod_type<eT>::result& out_sign, c onst Mat<eT>& X) auxlib::log_det(eT& out_val, typename get_pod_type<eT>::result& out_sign, c onst Base<eT,T1>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename get_pod_type<eT>::result T; typedef typename get_pod_type<eT>::result T;
#if defined(ARMA_USE_ATLAS) #if defined(ARMA_USE_ATLAS)
{ {
Mat<eT> tmp = X; Mat<eT> tmp(X.get_ref());
arma_debug_check( (tmp.is_square() == false), "log_det(): given matrix
is not square" );
podarray<int> ipiv(tmp.n_rows); podarray<int> ipiv(tmp.n_rows);
atlas::clapack_getrf(atlas::CblasColMajor, tmp.n_rows, tmp.n_cols, tmp. memptr(), tmp.n_rows, ipiv.memptr()); atlas::clapack_getrf(atlas::CblasColMajor, tmp.n_rows, tmp.n_cols, tmp. memptr(), tmp.n_rows, ipiv.memptr());
// on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero // on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero
s32 sign = (is_complex<eT>::value == false) ? ( (access::tmp_real( tmp. at(0,0) ) < T(0)) ? -1 : +1 ) : +1; s32 sign = (is_complex<eT>::value == false) ? ( (access::tmp_real( tmp. at(0,0) ) < T(0)) ? -1 : +1 ) : +1;
eT val = (is_complex<eT>::value == false) ? std::log( (access::tmp_re al( tmp.at(0,0) ) < T(0)) ? tmp.at(0,0)*T(-1) : tmp.at(0,0) ) : std::log( t mp.at(0,0) ); eT val = (is_complex<eT>::value == false) ? std::log( (access::tmp_re al( tmp.at(0,0) ) < T(0)) ? tmp.at(0,0)*T(-1) : tmp.at(0,0) ) : std::log( t mp.at(0,0) );
for(u32 i=1; i < tmp.n_rows; ++i) for(u32 i=1; i < tmp.n_rows; ++i)
skipping to change at line 597 skipping to change at line 657
{ {
sign *= -1; sign *= -1;
} }
} }
out_val = val; out_val = val;
out_sign = T(sign); out_sign = T(sign);
} }
#elif defined(ARMA_USE_LAPACK) #elif defined(ARMA_USE_LAPACK)
{ {
Mat<eT> tmp = X; Mat<eT> tmp(X.get_ref());
arma_debug_check( (tmp.is_square() == false), "log_det(): given matrix
is not square" );
podarray<blas_int> ipiv(tmp.n_rows); podarray<blas_int> ipiv(tmp.n_rows);
blas_int info = 0; blas_int info = 0;
blas_int n_rows = blas_int(tmp.n_rows); blas_int n_rows = blas_int(tmp.n_rows);
blas_int n_cols = blas_int(tmp.n_cols); blas_int n_cols = blas_int(tmp.n_cols);
lapack::getrf_(&n_rows, &n_cols, tmp.memptr(), &n_rows, ipiv.memptr(), &info); lapack::getrf(&n_rows, &n_cols, tmp.memptr(), &n_rows, ipiv.memptr(), & info);
// on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero // on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero
s32 sign = (is_complex<eT>::value == false) ? ( (access::tmp_real( tmp. at(0,0) ) < T(0)) ? -1 : +1 ) : +1; s32 sign = (is_complex<eT>::value == false) ? ( (access::tmp_real( tmp. at(0,0) ) < T(0)) ? -1 : +1 ) : +1;
eT val = (is_complex<eT>::value == false) ? std::log( (access::tmp_re al( tmp.at(0,0) ) < T(0)) ? tmp.at(0,0)*T(-1) : tmp.at(0,0) ) : std::log( t mp.at(0,0) ); eT val = (is_complex<eT>::value == false) ? std::log( (access::tmp_re al( tmp.at(0,0) ) < T(0)) ? tmp.at(0,0)*T(-1) : tmp.at(0,0) ) : std::log( t mp.at(0,0) );
for(u32 i=1; i < tmp.n_rows; ++i) for(u32 i=1; i < tmp.n_rows; ++i)
{ {
const eT x = tmp.at(i,i); const eT x = tmp.at(i,i);
skipping to change at line 641 skipping to change at line 703
{ {
arma_stop("log_det(): need ATLAS or LAPACK"); arma_stop("log_det(): need ATLAS or LAPACK");
out_val = eT(0); out_val = eT(0);
out_sign = T(0); out_sign = T(0);
} }
#endif #endif
} }
//! immediate LU decomposition of a matrix using ATLAS or LAPACK //! immediate LU decomposition of a matrix using ATLAS or LAPACK
template<typename eT> template<typename eT, typename T1>
inline inline
void void
auxlib::lu(Mat<eT>& L, Mat<eT>& U, podarray<blas_int>& ipiv, const Mat<eT>& X) auxlib::lu(Mat<eT>& L, Mat<eT>& U, podarray<blas_int>& ipiv, const Base<eT, T1>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
U = X; U = X.get_ref();
#if defined(ARMA_USE_ATLAS) || defined(ARMA_USE_LAPACK) if(U.is_empty())
{ {
ipiv.reset();
L.reset();
return;
}
const u32 U_n_rows = U.n_rows;
const u32 U_n_cols = U.n_cols;
#if defined(ARMA_USE_ATLAS) || defined(ARMA_USE_LAPACK)
{
#if defined(ARMA_USE_ATLAS) #if defined(ARMA_USE_ATLAS)
{ {
ipiv.set_size(U.n_rows); ipiv.set_size( (std::min)(U_n_rows, U_n_cols) );
//int info = //int info =
atlas::clapack_getrf(atlas::CblasColMajor, U.n_rows, U.n_cols, U.memp tr(), U.n_rows, ipiv.memptr()); atlas::clapack_getrf(atlas::CblasColMajor, U_n_rows, U_n_cols, U.memp tr(), U_n_rows, ipiv.memptr());
} }
#elif defined(ARMA_USE_LAPACK) #elif defined(ARMA_USE_LAPACK)
{ {
ipiv.set_size(U.n_rows); ipiv.set_size( (std::min)(U_n_rows, U_n_cols) );
blas_int info = 0; blas_int info = 0;
blas_int n_rows = U.n_rows; blas_int n_rows = U_n_rows;
blas_int n_cols = U.n_cols; blas_int n_cols = U_n_cols;
lapack::getrf_(&n_rows, &n_cols, U.memptr(), &n_rows, ipiv.memptr(), &info); lapack::getrf(&n_rows, &n_cols, U.memptr(), &n_rows, ipiv.memptr(), & info);
// take into account that Fortran counts from 1 // take into account that Fortran counts from 1
for(u32 i=0; i<U.n_rows; ++i) arrayops::inplace_minus(ipiv.memptr(), blas_int(1), ipiv.n_elem);
{
ipiv[i] -= 1;
}
} }
#endif #endif
L.set_size(U.n_rows, U.n_rows); L.copy_size(U);
for(u32 col=0; col<L.n_cols; ++col) for(u32 col=0; col < U_n_cols; ++col)
{ {
for(u32 row=0; (row < col) && (row < U_n_rows); ++row)
for(u32 row=0; row<col; ++row)
{ {
L.at(row,col) = eT(0); L.at(row,col) = eT(0);
} }
L.at(col,col) = eT(1); if( L.in_range(col,col) == true )
{
L.at(col,col) = eT(1);
}
for(u32 row=col+1; row<L.n_rows; ++row) for(u32 row = (col+1); row < U_n_rows; ++row)
{ {
L.at(row,col) = U.at(row,col); L.at(row,col) = U.at(row,col);
U.at(row,col) = eT(0); U.at(row,col) = eT(0);
} }
} }
} }
#else #else
{ {
arma_ignore(L);
arma_ignore(ipiv);
arma_ignore(U_n_rows);
arma_ignore(U_n_cols);
arma_stop("lu(): need ATLAS or LAPACK"); arma_stop("lu(): need ATLAS or LAPACK");
} }
#endif #endif
} }
template<typename eT> template<typename eT, typename T1>
inline inline
void void
auxlib::lu(Mat<eT>& L, Mat<eT>& U, Mat<eT>& P, const Mat<eT>& X) auxlib::lu(Mat<eT>& L, Mat<eT>& U, Mat<eT>& P, const Base<eT,T1>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
podarray<blas_int> ipiv; podarray<blas_int> ipiv1;
auxlib::lu(L, U, ipiv, X); auxlib::lu(L, U, ipiv1, X);
const u32 n = ipiv1.n_elem;
const u32 P_rows = U.n_rows;
const u32 n = ipiv.n_elem; podarray<blas_int> ipiv2(P_rows);
Mat<u32> P_tmp(n,n); const blas_int* ipiv1_mem = ipiv1.memptr();
Mat<u32> ident = eye< Mat<u32> >(n,n); blas_int* ipiv2_mem = ipiv2.memptr();
for(u32 i=n; i>0; --i) for(u32 i=0; i<P_rows; ++i)
{ {
const u32 j = i-1; ipiv2_mem[i] = i;
const u32 k = ipiv[j]; }
ident.swap_rows(j,k); for(u32 i=0; i<n; ++i)
{
const u32 k = ipiv1_mem[i];
if(i == n) if( ipiv2_mem[i] != ipiv2_mem[k] )
{
P_tmp = ident;
}
else
{ {
P_tmp *= ident; std::swap( ipiv2_mem[i], ipiv2_mem[k] );
} }
}
ident.swap_rows(j,k); P.zeros(P_rows, P_rows);
for(u32 row=0; row<P_rows; ++row)
{
P.at(row, ipiv2_mem[row]) = eT(1);
}
if(L.n_cols > U.n_rows)
{
L.shed_cols(U.n_rows, L.n_cols-1);
} }
P = conv_to< Mat<eT> >::from(P_tmp); if(U.n_rows > L.n_cols)
{
U.shed_rows(L.n_cols, U.n_rows-1);
}
} }
template<typename eT> template<typename eT, typename T1>
inline inline
void void
auxlib::lu(Mat<eT>& L, Mat<eT>& U, const Mat<eT>& X) auxlib::lu(Mat<eT>& L, Mat<eT>& U, const Base<eT,T1>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
podarray<blas_int> ipiv; podarray<blas_int> ipiv1;
auxlib::lu(L, U, ipiv, X); auxlib::lu(L, U, ipiv1, X);
const u32 n = ipiv1.n_elem;
const u32 P_rows = U.n_rows;
podarray<blas_int> ipiv2(P_rows);
const blas_int* ipiv1_mem = ipiv1.memptr();
blas_int* ipiv2_mem = ipiv2.memptr();
for(u32 i=0; i<P_rows; ++i)
{
ipiv2_mem[i] = i;
}
for(u32 i=0; i<n; ++i)
{
const u32 k = ipiv1_mem[i];
if( ipiv2_mem[i] != ipiv2_mem[k] )
{
std::swap( ipiv2_mem[i], ipiv2_mem[k] );
L.swap_rows( u32(ipiv2_mem[i]), u32(ipiv2_mem[k]) );
}
}
if(L.n_cols > U.n_rows)
{
L.shed_cols(U.n_rows, L.n_cols-1);
}
if(U.n_rows > L.n_cols)
{
U.shed_rows(L.n_cols, U.n_rows-1);
}
} }
//! immediate eigenvalues of a symmetric real matrix using LAPACK //! immediate eigenvalues of a symmetric real matrix using LAPACK
template<typename eT> template<typename eT, typename T1>
inline inline
void bool
auxlib::eig_sym(Col<eT>& eigval, const Mat<eT>& A_orig) auxlib::eig_sym(Col<eT>& eigval, const Base<eT,T1>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
const unwrap_check<Mat<eT> > tmp(A_orig, eigval); Mat<eT> A(X.get_ref());
const Mat<eT>& A = tmp.M;
arma_debug_check( (A.n_rows != A.n_cols), "eig_sym(): given matrix is n ot square"); arma_debug_check( (A.is_square() == false), "eig_sym(): given matrix is not square");
// rudimentary "better-than-nothing" test for symmetry // rudimentary "better-than-nothing" test for symmetry
//arma_debug_check( (A.at(A.n_rows-1, 0) != A.at(0, A.n_cols-1)), "auxl ib::eig(): given matrix is not symmetric" ); //arma_debug_check( (A.at(A.n_rows-1, 0) != A.at(0, A.n_cols-1)), "auxl ib::eig(): given matrix is not symmetric" );
char jobz = 'N'; char jobz = 'N';
char uplo = 'U'; char uplo = 'U';
blas_int n_rows = A.n_rows; blas_int n_rows = A.n_rows;
blas_int lwork = (std::max)(1,3*n_rows-1); blas_int lwork = (std::max)(blas_int(1), 3*n_rows-1);
eigval.set_size(n_rows); eigval.set_size(n_rows);
podarray<eT> work(lwork); podarray<eT> work(lwork);
Mat<eT> A_copy = A;
blas_int info; blas_int info;
arma_extra_debug_print("lapack::syev_()"); arma_extra_debug_print("lapack::syev()");
lapack::syev_(&jobz, &uplo, &n_rows, A_copy.memptr(), &n_rows, eigval.m lapack::syev(&jobz, &uplo, &n_rows, A.memptr(), &n_rows, eigval.memptr(
emptr(), work.memptr(), &lwork, &info); ), work.memptr(), &lwork, &info);
return (info == 0);
} }
#else #else
{ {
arma_ignore(eigval);
arma_ignore(X);
arma_stop("eig_sym(): need LAPACK"); arma_stop("eig_sym(): need LAPACK");
return false;
} }
#endif #endif
} }
//! immediate eigenvalues of a hermitian complex matrix using LAPACK //! immediate eigenvalues of a hermitian complex matrix using LAPACK
template<typename T> template<typename T, typename T1>
inline inline
void bool
auxlib::eig_sym(Col<T>& eigval, const Mat< std::complex<T> >& A) auxlib::eig_sym(Col<T>& eigval, const Base<std::complex<T>,T1>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename std::complex<T> eT; typedef typename std::complex<T> eT;
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
arma_debug_check( (A.n_rows != A.n_cols), "eig_sym(): given matrix is n Mat<eT> A(X.get_ref());
ot hermitian"); arma_debug_check( (A.is_square() == false), "eig_sym(): given matrix is
not hermitian");
char jobz = 'N'; char jobz = 'N';
char uplo = 'U'; char uplo = 'U';
blas_int n_rows = A.n_rows; blas_int n_rows = A.n_rows;
blas_int lda = A.n_rows; blas_int lda = A.n_rows;
blas_int lwork = (std::max)(1, 2*n_rows - 1); // TODO: automatically find best size of lwork blas_int lwork = (std::max)(blas_int(1), 2*n_rows - 1); // TODO: auto matically find best size of lwork
eigval.set_size(n_rows); eigval.set_size(n_rows);
podarray<eT> work(lwork); podarray<eT> work(lwork);
podarray<T> rwork( (std::max)(1, 3*n_rows - 2) ); podarray<T> rwork( (std::max)(blas_int(1), 3*n_rows - 2) );
Mat<eT> A_copy = A;
blas_int info; blas_int info;
arma_extra_debug_print("lapack::heev_()"); arma_extra_debug_print("lapack::heev()");
lapack::heev_(&jobz, &uplo, &n_rows, A_copy.memptr(), &lda, eigval.memp lapack::heev(&jobz, &uplo, &n_rows, A.memptr(), &lda, eigval.memptr(),
tr(), work.memptr(), &lwork, rwork.memptr(), &info); work.memptr(), &lwork, rwork.memptr(), &info);
return (info == 0);
} }
#else #else
{ {
arma_ignore(eigval);
arma_ignore(X);
arma_stop("eig_sym(): need LAPACK"); arma_stop("eig_sym(): need LAPACK");
return false;
} }
#endif #endif
} }
//! immediate eigenvalues and eigenvectors of a symmetric real matrix using LAPACK //! immediate eigenvalues and eigenvectors of a symmetric real matrix using LAPACK
template<typename eT> template<typename eT, typename T1>
inline inline
void bool
auxlib::eig_sym(Col<eT>& eigval, Mat<eT>& eigvec, const Mat<eT>& A_orig) auxlib::eig_sym(Col<eT>& eigval, Mat<eT>& eigvec, const Base<eT,T1>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
// TODO: check for aliasing
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
const unwrap_check< Mat<eT> > tmp1(A_orig, eigval); eigvec = X.get_ref();
const Mat<eT>& A_tmp = tmp1.M;
const unwrap_check< Mat<eT> > tmp2(A_tmp, eigvec);
const Mat<eT>& A = tmp2.M;
arma_debug_check( (A.n_rows != A.n_cols), "eig_sym(): given matrix is n ot square" ); arma_debug_check( (eigvec.is_square() == false), "eig_sym(): given matr ix is not square" );
// rudimentary "better-than-nothing" test for symmetry // rudimentary "better-than-nothing" test for symmetry
//arma_debug_check( (A.at(A.n_rows-1, 0) != A.at(0, A.n_cols-1)), "auxl ib::eig(): given matrix is not symmetric" ); //arma_debug_check( (A.at(A.n_rows-1, 0) != A.at(0, A.n_cols-1)), "auxl ib::eig(): given matrix is not symmetric" );
char jobz = 'V'; char jobz = 'V';
char uplo = 'U'; char uplo = 'U';
blas_int n_rows = A.n_rows; blas_int n_rows = eigvec.n_rows;
blas_int lwork = (std::max)(1, 3*n_rows-1); blas_int lwork = (std::max)(blas_int(1), 3*n_rows-1);
eigval.set_size(n_rows); eigval.set_size(n_rows);
podarray<eT> work(lwork); podarray<eT> work(lwork);
eigvec = A;
blas_int info; blas_int info;
arma_extra_debug_print("lapack::syev_()"); arma_extra_debug_print("lapack::syev()");
lapack::syev_(&jobz, &uplo, &n_rows, eigvec.memptr(), &n_rows, eigval.m lapack::syev(&jobz, &uplo, &n_rows, eigvec.memptr(), &n_rows, eigval.me
emptr(), work.memptr(), &lwork, &info); mptr(), work.memptr(), &lwork, &info);
return (info == 0);
} }
#else #else
{ {
arma_ignore(eigval);
arma_ignore(eigvec);
arma_ignore(X);
arma_stop("eig_sym(): need LAPACK"); arma_stop("eig_sym(): need LAPACK");
return false;
} }
#endif #endif
} }
//! immediate eigenvalues and eigenvectors of a hermitian complex matrix us ing LAPACK //! immediate eigenvalues and eigenvectors of a hermitian complex matrix us ing LAPACK
template<typename T> template<typename T, typename T1>
inline inline
void bool
auxlib::eig_sym(Col<T>& eigval, Mat< std::complex<T> >& eigvec, const Mat< auxlib::eig_sym(Col<T>& eigval, Mat< std::complex<T> >& eigvec, const Base<
std::complex<T> >& A_orig) std::complex<T>,T1>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename std::complex<T> eT; typedef typename std::complex<T> eT;
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
const unwrap_check< Mat<eT> > tmp(A_orig, eigvec); eigvec = X.get_ref();
const Mat<eT>& A = tmp.M;
arma_debug_check( (A.n_rows != A.n_cols), "eig_sym(): given matrix is n ot hermitian" ); arma_debug_check( (eigvec.is_square() == false), "eig_sym(): given matr ix is not hermitian" );
char jobz = 'V'; char jobz = 'V';
char uplo = 'U'; char uplo = 'U';
blas_int n_rows = A.n_rows; blas_int n_rows = eigvec.n_rows;
blas_int lda = A.n_rows; blas_int lda = eigvec.n_rows;
blas_int lwork = (std::max)(1, 2*n_rows - 1); // TODO: automatically blas_int lwork = (std::max)(blas_int(1), 2*n_rows - 1); // TODO: auto
find best size of lwork matically find best size of lwork
eigval.set_size(n_rows); eigval.set_size(n_rows);
podarray<eT> work(lwork); podarray<eT> work(lwork);
podarray<T> rwork( (std::max)(1, 3*n_rows - 2) ); podarray<T> rwork( (std::max)(blas_int(1), 3*n_rows - 2) );
eigvec = A;
blas_int info; blas_int info;
arma_extra_debug_print("lapack::heev_()"); arma_extra_debug_print("lapack::heev()");
lapack::heev_(&jobz, &uplo, &n_rows, eigvec.memptr(), &lda, eigval.memp lapack::heev(&jobz, &uplo, &n_rows, eigvec.memptr(), &lda, eigval.mempt
tr(), work.memptr(), &lwork, rwork.memptr(), &info); r(), work.memptr(), &lwork, rwork.memptr(), &info);
return (info == 0);
} }
#else #else
{ {
arma_ignore(eigval);
arma_ignore(eigvec);
arma_ignore(X);
arma_stop("eig_sym(): need LAPACK"); arma_stop("eig_sym(): need LAPACK");
return false;
} }
#endif #endif
} }
//! Eigenvalues and eigenvectors of a general square real matrix using LAPA CK. //! Eigenvalues and eigenvectors of a general square real matrix using LAPA CK.
//! The argument 'side' specifies which eigenvectors should be calculated //! The argument 'side' specifies which eigenvectors should be calculated
//! (see code for mode details). //! (see code for mode details).
template<typename T> template<typename T, typename T1>
inline inline
void bool
auxlib::eig_gen auxlib::eig_gen
( (
Col< std::complex<T> >& eigval, Col< std::complex<T> >& eigval,
Mat<T>& l_eigvec, Mat<T>& l_eigvec,
Mat<T>& r_eigvec, Mat<T>& r_eigvec,
const Mat<T>& A, const Base<T,T1>& X,
const char side const char side
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
// TODO: check for aliasing
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
arma_debug_check( (A.n_rows != A.n_cols), "eig_gen(): given matrix is n Mat<T> A(X.get_ref());
ot square" ); arma_debug_check( (A.is_square() == false), "eig_gen(): given matrix is
not square" );
char jobvl; char jobvl;
char jobvr; char jobvr;
switch(side) switch(side)
{ {
case 'l': // left case 'l': // left
jobvl = 'V'; jobvl = 'V';
jobvr = 'N'; jobvr = 'N';
break; break;
skipping to change at line 977 skipping to change at line 1105
jobvl = 'N'; jobvl = 'N';
jobvr = 'N'; jobvr = 'N';
break; break;
default: default:
arma_stop("eig_gen(): parameter 'side' is invalid"); arma_stop("eig_gen(): parameter 'side' is invalid");
} }
blas_int n_rows = A.n_rows; blas_int n_rows = A.n_rows;
blas_int lda = A.n_rows; blas_int lda = A.n_rows;
blas_int lwork = (std::max)(1, 4*n_rows); // TODO: automatically find best size of lwork blas_int lwork = (std::max)(blas_int(1), 4*n_rows); // TODO: automati cally find best size of lwork
eigval.set_size(n_rows); eigval.set_size(n_rows);
l_eigvec.set_size(n_rows, n_rows); l_eigvec.set_size(n_rows, n_rows);
r_eigvec.set_size(n_rows, n_rows); r_eigvec.set_size(n_rows, n_rows);
podarray<T> work(lwork); podarray<T> work(lwork);
podarray<T> rwork( (std::max)(1, 3*n_rows) ); podarray<T> rwork( (std::max)(blas_int(1), 3*n_rows) );
podarray<T> wr(n_rows); podarray<T> wr(n_rows);
podarray<T> wi(n_rows); podarray<T> wi(n_rows);
Mat<T> A_copy = A; Mat<T> A_copy = A;
blas_int info; blas_int info;
arma_extra_debug_print("lapack::cx_geev_()"); arma_extra_debug_print("lapack::geev()");
lapack::geev_(&jobvl, &jobvr, &n_rows, A_copy.memptr(), &lda, wr.memptr lapack::geev(&jobvl, &jobvr, &n_rows, A_copy.memptr(), &lda, wr.memptr(
(), wi.memptr(), l_eigvec.memptr(), &n_rows, r_eigvec.memptr(), &n_rows, wo ), wi.memptr(), l_eigvec.memptr(), &n_rows, r_eigvec.memptr(), &n_rows, wor
rk.memptr(), &lwork, &info); k.memptr(), &lwork, &info);
eigval.set_size(n_rows); eigval.set_size(n_rows);
for(u32 i=0; i<u32(n_rows); ++i) for(u32 i=0; i<u32(n_rows); ++i)
{ {
eigval[i] = std::complex<T>(wr[i], wi[i]); eigval[i] = std::complex<T>(wr[i], wi[i]);
} }
return (info == 0);
} }
#else #else
{ {
arma_ignore(eigval);
arma_ignore(l_eigvec);
arma_ignore(r_eigvec);
arma_ignore(X);
arma_ignore(side);
arma_stop("eig_gen(): need LAPACK"); arma_stop("eig_gen(): need LAPACK");
return false;
} }
#endif #endif
} }
//! Eigenvalues and eigenvectors of a general square complex matrix using L APACK //! Eigenvalues and eigenvectors of a general square complex matrix using L APACK
//! The argument 'side' specifies which eigenvectors should be calculated //! The argument 'side' specifies which eigenvectors should be calculated
//! (see code for mode details). //! (see code for mode details).
template<typename T> template<typename T, typename T1>
inline inline
void bool
auxlib::eig_gen auxlib::eig_gen
( (
Col< std::complex<T> >& eigval, Col< std::complex<T> >& eigval,
Mat< std::complex<T> >& l_eigvec, Mat< std::complex<T> >& l_eigvec,
Mat< std::complex<T> >& r_eigvec, Mat< std::complex<T> >& r_eigvec,
const Mat< std::complex<T> >& A, const Base< std::complex<T>, T1 >& X,
const char side const char side
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
// TODO: check for aliasing
typedef typename std::complex<T> eT; typedef typename std::complex<T> eT;
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
arma_debug_check( (A.n_rows != A.n_cols), "eig_gen(): given matrix is n Mat<eT> A(X.get_ref());
ot square" ); arma_debug_check( (A.is_square() == false), "eig_gen(): given matrix is
not square" );
char jobvl; char jobvl;
char jobvr; char jobvr;
switch(side) switch(side)
{ {
case 'l': // left case 'l': // left
jobvl = 'V'; jobvl = 'V';
jobvr = 'N'; jobvr = 'N';
break; break;
skipping to change at line 1066 skipping to change at line 1199
jobvl = 'N'; jobvl = 'N';
jobvr = 'N'; jobvr = 'N';
break; break;
default: default:
arma_stop("eig_gen(): parameter 'side' is invalid"); arma_stop("eig_gen(): parameter 'side' is invalid");
} }
blas_int n_rows = A.n_rows; blas_int n_rows = A.n_rows;
blas_int lda = A.n_rows; blas_int lda = A.n_rows;
blas_int lwork = (std::max)(1, 4*n_rows); // TODO: automatically find best size of lwork blas_int lwork = (std::max)(blas_int(1), 4*n_rows); // TODO: automati cally find best size of lwork
eigval.set_size(n_rows); eigval.set_size(n_rows);
l_eigvec.set_size(n_rows, n_rows); l_eigvec.set_size(n_rows, n_rows);
r_eigvec.set_size(n_rows, n_rows); r_eigvec.set_size(n_rows, n_rows);
podarray<eT> work(lwork); podarray<eT> work(lwork);
podarray<T> rwork( (std::max)(1, 3*n_rows) ); // was 2,3 podarray<T> rwork( (std::max)(blas_int(1), 3*n_rows) ); // was 2,3
Mat<eT> A_copy = A;
blas_int info; blas_int info;
arma_extra_debug_print("lapack::cx_geev_()"); arma_extra_debug_print("lapack::cx_geev()");
lapack::cx_geev_(&jobvl, &jobvr, &n_rows, A_copy.memptr(), &lda, eigval lapack::cx_geev(&jobvl, &jobvr, &n_rows, A.memptr(), &lda, eigval.mempt
.memptr(), l_eigvec.memptr(), &n_rows, r_eigvec.memptr(), &n_rows, work.mem r(), l_eigvec.memptr(), &n_rows, r_eigvec.memptr(), &n_rows, work.memptr(),
ptr(), &lwork, rwork.memptr(), &info); &lwork, rwork.memptr(), &info);
return (info == 0);
} }
#else #else
{ {
arma_ignore(eigval);
arma_ignore(l_eigvec);
arma_ignore(r_eigvec);
arma_ignore(X);
arma_ignore(side);
arma_stop("eig_gen(): need LAPACK"); arma_stop("eig_gen(): need LAPACK");
return false;
} }
#endif #endif
} }
template<typename eT> template<typename eT, typename T1>
inline inline
bool bool
auxlib::chol(Mat<eT>& out, const Mat<eT>& X) auxlib::chol(Mat<eT>& out, const Base<eT,T1>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
out = X.get_ref();
arma_debug_check( (out.is_square() == false), "chol(): given matrix is
not square" );
const u32 out_n_rows = out.n_rows;
char uplo = 'U'; char uplo = 'U';
blas_int n = X.n_rows; blas_int n = out_n_rows;
blas_int lda = X.n_rows;
blas_int info; blas_int info;
out = X; lapack::potrf(&uplo, &n, out.memptr(), &n, &info);
lapack::potrf_(&uplo, &n, out.memptr(), &lda, &info);
for(u32 col=0; col<X.n_rows; ++col) for(u32 col=0; col<out_n_rows; ++col)
{ {
eT* colptr = out.colptr(col); eT* colptr = out.colptr(col);
for(u32 row=col+1; row<X.n_rows; ++row)
for(u32 row=(col+1); row < out_n_rows; ++row)
{ {
colptr[row] = eT(0); colptr[row] = eT(0);
} }
} }
return (info == 0); return (info == 0);
} }
#else #else
{ {
arma_ignore(out);
arma_ignore(X);
arma_stop("chol(): need LAPACK"); arma_stop("chol(): need LAPACK");
return false; return false;
} }
#endif #endif
} }
template<typename eT> template<typename eT, typename T1>
inline inline
bool bool
auxlib::qr(Mat<eT>& Q, Mat<eT>& R, const Mat<eT>& X) auxlib::qr(Mat<eT>& Q, Mat<eT>& R, const Base<eT,T1>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
blas_int m = static_cast<blas_int>(X.n_rows); R = X.get_ref();
blas_int n = static_cast<blas_int>(X.n_cols);
blas_int work_len = (std::max)(1,n); if(R.is_empty())
{
Q.reset();
return false;
}
const u32 R_n_rows = R.n_rows;
const u32 R_n_cols = R.n_cols;
blas_int m = static_cast<blas_int>(R_n_rows);
blas_int n = static_cast<blas_int>(R_n_cols);
blas_int work_len = (std::max)(blas_int(1),n);
blas_int work_len_tmp; blas_int work_len_tmp;
blas_int k = (std::min)(m,n); blas_int k = (std::min)(m,n);
blas_int info; blas_int info;
podarray<eT> tau(k); podarray<eT> tau(k);
podarray<eT> work(work_len); podarray<eT> work(work_len);
R = X;
// query for the optimum value of work_len // query for the optimum value of work_len
work_len_tmp = -1; work_len_tmp = -1;
lapack::geqrf_(&m, &n, R.memptr(), &m, tau.memptr(), work.memptr(), &wo rk_len_tmp, &info); lapack::geqrf(&m, &n, R.memptr(), &m, tau.memptr(), work.memptr(), &wor k_len_tmp, &info);
if(info == 0) if(info == 0)
{ {
work_len = static_cast<blas_int>(access::tmp_real(work[0])); work_len = static_cast<blas_int>(access::tmp_real(work[0]));
work.set_size(work_len); work.set_size(work_len);
} }
lapack::geqrf_(&m, &n, R.memptr(), &m, tau.memptr(), work.memptr(), &wo rk_len, &info); lapack::geqrf(&m, &n, R.memptr(), &m, tau.memptr(), work.memptr(), &wor k_len, &info);
Q.set_size(X.n_rows, X.n_rows); Q.set_size(R_n_rows, R_n_rows);
eT* Q_mem = Q.memptr(); syslib::copy_elem( Q.memptr(), R.memptr(), (std::min)(Q.n_elem, R.n_ele
const eT* R_mem = R.mem; m) );
const u32 n_elem_copy = (std::min)(Q.n_elem, R.n_elem);
for(u32 i=0; i < n_elem_copy; ++i)
{
Q_mem[i] = R_mem[i];
}
//
// construct R // construct R
for(u32 row=0; row < R.n_rows; ++row)
for(u32 col=0; col < R_n_cols; ++col)
{ {
const u32 n_elem_tmp = (std::min)(row, R.n_cols); for(u32 row=(col+1); row < R_n_rows; ++row)
for(u32 col=0; col < n_elem_tmp; ++col)
{ {
R.at(row,col) = eT(0); R.at(row,col) = eT(0);
} }
} }
if( (is_float<eT>::value == true) || (is_double<eT>::value == true) ) if( (is_float<eT>::value == true) || (is_double<eT>::value == true) )
{ {
// query for the optimum value of work_len // query for the optimum value of work_len
work_len_tmp = -1; work_len_tmp = -1;
lapack::orgqr_(&m, &m, &k, Q.memptr(), &m, tau.memptr(), work.memptr( ), &work_len_tmp, &info); lapack::orgqr(&m, &m, &k, Q.memptr(), &m, tau.memptr(), work.memptr() , &work_len_tmp, &info);
if(info == 0) if(info == 0)
{ {
work_len = static_cast<blas_int>(access::tmp_real(work[0])); work_len = static_cast<blas_int>(access::tmp_real(work[0]));
work.set_size(work_len); work.set_size(work_len);
} }
lapack::orgqr_(&m, &m, &k, Q.memptr(), &m, tau.memptr(), work.memptr( ), &work_len, &info); lapack::orgqr(&m, &m, &k, Q.memptr(), &m, tau.memptr(), work.memptr() , &work_len, &info);
} }
else else
if( (is_supported_complex_float<eT>::value == true) || (is_supported_co mplex_double<eT>::value == true) ) if( (is_supported_complex_float<eT>::value == true) || (is_supported_co mplex_double<eT>::value == true) )
{ {
// query for the optimum value of work_len // query for the optimum value of work_len
work_len_tmp = -1; work_len_tmp = -1;
lapack::ungqr_(&m, &m, &k, Q.memptr(), &m, tau.memptr(), work.memptr( ), &work_len_tmp, &info); lapack::ungqr(&m, &m, &k, Q.memptr(), &m, tau.memptr(), work.memptr() , &work_len_tmp, &info);
if(info == 0) if(info == 0)
{ {
work_len = static_cast<blas_int>(access::tmp_real(work[0])); work_len = static_cast<blas_int>(access::tmp_real(work[0]));
work.set_size(work_len); work.set_size(work_len);
} }
lapack::ungqr_(&m, &m, &k, Q.memptr(), &m, tau.memptr(), work.memptr( ), &work_len, &info); lapack::ungqr(&m, &m, &k, Q.memptr(), &m, tau.memptr(), work.memptr() , &work_len, &info);
} }
return (info == 0); return (info == 0);
} }
#else #else
{ {
arma_ignore(Q);
arma_ignore(R);
arma_ignore(X);
arma_stop("qr(): need LAPACK"); arma_stop("qr(): need LAPACK");
return false; return false;
} }
#endif #endif
} }
template<typename eT> template<typename eT, typename T1>
inline inline
bool bool
auxlib::svd(Col<eT>& S, const Mat<eT>& X) auxlib::svd(Col<eT>& S, const Base<eT,T1>& X, u32& X_n_rows, u32& X_n_cols)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
Mat<eT> A = X; Mat<eT> A(X.get_ref());
X_n_rows = A.n_rows;
X_n_cols = A.n_cols;
if(A.is_empty())
{
S.reset();
return false;
}
Mat<eT> U(1, 1); Mat<eT> U(1, 1);
Mat<eT> V(1, A.n_cols); Mat<eT> V(1, A.n_cols);
char jobu = 'N'; char jobu = 'N';
char jobvt = 'N'; char jobvt = 'N';
blas_int m = A.n_rows; blas_int m = A.n_rows;
blas_int n = A.n_cols; blas_int n = A.n_cols;
blas_int lda = A.n_rows; blas_int lda = A.n_rows;
blas_int ldu = U.n_rows; blas_int ldu = U.n_rows;
blas_int ldvt = V.n_rows; blas_int ldvt = V.n_rows;
blas_int lwork = 2 * (std::max)(1, (std::max)( (3*(std::min)(m,n) + (s td::max)(m,n)), 5*(std::min)(m,n) ) ); blas_int lwork = 2 * (std::max)(blas_int(1), (std::max)( (3*(std::min) (m,n) + (std::max)(m,n)), 5*(std::min)(m,n) ) );
blas_int info; blas_int info;
S.set_size( (std::min)(m, n) ); S.set_size( (std::min)(m, n) );
podarray<eT> work(lwork); podarray<eT> work(lwork);
// let gesvd_() calculate the optimum size of the workspace // let gesvd_() calculate the optimum size of the workspace
blas_int lwork_tmp = -1; blas_int lwork_tmp = -1;
lapack::gesvd_<eT> lapack::gesvd<eT>
( (
&jobu, &jobvt, &jobu, &jobvt,
&m,&n, &m,&n,
A.memptr(), &lda, A.memptr(), &lda,
S.memptr(), S.memptr(),
U.memptr(), &ldu, U.memptr(), &ldu,
V.memptr(), &ldvt, V.memptr(), &ldvt,
work.memptr(), &lwork_tmp, work.memptr(), &lwork_tmp,
&info &info
); );
skipping to change at line 1273 skipping to change at line 1434
if(info == 0) if(info == 0)
{ {
blas_int proposed_lwork = static_cast<blas_int>(work[0]); blas_int proposed_lwork = static_cast<blas_int>(work[0]);
if(proposed_lwork > lwork) if(proposed_lwork > lwork)
{ {
lwork = proposed_lwork; lwork = proposed_lwork;
work.set_size(lwork); work.set_size(lwork);
} }
lapack::gesvd_<eT> lapack::gesvd<eT>
( (
&jobu, &jobvt, &jobu, &jobvt,
&m, &n, &m, &n,
A.memptr(), &lda, A.memptr(), &lda,
S.memptr(), S.memptr(),
U.memptr(), &ldu, U.memptr(), &ldu,
V.memptr(), &ldvt, V.memptr(), &ldvt,
work.memptr(), &lwork, work.memptr(), &lwork,
&info &info
); );
} }
return (info == 0); return (info == 0);
} }
#else #else
{ {
arma_ignore(S);
arma_ignore(X);
arma_ignore(X_n_rows);
arma_ignore(X_n_cols);
arma_stop("svd(): need LAPACK"); arma_stop("svd(): need LAPACK");
return false; return false;
} }
#endif #endif
} }
template<typename T> template<typename T, typename T1>
inline inline
bool bool
auxlib::svd(Col<T>& S, const Mat< std::complex<T> >& X) auxlib::svd(Col<T>& S, const Base<std::complex<T>, T1>& X, u32& X_n_rows, u 32& X_n_cols)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef std::complex<T> eT; typedef std::complex<T> eT;
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
Mat<eT> A = X; Mat<eT> A(X.get_ref());
X_n_rows = A.n_rows;
X_n_cols = A.n_cols;
if(A.is_empty())
{
S.reset();
return false;
}
Mat<eT> U(1, 1); Mat<eT> U(1, 1);
Mat<eT> V(1, A.n_cols); Mat<eT> V(1, A.n_cols);
char jobu = 'N'; char jobu = 'N';
char jobvt = 'N'; char jobvt = 'N';
blas_int m = A.n_rows; blas_int m = A.n_rows;
blas_int n = A.n_cols; blas_int n = A.n_cols;
blas_int lda = A.n_rows; blas_int lda = A.n_rows;
blas_int ldu = U.n_rows; blas_int ldu = U.n_rows;
blas_int ldvt = V.n_rows; blas_int ldvt = V.n_rows;
blas_int lwork = 2 * (std::max)(1, 2*(std::min)(m,n)+(std::max)(m,n) ) ; blas_int lwork = 2 * (std::max)(blas_int(1), 2*(std::min)(m,n)+(std::m ax)(m,n) );
blas_int info; blas_int info;
S.set_size( (std::min)(m,n) ); S.set_size( (std::min)(m,n) );
podarray<eT> work(lwork); podarray<eT> work(lwork);
podarray<T> rwork( 5*(std::min)(m,n) ); podarray<T> rwork( 5*(std::min)(m,n) );
// let gesvd_() calculate the optimum size of the workspace // let gesvd_() calculate the optimum size of the workspace
blas_int lwork_tmp = -1; blas_int lwork_tmp = -1;
lapack::cx_gesvd_<T> lapack::cx_gesvd<T>
( (
&jobu, &jobvt, &jobu, &jobvt,
&m, &n, &m, &n,
A.memptr(), &lda, A.memptr(), &lda,
S.memptr(), S.memptr(),
U.memptr(), &ldu, U.memptr(), &ldu,
V.memptr(), &ldvt, V.memptr(), &ldvt,
work.memptr(), &lwork_tmp, work.memptr(), &lwork_tmp,
rwork.memptr(), rwork.memptr(),
&info &info
skipping to change at line 1353 skipping to change at line 1527
if(info == 0) if(info == 0)
{ {
blas_int proposed_lwork = static_cast<blas_int>(real(work[0])); blas_int proposed_lwork = static_cast<blas_int>(real(work[0]));
if(proposed_lwork > lwork) if(proposed_lwork > lwork)
{ {
lwork = proposed_lwork; lwork = proposed_lwork;
work.set_size(lwork); work.set_size(lwork);
} }
lapack::cx_gesvd_<T> lapack::cx_gesvd<T>
( (
&jobu, &jobvt, &jobu, &jobvt,
&m, &n, &m, &n,
A.memptr(), &lda, A.memptr(), &lda,
S.memptr(), S.memptr(),
U.memptr(), &ldu, U.memptr(), &ldu,
V.memptr(), &ldvt, V.memptr(), &ldvt,
work.memptr(), &lwork, work.memptr(), &lwork,
rwork.memptr(), rwork.memptr(),
&info &info
); );
} }
return (info == 0); return (info == 0);
} }
#else #else
{ {
arma_ignore(S);
arma_ignore(X);
arma_ignore(X_n_rows);
arma_ignore(X_n_cols);
arma_stop("svd(): need LAPACK"); arma_stop("svd(): need LAPACK");
return false; return false;
} }
#endif #endif
} }
template<typename eT> template<typename eT, typename T1>
inline
bool
auxlib::svd(Col<eT>& S, const Base<eT,T1>& X)
{
arma_extra_debug_sigprint();
u32 junk;
return auxlib::svd(S, X, junk, junk);
}
template<typename T, typename T1>
inline inline
bool bool
auxlib::svd(Mat<eT>& U, Col<eT>& S, Mat<eT>& V, const Mat<eT>& X) auxlib::svd(Col<T>& S, const Base<std::complex<T>, T1>& X)
{
arma_extra_debug_sigprint();
u32 junk;
return auxlib::svd(S, X, junk, junk);
}
template<typename eT, typename T1>
inline
bool
auxlib::svd(Mat<eT>& U, Col<eT>& S, Mat<eT>& V, const Base<eT,T1>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
Mat<eT> A = X; Mat<eT> A(X.get_ref());
if(A.is_empty())
{
U.reset();
S.reset();
V.reset();
return false;
}
U.set_size(A.n_rows, A.n_rows); U.set_size(A.n_rows, A.n_rows);
V.set_size(A.n_cols, A.n_cols); V.set_size(A.n_cols, A.n_cols);
char jobu = 'A'; char jobu = 'A';
char jobvt = 'A'; char jobvt = 'A';
blas_int m = A.n_rows; blas_int m = A.n_rows;
blas_int n = A.n_cols; blas_int n = A.n_cols;
blas_int lda = A.n_rows; blas_int lda = A.n_rows;
blas_int ldu = U.n_rows; blas_int ldu = U.n_rows;
blas_int ldvt = V.n_rows; blas_int ldvt = V.n_rows;
blas_int lwork = 2 * (std::max)(1, (std::max)( (3*(std::min)(m,n) + (s td::max)(m,n)), 5*(std::min)(m,n) ) ); blas_int lwork = 2 * (std::max)(blas_int(1), (std::max)( (3*(std::min) (m,n) + (std::max)(m,n)), 5*(std::min)(m,n) ) );
blas_int info; blas_int info;
S.set_size( (std::min)(m,n) ); S.set_size( (std::min)(m,n) );
podarray<eT> work(lwork); podarray<eT> work(lwork);
// let gesvd_() calculate the optimum size of the workspace // let gesvd_() calculate the optimum size of the workspace
blas_int lwork_tmp = -1; blas_int lwork_tmp = -1;
lapack::gesvd_<eT> lapack::gesvd<eT>
( (
&jobu, &jobvt, &jobu, &jobvt,
&m, &n, &m, &n,
A.memptr(), &lda, A.memptr(), &lda,
S.memptr(), S.memptr(),
U.memptr(), &ldu, U.memptr(), &ldu,
V.memptr(), &ldvt, V.memptr(), &ldvt,
work.memptr(), &lwork_tmp, work.memptr(), &lwork_tmp,
&info &info
); );
if(info == 0) if(info == 0)
{ {
blas_int proposed_lwork = static_cast<blas_int>(work[0]); blas_int proposed_lwork = static_cast<blas_int>(work[0]);
if(proposed_lwork > lwork) if(proposed_lwork > lwork)
{ {
lwork = proposed_lwork; lwork = proposed_lwork;
work.set_size(lwork); work.set_size(lwork);
} }
lapack::gesvd_<eT> lapack::gesvd<eT>
( (
&jobu, &jobvt, &jobu, &jobvt,
&m, &n, &m, &n,
A.memptr(), &lda, A.memptr(), &lda,
S.memptr(), S.memptr(),
U.memptr(), &ldu, U.memptr(), &ldu,
V.memptr(), &ldvt, V.memptr(), &ldvt,
work.memptr(), &lwork, work.memptr(), &lwork,
&info &info
); );
op_trans::apply(V,V); // op_trans will work out that an in-place tra nspose can be done op_trans::apply(V,V); // op_trans will work out that an in-place tra nspose can be done
} }
return (info == 0); return (info == 0);
} }
#else #else
{ {
arma_ignore(U);
arma_ignore(S);
arma_ignore(V);
arma_ignore(X);
arma_stop("svd(): need LAPACK"); arma_stop("svd(): need LAPACK");
return false; return false;
} }
#endif #endif
} }
template<typename T> template<typename T, typename T1>
inline inline
bool bool
auxlib::svd(Mat< std::complex<T> >& U, Col<T>& S, Mat< std::complex<T> >& V , const Mat< std::complex<T> >& X) auxlib::svd(Mat< std::complex<T> >& U, Col<T>& S, Mat< std::complex<T> >& V , const Base< std::complex<T>, T1>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef std::complex<T> eT; typedef std::complex<T> eT;
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
Mat<eT> A = X; Mat<eT> A(X.get_ref());
if(A.is_empty())
{
U.reset();
S.reset();
V.reset();
return false;
}
U.set_size(A.n_rows, A.n_rows); U.set_size(A.n_rows, A.n_rows);
V.set_size(A.n_cols, A.n_cols); V.set_size(A.n_cols, A.n_cols);
char jobu = 'A'; char jobu = 'A';
char jobvt = 'A'; char jobvt = 'A';
blas_int m = A.n_rows; blas_int m = A.n_rows;
blas_int n = A.n_cols; blas_int n = A.n_cols;
blas_int lda = A.n_rows; blas_int lda = A.n_rows;
blas_int ldu = U.n_rows; blas_int ldu = U.n_rows;
blas_int ldvt = V.n_rows; blas_int ldvt = V.n_rows;
blas_int lwork = 2 * (std::max)(1, 2*(std::min)(m,n)+(std::max)(m,n) ) ; blas_int lwork = 2 * (std::max)(blas_int(1), 2*(std::min)(m,n)+(std::m ax)(m,n) );
blas_int info; blas_int info;
S.set_size( (std::min)(m,n) ); S.set_size( (std::min)(m,n) );
podarray<eT> work(lwork); podarray<eT> work(lwork);
podarray<T> rwork( 5*(std::min)(m,n) ); podarray<T> rwork( 5*(std::min)(m,n) );
// let gesvd_() calculate the optimum size of the workspace // let gesvd_() calculate the optimum size of the workspace
blas_int lwork_tmp = -1; blas_int lwork_tmp = -1;
lapack::cx_gesvd_<T> lapack::cx_gesvd<T>
( (
&jobu, &jobvt, &jobu, &jobvt,
&m, &n, &m, &n,
A.memptr(), &lda, A.memptr(), &lda,
S.memptr(), S.memptr(),
U.memptr(), &ldu, U.memptr(), &ldu,
V.memptr(), &ldvt, V.memptr(), &ldvt,
work.memptr(), &lwork_tmp, work.memptr(), &lwork_tmp,
rwork.memptr(), rwork.memptr(),
&info &info
skipping to change at line 1510 skipping to change at line 1731
if(info == 0) if(info == 0)
{ {
blas_int proposed_lwork = static_cast<blas_int>(real(work[0])); blas_int proposed_lwork = static_cast<blas_int>(real(work[0]));
if(proposed_lwork > lwork) if(proposed_lwork > lwork)
{ {
lwork = proposed_lwork; lwork = proposed_lwork;
work.set_size(lwork); work.set_size(lwork);
} }
lapack::cx_gesvd_<T> lapack::cx_gesvd<T>
( (
&jobu, &jobvt, &jobu, &jobvt,
&m, &n, &m, &n,
A.memptr(), &lda, A.memptr(), &lda,
S.memptr(), S.memptr(),
U.memptr(), &ldu, U.memptr(), &ldu,
V.memptr(), &ldvt, V.memptr(), &ldvt,
work.memptr(), &lwork, work.memptr(), &lwork,
rwork.memptr(), rwork.memptr(),
&info &info
); );
op_htrans::apply(V,V); // op_htrans will work out that an in-place t ranspose can be done op_htrans::apply(V,V); // op_htrans will work out that an in-place t ranspose can be done
} }
return (info == 0); return (info == 0);
} }
#else #else
{ {
arma_ignore(U);
arma_ignore(S);
arma_ignore(V);
arma_ignore(X);
arma_stop("svd(): need LAPACK"); arma_stop("svd(): need LAPACK");
return false; return false;
} }
#endif #endif
} }
//! Solve a system of linear equations //! Solve a system of linear equations
//! Assumes that A.n_rows = A.n_cols //! Assumes that A.n_rows = A.n_cols
//! and B.n_rows = A.n_rows //! and B.n_rows = A.n_rows
template<typename eT> template<typename eT>
inline inline
bool bool
auxlib::solve(Mat<eT>& out, const Mat<eT>& A, const Mat<eT>& B) auxlib::solve(Mat<eT>& out, const Mat<eT>& A, const Mat<eT>& B)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
if(A.is_empty() || B.is_empty())
{
out.reset();
return false;
}
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
blas_int n = A.n_rows; blas_int n = A.n_rows;
blas_int lda = A.n_rows; blas_int lda = A.n_rows;
blas_int ldb = A.n_rows; blas_int ldb = A.n_rows;
blas_int nrhs = B.n_cols; blas_int nrhs = B.n_cols;
blas_int info; blas_int info;
podarray<blas_int> ipiv(n); podarray<blas_int> ipiv(n);
out = B; out = B;
Mat<eT> A_copy = A; Mat<eT> A_copy = A;
lapack::gesv_<eT>(&n, &nrhs, A_copy.memptr(), &lda, ipiv.memptr(), out. memptr(), &ldb, &info); lapack::gesv<eT>(&n, &nrhs, A_copy.memptr(), &lda, ipiv.memptr(), out.m emptr(), &ldb, &info);
return (info == 0); return (info == 0);
} }
#else #else
{ {
arma_ignore(out);
arma_ignore(A);
arma_ignore(B);
arma_stop("solve(): need LAPACK"); arma_stop("solve(): need LAPACK");
return false; return false;
} }
#endif #endif
} }
//! Solve an over-determined system. //! Solve an over-determined system.
//! Assumes that A.n_rows > A.n_cols //! Assumes that A.n_rows > A.n_cols
//! and B.n_rows = A.n_rows //! and B.n_rows = A.n_rows
template<typename eT> template<typename eT>
inline inline
bool bool
auxlib::solve_od(Mat<eT>& out, const Mat<eT>& A, const Mat<eT>& B) auxlib::solve_od(Mat<eT>& out, const Mat<eT>& A, const Mat<eT>& B)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
if(A.is_empty() || B.is_empty())
{
out.reset();
return false;
}
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
char trans = 'N'; char trans = 'N';
blas_int m = A.n_rows; blas_int m = A.n_rows;
blas_int n = A.n_cols; blas_int n = A.n_cols;
blas_int lda = A.n_rows; blas_int lda = A.n_rows;
blas_int ldb = A.n_rows; blas_int ldb = A.n_rows;
blas_int nrhs = B.n_cols; blas_int nrhs = B.n_cols;
blas_int lwork = n + (std::max)(n, nrhs); blas_int lwork = n + (std::max)(n, nrhs);
blas_int info; blas_int info;
Mat<eT> A_copy = A; Mat<eT> A_copy = A;
Mat<eT> tmp = B; Mat<eT> tmp = B;
podarray<eT> work(lwork); podarray<eT> work(lwork);
arma_extra_debug_print("lapack::gels_()"); arma_extra_debug_print("lapack::gels()");
// NOTE: // NOTE:
// the dgels() function in the lapack library supplied by ATLAS 3.6 // the dgels() function in the lapack library supplied by ATLAS 3.6
// seems to have problems // seems to have problems
lapack::gels_<eT> lapack::gels<eT>
( (
&trans, &m, &n, &nrhs, &trans, &m, &n, &nrhs,
A_copy.memptr(), &lda, A_copy.memptr(), &lda,
tmp.memptr(), &ldb, tmp.memptr(), &ldb,
work.memptr(), &lwork, work.memptr(), &lwork,
&info &info
); );
arma_extra_debug_print("lapack::gels_() -- finished"); arma_extra_debug_print("lapack::gels() -- finished");
out.set_size(A.n_cols, B.n_cols); out.set_size(A.n_cols, B.n_cols);
for(u32 col=0; col<B.n_cols; ++col) for(u32 col=0; col<B.n_cols; ++col)
{ {
syslib::copy_elem( out.colptr(col), tmp.colptr(col), A.n_cols ); syslib::copy_elem( out.colptr(col), tmp.colptr(col), A.n_cols );
} }
return (info == 0); return (info == 0);
} }
#else #else
{ {
arma_ignore(out);
arma_ignore(A);
arma_ignore(B);
arma_stop("auxlib::solve_od(): need LAPACK"); arma_stop("auxlib::solve_od(): need LAPACK");
return false; return false;
} }
#endif #endif
} }
//! Solve an under-determined system. //! Solve an under-determined system.
//! Assumes that A.n_rows < A.n_cols //! Assumes that A.n_rows < A.n_cols
//! and B.n_rows = A.n_rows //! and B.n_rows = A.n_rows
template<typename eT> template<typename eT>
inline inline
bool bool
auxlib::solve_ud(Mat<eT>& out, const Mat<eT>& A, const Mat<eT>& B) auxlib::solve_ud(Mat<eT>& out, const Mat<eT>& A, const Mat<eT>& B)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
if(A.is_empty() || B.is_empty())
{
out.reset();
return false;
}
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_LAPACK)
{ {
char trans = 'N'; char trans = 'N';
blas_int m = A.n_rows; blas_int m = A.n_rows;
blas_int n = A.n_cols; blas_int n = A.n_cols;
blas_int lda = A.n_rows; blas_int lda = A.n_rows;
blas_int ldb = A.n_cols; blas_int ldb = A.n_cols;
blas_int nrhs = B.n_cols; blas_int nrhs = B.n_cols;
blas_int lwork = m + (std::max)(m,nrhs); blas_int lwork = m + (std::max)(m,nrhs);
skipping to change at line 1674 skipping to change at line 1923
syslib::copy_elem( tmp_colmem, B.colptr(col), B.n_rows ); syslib::copy_elem( tmp_colmem, B.colptr(col), B.n_rows );
for(u32 row=B.n_rows; row<A.n_cols; ++row) for(u32 row=B.n_rows; row<A.n_cols; ++row)
{ {
tmp_colmem[row] = eT(0); tmp_colmem[row] = eT(0);
} }
} }
podarray<eT> work(lwork); podarray<eT> work(lwork);
arma_extra_debug_print("lapack::gels_()"); arma_extra_debug_print("lapack::gels()");
// NOTE: // NOTE:
// the dgels() function in the lapack library supplied by ATLAS 3.6 // the dgels() function in the lapack library supplied by ATLAS 3.6
// seems to have problems // seems to have problems
lapack::gels_<eT> lapack::gels<eT>
( (
&trans, &m, &n, &nrhs, &trans, &m, &n, &nrhs,
A_copy.memptr(), &lda, A_copy.memptr(), &lda,
tmp.memptr(), &ldb, tmp.memptr(), &ldb,
work.memptr(), &lwork, work.memptr(), &lwork,
&info &info
); );
arma_extra_debug_print("lapack::gels_() -- finished"); arma_extra_debug_print("lapack::gels() -- finished");
out.set_size(A.n_cols, B.n_cols); out.set_size(A.n_cols, B.n_cols);
for(u32 col=0; col<B.n_cols; ++col) for(u32 col=0; col<B.n_cols; ++col)
{ {
syslib::copy_elem( out.colptr(col), tmp.colptr(col), A.n_cols ); syslib::copy_elem( out.colptr(col), tmp.colptr(col), A.n_cols );
} }
return (info == 0); return (info == 0);
} }
#else #else
{ {
arma_ignore(out);
arma_ignore(A);
arma_ignore(B);
arma_stop("auxlib::solve_ud(): need LAPACK"); arma_stop("auxlib::solve_ud(): need LAPACK");
return false; return false;
} }
#endif #endif
} }
//! @} //! @}
 End of changes. 198 change blocks. 
233 lines changed or deleted 492 lines changed or added


 auxlib_proto.hpp   auxlib_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
// // Copyright (C) 2009 Edmund Highcock
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Edmund Highcock (edmund dot highcock at merton dot ox dot ac dot uk)
// //
// 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 28 skipping to change at line 25
//! @{ //! @{
//! wrapper for accessing external functions defined in ATLAS, LAPACK or BL AS libraries //! wrapper for accessing external functions defined in ATLAS, LAPACK or BL AS libraries
class auxlib class auxlib
{ {
public: public:
// //
// inv // inv
template<typename eT, typename T1>
inline static bool inv(Mat<eT>& out, const Base<eT,T1>& X);
template<typename eT> template<typename eT>
inline static bool inv(Mat<eT>& out, const Mat<eT>& X); inline static bool inv(Mat<eT>& out, const Mat<eT>& A);
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>& X, 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_lapack(Mat<eT>& out, const Mat<eT>& X); inline static bool inv_inplace_lapack(Mat<eT>& out);
// //
// det // det
template<typename eT> template<typename eT, typename T1>
inline static eT det(const Mat<eT>& 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); inline static eT det_lapack(const Mat<eT>& X, const bool make_copy);
// //
// log_det // log_det
template<typename eT> template<typename eT, typename T1>
inline static void log_det(eT& out_val, typename get_pod_type<eT>::result inline static void log_det(eT& out_val, typename get_pod_type<eT>::result
& out_sign, const Mat<eT>& X); & out_sign, const Base<eT,T1>& X);
// //
// lu // lu
template<typename eT> template<typename eT, typename T1>
inline static void lu(Mat<eT>& L, Mat<eT>& U, podarray<int>& ipiv, const inline static void lu(Mat<eT>& L, Mat<eT>& U, podarray<blas_int>& ipiv, c
Mat<eT>& X_orig); onst Base<eT,T1>& X);
template<typename eT> template<typename eT, typename T1>
inline static void lu(Mat<eT>& L, Mat<eT>& U, Mat<eT>& P, const Mat<eT>& inline static void lu(Mat<eT>& L, Mat<eT>& U, Mat<eT>& P, const Base<eT,T
X); 1>& X);
template<typename eT> template<typename eT, typename T1>
inline static void lu(Mat<eT>& L, Mat<eT>& U, const Mat<eT>& X); inline static void lu(Mat<eT>& L, Mat<eT>& U, const Base<eT,T1>& X);
// //
// eig // eig
template<typename eT> template<typename eT, typename T1>
inline static void eig_sym(Col<eT>& eigval, const Mat<eT>& A); inline static bool eig_sym(Col<eT>& eigval, const Base<eT,T1>& X);
template<typename T> template<typename T, typename T1>
inline static void eig_sym(Col<T>& eigval, const Mat< std::complex<T> >& inline static bool eig_sym(Col<T>& eigval, const Base<std::complex<T>,T1>
A); & X);
template<typename eT> template<typename eT, typename T1>
inline static void eig_sym(Col<eT>& eigval, Mat<eT>& eigvec, const Mat<eT inline static bool eig_sym(Col<eT>& eigval, Mat<eT>& eigvec, const Base<e
>& A); T,T1>& X);
template<typename T> template<typename T, typename T1>
inline static void eig_sym(Col<T>& eigval, Mat< std::complex<T> >& eigvec inline static bool eig_sym(Col<T>& eigval, Mat< std::complex<T> >& eigvec
, const Mat< std::complex<T> >& A); , const Base<std::complex<T>,T1>& X);
template<typename eT> template<typename T, typename T1>
inline static void eig_gen(Col< std::complex<eT> >& eigval, Mat<eT>& l_ei inline static bool eig_gen(Col< std::complex<T> >& eigval, Mat<T>& l_eigv
gvec, Mat<eT>& r_eigvec, const Mat<eT>& A, const char side); ec, Mat<T>& r_eigvec, const Base<T,T1>& X, const char side);
template<typename T> template<typename T, typename T1>
inline static void eig_gen(Col< std::complex<T> >& eigval, Mat< std::comp inline static bool eig_gen(Col< std::complex<T> >& eigval, Mat< std::comp
lex<T> >& l_eigvec, Mat< std::complex<T> >& r_eigvec, const Mat< std::compl lex<T> >& l_eigvec, Mat< std::complex<T> >& r_eigvec, const Base< std::comp
ex<T> >& A, const char side); lex<T>, T1 >& X, const char side);
// //
// chol // chol
template<typename eT> template<typename eT, typename T1>
inline static bool chol(Mat<eT>& out, const Mat<eT>& X); inline static bool chol(Mat<eT>& out, const Base<eT,T1>& X);
// //
// qr // qr
template<typename eT> template<typename eT, typename T1>
inline static bool qr(Mat<eT>& Q, Mat<eT>& R, const Mat<eT>& X); inline static bool qr(Mat<eT>& Q, Mat<eT>& R, const Base<eT,T1>& X);
// //
// svd // svd
template<typename eT> template<typename eT, typename T1>
inline static bool svd(Col<eT>& S, const Mat<eT>& X); inline static bool svd(Col<eT>& S, const Base<eT,T1>& X, u32& n_rows, u32
& n_cols);
template<typename T> template<typename T, typename T1>
inline static bool svd(Col<T>& S, const Mat< std::complex<T> >& X); inline static bool svd(Col<T>& S, const Base<std::complex<T>, T1>& X, u32
& n_rows, u32& n_cols);
template<typename eT> template<typename eT, typename T1>
inline static bool svd(Mat<eT>& U, Col<eT>& S, Mat<eT>& V, const Mat<eT>& inline static bool svd(Col<eT>& S, const Base<eT,T1>& X);
X);
template<typename T, typename T1>
inline static bool svd(Col<T>& S, const Base<std::complex<T>, T1>& X);
template<typename eT, typename T1>
inline static bool svd(Mat<eT>& U, Col<eT>& S, Mat<eT>& V, const Base<eT,
T1>& X);
template<typename T> template<typename T, typename T1>
inline static bool svd(Mat< std::complex<T> >& U, Col<T>& S, Mat< std::co inline static bool svd(Mat< std::complex<T> >& U, Col<T>& S, Mat< std::co
mplex<T> >& V, const Mat< std::complex<T> >& X); mplex<T> >& V, const Base< std::complex<T>, T1>& X);
// //
// solve // solve
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);
 End of changes. 23 change blocks. 
55 lines changed or deleted 63 lines changed or added


 blas_proto.hpp   blas_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
#ifdef ARMA_USE_BLAS #ifdef ARMA_USE_BLAS
//! \namespace blas namespace for BLAS functions //! \namespace blas namespace for BLAS functions
namespace blas namespace blas
{ {
extern "C" extern "C"
{ {
float sdot_(const blas_int* n, const float* x, const blas_int* incx, float arma_fortran(sdot)(const blas_int* n, const float* x, const bla
const float* y, const blas_int* incy); s_int* incx, const float* y, const blas_int* incy);
double ddot_(const blas_int* n, const double* x, const blas_int* incx, double arma_fortran(ddot)(const blas_int* n, const double* x, const bla
const double* y, const blas_int* incy); s_int* incx, const double* y, const blas_int* incy);
void sgemv_(const char* transA, const blas_int* m, const blas_int* n, c void arma_fortran(sgemv)(const char* transA, const blas_int* m, const b
onst float* alpha, const float* A, const blas_int* ldA, const float* x, las_int* n, const float* alpha, const float* A, const blas_int* ldA, cons
const blas_int* incx, const float* beta, float* y, const blas_int* incy); t float* x, const blas_int* incx, const float* beta, float* y, const bla
void dgemv_(const char* transA, const blas_int* m, const blas_int* n, c s_int* incy);
onst double* alpha, const double* A, const blas_int* ldA, const double* x, void arma_fortran(dgemv)(const char* transA, const blas_int* m, const b
const blas_int* incx, const double* beta, double* y, const blas_int* incy); las_int* n, const double* alpha, const double* A, const blas_int* ldA, cons
void cgemv_(const char* transA, const blas_int* m, const blas_int* n, c t double* x, const blas_int* incx, const double* beta, double* y, const bla
onst void* alpha, const void* A, const blas_int* ldA, const void* x, s_int* incy);
const blas_int* incx, const void* beta, void* y, const blas_int* incy); void arma_fortran(cgemv)(const char* transA, const blas_int* m, const b
void zgemv_(const char* transA, const blas_int* m, const blas_int* n, c las_int* n, const void* alpha, const void* A, const blas_int* ldA, cons
onst void* alpha, const void* A, const blas_int* ldA, const void* x, t void* x, const blas_int* incx, const void* beta, void* y, const bla
const blas_int* incx, const void* beta, void* y, const blas_int* incy); s_int* incy);
void arma_fortran(zgemv)(const char* transA, const blas_int* m, const b
void sgemm_(const char* transA, const char* transB, const blas_int* m, las_int* n, const void* alpha, const void* A, const blas_int* ldA, cons
const blas_int* n, const blas_int* k, const float* alpha, const float* A, t void* x, const blas_int* incx, const void* beta, void* y, const bla
const blas_int* ldA, const float* B, const blas_int* ldB, const float* b s_int* incy);
eta, float* C, const blas_int* ldC);
void dgemm_(const char* transA, const char* transB, const blas_int* m, void arma_fortran(sgemm)(const char* transA, const char* transB, const
const blas_int* n, const blas_int* k, const double* alpha, const double* A, blas_int* m, const blas_int* n, const blas_int* k, const float* alpha, con
const blas_int* ldA, const double* B, const blas_int* ldB, const double* b st float* A, const blas_int* ldA, const float* B, const blas_int* ldB, co
eta, double* C, const blas_int* ldC); nst float* beta, float* C, const blas_int* ldC);
void cgemm_(const char* transA, const char* transB, const blas_int* m, void arma_fortran(dgemm)(const char* transA, const char* transB, const
const blas_int* n, const blas_int* k, const void* alpha, const void* A, blas_int* m, const blas_int* n, const blas_int* k, const double* alpha, con
const blas_int* ldA, const void* B, const blas_int* ldB, const void* b st double* A, const blas_int* ldA, const double* B, const blas_int* ldB, co
eta, void* C, const blas_int* ldC); nst double* beta, double* C, const blas_int* ldC);
void zgemm_(const char* transA, const char* transB, const blas_int* m, void arma_fortran(cgemm)(const char* transA, const char* transB, const
const blas_int* n, const blas_int* k, const void* alpha, const void* A, blas_int* m, const blas_int* n, const blas_int* k, const void* alpha, con
const blas_int* ldA, const void* B, const blas_int* ldB, const void* b st void* A, const blas_int* ldA, const void* B, const blas_int* ldB, co
eta, void* C, const blas_int* ldC); nst void* beta, void* C, const blas_int* ldC);
void arma_fortran(zgemm)(const char* transA, const char* transB, const
// void dswap_(const blas_int* n, double* x, const blas_int* incx, do blas_int* m, const blas_int* n, const blas_int* k, const void* alpha, con
uble* y, const blas_int* incy); st void* A, const blas_int* ldA, const void* B, const blas_int* ldB, co
// void dscal_(const blas_int* n, const double* alpha, double* x, con nst void* beta, void* C, const blas_int* ldC);
st blas_int* incx);
// void dcopy_(const blas_int* n, const double* x, const blas_int* in // void arma_fortran(dswap)(const blas_int* n, double* x, const blas_
cx, double* y, const blas_int* incy); int* incx, double* y, const blas_int* incy);
// void daxpy_(const blas_int* n, const double* alpha, const double* // void arma_fortran(dscal)(const blas_int* n, const double* alpha, d
x, const blas_int* incx, double* y, const blas_int* incy); ouble* x, const blas_int* incx);
// void dger_(const blas_int* m, const blas_int* n, const double* al // void arma_fortran(dcopy)(const blas_int* n, const double* x, const
pha, const double* x, const blas_int* incx, const double* y, const blas_int blas_int* incx, double* y, const blas_int* incy);
* incy, double* A, const blas_int* ldA); // void arma_fortran(daxpy)(const blas_int* n, const double* alpha, c
onst double* x, const blas_int* incx, double* y, const blas_int* incy);
// void arma_fortran(dger)(const blas_int* m, const blas_int* n, con
st double* alpha, const double* x, const blas_int* incx, const double* y, c
onst blas_int* incy, double* A, const blas_int* ldA);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
eT eT
dot_(const blas_int* n, const eT* x, const eT* y) dot(const blas_int* n, const eT* x, const eT* y)
{ {
arma_type_check<is_supported_blas_type<eT>::value == false>::apply(); arma_type_check<is_supported_blas_type<eT>::value == false>::apply();
const blas_int inc = 1; const blas_int inc = 1;
if(is_float<eT>::value == true) if(is_float<eT>::value == true)
{ {
typedef float T; typedef float T;
return eT( sdot_(n, (const T*)x, &inc, (const T*)y, &inc) ); return eT( arma_fortran(sdot)(n, (const T*)x, &inc, (const T*)y, &inc ) );
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
return eT( ddot_(n, (const T*)x, &inc, (const T*)y, &inc) ); return eT( arma_fortran(ddot)(n, (const T*)x, &inc, (const T*)y, &inc ) );
} }
else else
{ {
return eT(0); // prevent compiler warnings return eT(0); // prevent compiler warnings
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
gemv_(const char* transA, const blas_int* m, const blas_int* n, const eT* alpha, const eT* A, const blas_int* ldA, const eT* x, const blas_int* incx , const eT* beta, eT* y, const blas_int* incy) gemv(const char* transA, const blas_int* m, const blas_int* n, const eT* alpha, const eT* A, const blas_int* ldA, const eT* x, const blas_int* incx, const eT* beta, eT* y, const blas_int* incy)
{ {
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;
sgemv_(transA, m, n, (const T*)alpha, (const T*)A, ldA, (const T*)x, incx, (const T*)beta, (T*)y, incy); arma_fortran(sgemv)(transA, m, n, (const T*)alpha, (const T*)A, ldA, (const T*)x, incx, (const T*)beta, (T*)y, incy);
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
dgemv_(transA, m, n, (const T*)alpha, (const T*)A, ldA, (const T*)x, incx, (const T*)beta, (T*)y, incy); arma_fortran(dgemv)(transA, m, n, (const T*)alpha, (const T*)A, ldA, (const T*)x, incx, (const T*)beta, (T*)y, incy);
} }
else else
if(is_supported_complex_float<eT>::value == true) if(is_supported_complex_float<eT>::value == true)
{ {
typedef std::complex<float> T; typedef std::complex<float> T;
cgemv_(transA, m, n, (const T*)alpha, (const T*)A, ldA, (const T*)x, incx, (const T*)beta, (T*)y, incy); arma_fortran(cgemv)(transA, m, n, (const T*)alpha, (const T*)A, ldA, (const T*)x, incx, (const T*)beta, (T*)y, incy);
} }
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;
zgemv_(transA, m, n, (const T*)alpha, (const T*)A, ldA, (const T*)x, incx, (const T*)beta, (T*)y, incy); arma_fortran(zgemv)(transA, m, n, (const T*)alpha, (const T*)A, ldA, (const T*)x, incx, (const T*)beta, (T*)y, incy);
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
gemm_(const char* transA, const char* transB, const blas_int* m, const bl as_int* n, const blas_int* k, const eT* alpha, const eT* A, const blas_int* ldA, const eT* B, const blas_int* ldB, const eT* beta, eT* C, const blas_i nt* ldC) gemm(const char* transA, const char* transB, const blas_int* m, const bla s_int* n, const blas_int* k, const eT* alpha, const eT* A, const blas_int* ldA, const eT* B, const blas_int* ldB, const eT* beta, eT* C, const blas_in t* ldC)
{ {
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;
sgemm_(transA, transB, m, n, k, (const T*)alpha, (const T*)A, ldA, (c onst T*)B, ldB, (const T*)beta, (T*)C, ldC); arma_fortran(sgemm)(transA, transB, m, n, k, (const T*)alpha, (const T*)A, ldA, (const T*)B, ldB, (const T*)beta, (T*)C, ldC);
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
dgemm_(transA, transB, m, n, k, (const T*)alpha, (const T*)A, ldA, (c onst T*)B, ldB, (const T*)beta, (T*)C, ldC); arma_fortran(dgemm)(transA, transB, m, n, k, (const T*)alpha, (const T*)A, ldA, (const T*)B, ldB, (const T*)beta, (T*)C, ldC);
} }
else else
if(is_supported_complex_float<eT>::value == true) if(is_supported_complex_float<eT>::value == true)
{ {
typedef std::complex<float> T; typedef std::complex<float> T;
cgemm_(transA, transB, m, n, k, (const T*)alpha, (const T*)A, ldA, (c onst T*)B, ldB, (const T*)beta, (T*)C, ldC); arma_fortran(cgemm)(transA, transB, m, n, k, (const T*)alpha, (const T*)A, ldA, (const T*)B, ldB, (const T*)beta, (T*)C, ldC);
} }
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;
zgemm_(transA, transB, m, n, k, (const T*)alpha, (const T*)A, ldA, (c onst T*)B, ldB, (const T*)beta, (T*)C, ldC); arma_fortran(zgemm)(transA, transB, m, n, k, (const T*)alpha, (const T*)A, ldA, (const T*)B, ldB, (const T*)beta, (T*)C, ldC);
} }
} }
} }
#endif #endif
 End of changes. 16 change blocks. 
63 lines changed or deleted 64 lines changed or added


 cmath_wrap.hpp   cmath_wrap.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 28 skipping to change at line 25
// //
// wrappers for isfinite // wrappers for isfinite
// //
template<typename eT> template<typename eT>
arma_inline arma_inline
bool bool
arma_isfinite(eT val) arma_isfinite(eT val)
{ {
arma_ignore(val);
return true; return true;
} }
template<> template<>
arma_inline arma_inline
bool bool
arma_isfinite(float x) arma_isfinite(float x)
{ {
#if defined(ARMA_HAVE_STD_ISFINITE) #if defined(ARMA_HAVE_STD_ISFINITE)
{ {
 End of changes. 2 change blocks. 
5 lines changed or deleted 4 lines changed or added


 compiler_setup.hpp   compiler_setup.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
#define arma_hot #define arma_hot
#define arma_cold #define arma_cold
#define arma_pure #define arma_pure
#define arma_const #define arma_const
#define arma_inline inline #define arma_inline inline
#define arma_aligned #define arma_aligned
#define arma_warn_unused #define arma_warn_unused
#define arma_deprecated #define arma_deprecated
#define arma_ignore(variable) ((void)(variable))
#define arma_fortran(function) function
#if defined(ARMA_BLAS_UNDERSCORE)
#undef arma_fortran
#define arma_fortran(function) function##_
#endif
#if defined(__GNUG__) #if defined(__GNUG__)
#if (__GNUC__ < 4) #if (__GNUC__ < 4)
#error "*** Need a newer compiler ***" #error "*** Need a newer compiler ***"
#endif #endif
#define ARMA_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNU C_PATCHLEVEL__) #define ARMA_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNU C_PATCHLEVEL__)
#define ARMA_GOOD_COMPILER #define ARMA_GOOD_COMPILER
skipping to change at line 120 skipping to change at line 124
#endif #endif
#if defined(__SUNPRO_CC) #if defined(__SUNPRO_CC)
#undef ARMA_HAVE_STD_ISFINITE #undef ARMA_HAVE_STD_ISFINITE
#undef ARMA_HAVE_STD_SNPRINTF #undef ARMA_HAVE_STD_SNPRINTF
#undef ARMA_HAVE_LOG1P #undef ARMA_HAVE_LOG1P
#undef ARMA_HAVE_STD_ISINF #undef ARMA_HAVE_STD_ISINF
#undef ARMA_HAVE_STD_ISNAN #undef ARMA_HAVE_STD_ISNAN
#undef ARMA_HAVE_STD_TR1 #undef ARMA_HAVE_STD_TR1
#endif #endif
//
// whoever defined macros with the names "min" and "max" should be permanen
tly removed from the gene pool
#if defined(min)
#undef min
#if defined(_MSC_VER)
#pragma message ("detected min macro and undefined it; you may wish to
define NOMINMAX before including any windows header")
#endif
#endif
#if defined(max)
#undef max
#if defined(_MSC_VER)
#pragma message ("detected max macro and undefined it; you may wish to
define NOMINMAX before including any windows header")
#endif
#endif
 End of changes. 3 change blocks. 
5 lines changed or deleted 9 lines changed or added


 config.hpp   config.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
#if !defined(ARMA_USE_LAPACK) #if !defined(ARMA_USE_LAPACK)
#define ARMA_USE_LAPACK #define ARMA_USE_LAPACK
#endif #endif
#if !defined(ARMA_USE_BLAS) #if !defined(ARMA_USE_BLAS)
#define ARMA_USE_BLAS #define ARMA_USE_BLAS
#endif #endif
// #define ARMA_BLAS_LONG
// uncomment the above line if your BLAS and LAPACK libraries use "long" in
stead of "int"
// #define ARMA_BLAS_LONG_LONG
// uncomment the above line if your BLAS and LAPACK libraries use "long lon
g" instead of "int"
#define ARMA_BLAS_UNDERSCORE
// uncomment the above line if your BLAS and LAPACK libraries have function
names with a trailing underscore
// conversely, comment it out if the function names don't have a trailing u
nderscore
#define ARMA_USE_ATLAS #define ARMA_USE_ATLAS
#define ARMA_ATLAS_INCLUDE_DIR /usr/include/ #define ARMA_ATLAS_INCLUDE_DIR /usr/include/
//// If you're using ATLAS and the compiler can't find cblas.h and/or clapa ck.h //// If you're using ATLAS and the compiler can't find cblas.h and/or clapa ck.h
//// uncomment the above define and specify the appropriate include directo ry. //// uncomment the above define and specify the appropriate include directo ry.
//// Make sure the directory has a trailing / //// Make sure the directory has a trailing /
#define ARMA_USE_BOOST #define ARMA_USE_BOOST
#define ARMA_USE_BOOST_DATE #define ARMA_USE_BOOST_DATE
#define ARMA_HAVE_STD_ISFINITE #define ARMA_HAVE_STD_ISFINITE
 End of changes. 2 change blocks. 
5 lines changed or deleted 16 lines changed or added


 constants.hpp   constants.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 debug.hpp   debug.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 672 skipping to change at line 669
namespace junk namespace junk
{ {
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;
std::cout << "@ ---" << '\n'; std::cout << "@ ---" << '\n';
std::cout << "@ Armadillo " << arma_version::major << '.' << arma_v std::cout << "@ Armadillo "
ersion::minor << '.' << arma_version::patch << '\n'; << arma_version::major << '.' << arma_version::minor << '
.' << arma_version::patch
<< " (" << nickname << ")\n";
std::cout << "@ arma_config::atlas = " << arma_config::atlas << '\n'; std::cout << "@ arma_config::atlas = " << arma_config::atlas << '\n';
std::cout << "@ arma_config::lapack = " << arma_config::lapack << '\n'; std::cout << "@ arma_config::lapack = " << arma_config::lapack << '\n';
std::cout << "@ arma_config::blas = " << arma_config::blas << '\n'; std::cout << "@ arma_config::blas = " << arma_config::blas << '\n';
std::cout << "@ arma_config::boost = " << arma_config::boost << '\n'; std::cout << "@ arma_config::boost = " << arma_config::boost << '\n';
std::cout << "@ arma_config::boost_date = " << arma_config::boost_d ate << '\n'; std::cout << "@ arma_config::boost_date = " << arma_config::boost_d ate << '\n';
std::cout << "@ arma_config::good_comp = " << arma_config::good_co mp << '\n'; std::cout << "@ arma_config::good_comp = " << arma_config::good_co mp << '\n';
std::cout << "@ arma_config::extra_code = " << arma_config::extra_c ode << '\n'; std::cout << "@ arma_config::extra_code = " << arma_config::extra_c ode << '\n';
std::cout << "@ sizeof(int) = " << sizeof(int) << '\n'; std::cout << "@ sizeof(void*) = " << sizeof(void*) << '\n';
std::cout << "@ sizeof(int*) = " << sizeof(int*) << '\n'; std::cout << "@ sizeof(int) = " << sizeof(int) << '\n';
std::cout << "@ sizeof(long) = " << sizeof(long) << '\n'; std::cout << "@ sizeof(long) = " << sizeof(long) << '\n';
std::cout << "@ sizeof(blas_int) = " << sizeof(blas_int) << '\n';
std::cout << "@ ---" << std::endl; std::cout << "@ ---" << 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. 4 change blocks. 
10 lines changed or deleted 13 lines changed or added


 diagmat_proxy.hpp   diagmat_proxy.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 132 skipping to change at line 129
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;
inline diagmat_proxy_check(const Base<typename T1::elem_type,T1>& X, cons t Mat<typename T1::elem_type>& out) inline diagmat_proxy_check(const Base<typename T1::elem_type,T1>& X, cons t Mat<typename T1::elem_type>& out)
: P(X.get_ref()) : P(X.get_ref())
, P_is_vec( (P.n_rows == 1) || (P.n_cols == 1) ) , P_is_vec( (P.n_rows == 1) || (P.n_cols == 1) )
, n_elem( P_is_vec ? P.n_elem : P.n_rows ) , n_elem( P_is_vec ? P.n_elem : P.n_rows )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(out);
arma_debug_check( (P_is_vec == false) && (P.n_rows != P.n_cols), "diagm at(): only vectors and square matrices are accepted" ); arma_debug_check( (P_is_vec == false) && (P.n_rows != P.n_cols), "diagm at(): only vectors and square matrices are accepted" );
} }
arma_inline elem_type operator[] (const u32 i) const { r eturn P_is_vec ? P[i] : P.at(i,i); } arma_inline elem_type operator[] (const u32 i) const { r eturn P_is_vec ? P[i] : P.at(i,i); }
arma_inline elem_type at (const u32 row, const u32 col) const { r eturn (row == col) ? ( P_is_vec ? P[row] : P.at(row,row) ) : elem_type(0); } arma_inline elem_type at (const u32 row, const u32 col) const { r eturn (row == col) ? ( P_is_vec ? P[row] : P.at(row,row) ) : elem_type(0); }
const Mat<elem_type> P; const Mat<elem_type> P;
const bool P_is_vec; const bool P_is_vec;
const u32 n_elem; const u32 n_elem;
}; };
 End of changes. 2 change blocks. 
5 lines changed or deleted 3 lines changed or added


 diagview_meat.hpp   diagview_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 64 skipping to change at line 61
//! set a diagonal of our matrix using a diagonal from a foreign matrix //! set a diagonal of our matrix using a diagonal from a foreign matrix
template<typename eT> template<typename eT>
inline inline
void void
diagview<eT>::operator= (const diagview<eT>& x) diagview<eT>::operator= (const diagview<eT>& x)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
diagview<eT>& t = *this; diagview<eT>& t = *this;
arma_debug_check( (t.n_elem != x.n_elem), "diagview::operator=(): diagona ls have incompatible lengths"); arma_debug_check( (t.n_elem != x.n_elem), "diagview: diagonals have incom patible lengths");
Mat<eT>& t_m = *(t.m_ptr); Mat<eT>& t_m = *(t.m_ptr);
const Mat<eT>& x_m = x.m; const Mat<eT>& x_m = x.m;
const u32 t_n_elem = t.n_elem; const u32 t_n_elem = t.n_elem;
const u32 t_row_offset = t.row_offset; const u32 t_row_offset = t.row_offset;
const u32 t_col_offset = t.col_offset; const u32 t_col_offset = t.col_offset;
const u32 x_row_offset = x.row_offset; const u32 x_row_offset = x.row_offset;
const u32 x_col_offset = x.col_offset; const u32 x_col_offset = x.col_offset;
skipping to change at line 99 skipping to change at line 96
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const unwrap<T1> tmp(o.get_ref()); const unwrap<T1> tmp(o.get_ref());
const Mat<eT>& x = tmp.M; const Mat<eT>& x = tmp.M;
diagview<eT>& t = *this; diagview<eT>& t = *this;
arma_debug_check arma_debug_check
( (
( (t.n_elem != x.n_elem) || (x.is_vec() == false) ), ( (t.n_elem != x.n_elem) || (x.is_vec() == false) ),
"diagview::operator=(): given object has incompatible size" "diagview: given object has incompatible size"
); );
Mat<eT>& t_m = *(t.m_ptr); Mat<eT>& t_m = *(t.m_ptr);
const u32 t_n_elem = t.n_elem; const u32 t_n_elem = t.n_elem;
const u32 t_row_offset = t.row_offset; const u32 t_row_offset = t.row_offset;
const u32 t_col_offset = t.col_offset; const u32 t_col_offset = t.col_offset;
const eT* x_mem = x.memptr(); const eT* x_mem = x.memptr();
skipping to change at line 132 skipping to change at line 129
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const unwrap<T1> tmp(o.get_ref()); const unwrap<T1> tmp(o.get_ref());
const Mat<eT>& x = tmp.M; const Mat<eT>& x = tmp.M;
diagview<eT>& t = *this; diagview<eT>& t = *this;
arma_debug_check arma_debug_check
( (
( (t.n_elem != x.n_elem) || (x.is_vec() == false) ), ( (t.n_elem != x.n_elem) || (x.is_vec() == false) ),
"diagview::operator=(): given object has incompatible size" "diagview: given object has incompatible size"
); );
Mat<eT>& t_m = *(t.m_ptr); Mat<eT>& t_m = *(t.m_ptr);
const u32 t_n_elem = t.n_elem; const u32 t_n_elem = t.n_elem;
const u32 t_row_offset = t.row_offset; const u32 t_row_offset = t.row_offset;
const u32 t_col_offset = t.col_offset; const u32 t_col_offset = t.col_offset;
const eT* x_mem = x.memptr(); const eT* x_mem = x.memptr();
skipping to change at line 165 skipping to change at line 162
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const unwrap<T1> tmp(o.get_ref()); const unwrap<T1> tmp(o.get_ref());
const Mat<eT>& x = tmp.M; const Mat<eT>& x = tmp.M;
diagview<eT>& t = *this; diagview<eT>& t = *this;
arma_debug_check arma_debug_check
( (
( (t.n_elem != x.n_elem) || (x.is_vec() == false) ), ( (t.n_elem != x.n_elem) || (x.is_vec() == false) ),
"diagview::operator=(): given object has incompatible size" "diagview: given object has incompatible size"
); );
Mat<eT>& t_m = *(t.m_ptr); Mat<eT>& t_m = *(t.m_ptr);
const u32 t_n_elem = t.n_elem; const u32 t_n_elem = t.n_elem;
const u32 t_row_offset = t.row_offset; const u32 t_row_offset = t.row_offset;
const u32 t_col_offset = t.col_offset; const u32 t_col_offset = t.col_offset;
const eT* x_mem = x.memptr(); const eT* x_mem = x.memptr();
skipping to change at line 198 skipping to change at line 195
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const unwrap<T1> tmp(o.get_ref()); const unwrap<T1> tmp(o.get_ref());
const Mat<eT>& x = tmp.M; const Mat<eT>& x = tmp.M;
diagview<eT>& t = *this; diagview<eT>& t = *this;
arma_debug_check arma_debug_check
( (
( (t.n_elem != x.n_elem) || (x.is_vec() == false) ), ( (t.n_elem != x.n_elem) || (x.is_vec() == false) ),
"diagview::operator=(): given object has incompatible size" "diagview: given object has incompatible size"
); );
Mat<eT>& t_m = *(t.m_ptr); Mat<eT>& t_m = *(t.m_ptr);
const u32 t_n_elem = t.n_elem; const u32 t_n_elem = t.n_elem;
const u32 t_row_offset = t.row_offset; const u32 t_row_offset = t.row_offset;
const u32 t_col_offset = t.col_offset; const u32 t_col_offset = t.col_offset;
const eT* x_mem = x.memptr(); const eT* x_mem = x.memptr();
skipping to change at line 231 skipping to change at line 228
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
const unwrap<T1> tmp(o.get_ref()); const unwrap<T1> tmp(o.get_ref());
const Mat<eT>& x = tmp.M; const Mat<eT>& x = tmp.M;
diagview<eT>& t = *this; diagview<eT>& t = *this;
arma_debug_check arma_debug_check
( (
( (t.n_elem != x.n_elem) || (x.is_vec() == false) ), ( (t.n_elem != x.n_elem) || (x.is_vec() == false) ),
"diagview::operator=(): given object has incompatible size" "diagview: given object has incompatible size"
); );
Mat<eT>& t_m = *(t.m_ptr); Mat<eT>& t_m = *(t.m_ptr);
const u32 t_n_elem = t.n_elem; const u32 t_n_elem = t.n_elem;
const u32 t_row_offset = t.row_offset; const u32 t_row_offset = t.row_offset;
const u32 t_col_offset = t.col_offset; const u32 t_col_offset = t.col_offset;
const eT* x_mem = x.memptr(); const eT* x_mem = x.memptr();
skipping to change at line 290 skipping to change at line 287
} }
//! X += Y.diagview(...) //! X += Y.diagview(...)
template<typename eT> template<typename eT>
inline inline
void void
diagview<eT>::plus_inplace(Mat<eT>& out, const diagview<eT>& in) diagview<eT>::plus_inplace(Mat<eT>& out, const diagview<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, 1, "matrix addition"); arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, 1, "additi on");
const Mat<eT>& in_m = in.m; const Mat<eT>& in_m = in.m;
const u32 in_n_elem = in.n_elem; const u32 in_n_elem = in.n_elem;
const u32 in_row_offset = in.row_offset; const u32 in_row_offset = in.row_offset;
const u32 in_col_offset = in.col_offset; const u32 in_col_offset = in.col_offset;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
for(u32 i=0; i<in_n_elem; ++i) for(u32 i=0; i<in_n_elem; ++i)
skipping to change at line 314 skipping to change at line 311
} }
//! X -= Y.diagview(...) //! X -= Y.diagview(...)
template<typename eT> template<typename eT>
inline inline
void void
diagview<eT>::minus_inplace(Mat<eT>& out, const diagview<eT>& in) diagview<eT>::minus_inplace(Mat<eT>& out, const diagview<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, 1, "matrix subtraction"); arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, 1, "subtra ction");
const Mat<eT>& in_m = in.m; const Mat<eT>& in_m = in.m;
const u32 in_n_elem = in.n_elem; const u32 in_n_elem = in.n_elem;
const u32 in_row_offset = in.row_offset; const u32 in_row_offset = in.row_offset;
const u32 in_col_offset = in.col_offset; const u32 in_col_offset = in.col_offset;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
for(u32 i=0; i<in_n_elem; ++i) for(u32 i=0; i<in_n_elem; ++i)
skipping to change at line 338 skipping to change at line 335
} }
//! X %= Y.submat(...) //! X %= Y.submat(...)
template<typename eT> template<typename eT>
inline inline
void void
diagview<eT>::schur_inplace(Mat<eT>& out, const diagview<eT>& in) diagview<eT>::schur_inplace(Mat<eT>& out, const diagview<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, 1, "elemen t-wise matrix multiplication"); arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, 1, "elemen t-wise multiplication");
const Mat<eT>& in_m = in.m; const Mat<eT>& in_m = in.m;
const u32 in_n_elem = in.n_elem; const u32 in_n_elem = in.n_elem;
const u32 in_row_offset = in.row_offset; const u32 in_row_offset = in.row_offset;
const u32 in_col_offset = in.col_offset; const u32 in_col_offset = in.col_offset;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
for(u32 i=0; i<in_n_elem; ++i) for(u32 i=0; i<in_n_elem; ++i)
skipping to change at line 362 skipping to change at line 359
} }
//! X /= Y.diagview(...) //! X /= Y.diagview(...)
template<typename eT> template<typename eT>
inline inline
void void
diagview<eT>::div_inplace(Mat<eT>& out, const diagview<eT>& in) diagview<eT>::div_inplace(Mat<eT>& out, const diagview<eT>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, 1, "elemen t-wise matrix division"); arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, 1, "elemen t-wise division");
const Mat<eT>& in_m = in.m; const Mat<eT>& in_m = in.m;
const u32 in_n_elem = in.n_elem; const u32 in_n_elem = in.n_elem;
const u32 in_row_offset = in.row_offset; const u32 in_row_offset = in.row_offset;
const u32 in_col_offset = in.col_offset; const u32 in_col_offset = in.col_offset;
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
for(u32 i=0; i<in_n_elem; ++i) for(u32 i=0; i<in_n_elem; ++i)
skipping to change at line 472 skipping to change at line 469
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
diagview<eT>::zeros() diagview<eT>::zeros()
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
Mat<eT>& x = (*m_ptr); (*this).fill(eT(0));
for(u32 i=0; i<n_elem; ++i)
{
x.at(i+row_offset, i+col_offset) = eT(0);
}
} }
template<typename eT> template<typename eT>
inline inline
void void
diagview<eT>::ones() diagview<eT>::ones()
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
Mat<eT>& x = (*m_ptr); (*this).fill(eT(1));
for(u32 i=0; i<n_elem; ++i)
{
x.at(i+row_offset, i+col_offset) = eT(1);
}
} }
//! @} //! @}
 End of changes. 13 change blocks. 
27 lines changed or deleted 14 lines changed or added


 diagview_proto.hpp   diagview_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// This file is part of the Armadillo C++ library. // This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup diagview //! \addtogroup diagview
//! @{ //! @{
//! Class for storing data required to extract and set the diagonals of a m atrix //! Class for storing data required to extract and set the diagonals of a m atrix
template<typename eT> template<typename eT>
class diagview : public Base<eT, diagview<eT> > class diagview : public Base<eT, diagview<eT> >
{ {
public: const Mat<eT>& m; public: arma_aligned const Mat<eT>& m;
protected: Mat<eT>* m_ptr; protected: arma_aligned Mat<eT>* m_ptr;
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;
const u32 row_offset; const u32 row_offset;
const u32 col_offset; const u32 col_offset;
const u32 n_rows; // equal to n_elem const u32 n_rows; // equal to n_elem
 End of changes. 2 change blocks. 
7 lines changed or deleted 4 lines changed or added


 diskio_meat.hpp   diskio_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Ian Cullinan
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Ian Cullinan (ian dot cullinan at nicta dot com dot au)
// //
// 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 32 skipping to change at line 29
//! A is one of: I (for integral types) or F (for floating point types). //! A is one of: I (for integral types) or F (for floating point types).
//! B is one of: U (for unsigned types), S (for signed types), N (for not a ppliable) or C (for complex types). //! B is one of: U (for unsigned types), S (for signed types), N (for not a ppliable) or C (for complex types).
//! XYZ specifies the width of each element in terms of bytes, e.g. "008" i ndicates eight bytes. //! XYZ specifies the width of each element in terms of bytes, e.g. "008" i ndicates eight bytes.
template<typename eT> template<typename eT>
inline inline
std::string std::string
diskio::gen_txt_header(const Mat<eT>& x) diskio::gen_txt_header(const Mat<eT>& x)
{ {
arma_type_check<diskio::is_supported_type<eT>::value == false>::apply(); arma_type_check<diskio::is_supported_type<eT>::value == false>::apply();
arma_ignore(x);
if(is_u8<eT>::value == true) if(is_u8<eT>::value == true)
{ {
return std::string("ARMA_MAT_TXT_IU001"); return std::string("ARMA_MAT_TXT_IU001");
} }
else else
if(is_s8<eT>::value == true) if(is_s8<eT>::value == true)
{ {
return std::string("ARMA_MAT_TXT_IS001"); return std::string("ARMA_MAT_TXT_IS001");
} }
else else
skipping to change at line 100 skipping to change at line 99
//! A is one of: I (for integral types) or F (for floating point types). //! A is one of: I (for integral types) or F (for floating point types).
//! B is one of: U (for unsigned types), S (for signed types), N (for not a ppliable) or C (for complex types). //! B is one of: U (for unsigned types), S (for signed types), N (for not a ppliable) or C (for complex types).
//! XYZ specifies the width of each element in terms of bytes, e.g. "008" i ndicates eight bytes. //! XYZ specifies the width of each element in terms of bytes, e.g. "008" i ndicates eight bytes.
template<typename eT> template<typename eT>
inline inline
std::string std::string
diskio::gen_bin_header(const Mat<eT>& x) diskio::gen_bin_header(const Mat<eT>& x)
{ {
arma_type_check<diskio::is_supported_type<eT>::value == false>::apply(); arma_type_check<diskio::is_supported_type<eT>::value == false>::apply();
arma_ignore(x);
if(is_u8<eT>::value == true) if(is_u8<eT>::value == true)
{ {
return std::string("ARMA_MAT_BIN_IU001"); return std::string("ARMA_MAT_BIN_IU001");
} }
else else
if(is_s8<eT>::value == true) if(is_s8<eT>::value == true)
{ {
return std::string("ARMA_MAT_BIN_IS001"); return std::string("ARMA_MAT_BIN_IS001");
} }
else else
skipping to change at line 168 skipping to change at line 169
//! A is one of: I (for integral types) or F (for floating point types). //! A is one of: I (for integral types) or F (for floating point types).
//! B is one of: U (for unsigned types), S (for signed types), N (for not a ppliable) or C (for complex types). //! B is one of: U (for unsigned types), S (for signed types), N (for not a ppliable) or C (for complex types).
//! XYZ specifies the width of each element in terms of bytes, e.g. "008" i ndicates eight bytes. //! XYZ specifies the width of each element in terms of bytes, e.g. "008" i ndicates eight bytes.
template<typename eT> template<typename eT>
inline inline
std::string std::string
diskio::gen_txt_header(const Cube<eT>& x) diskio::gen_txt_header(const Cube<eT>& x)
{ {
arma_type_check<diskio::is_supported_type<eT>::value == false>::apply(); arma_type_check<diskio::is_supported_type<eT>::value == false>::apply();
arma_ignore(x);
if(is_u8<eT>::value == true) if(is_u8<eT>::value == true)
{ {
return std::string("ARMA_CUB_TXT_IU001"); return std::string("ARMA_CUB_TXT_IU001");
} }
else else
if(is_s8<eT>::value == true) if(is_s8<eT>::value == true)
{ {
return std::string("ARMA_CUB_TXT_IS001"); return std::string("ARMA_CUB_TXT_IS001");
} }
else else
skipping to change at line 236 skipping to change at line 239
//! A is one of: I (for integral types) or F (for floating point types). //! A is one of: I (for integral types) or F (for floating point types).
//! B is one of: U (for unsigned types), S (for signed types), N (for not a ppliable) or C (for complex types). //! B is one of: U (for unsigned types), S (for signed types), N (for not a ppliable) or C (for complex types).
//! XYZ specifies the width of each element in terms of bytes, e.g. "008" i ndicates eight bytes. //! XYZ specifies the width of each element in terms of bytes, e.g. "008" i ndicates eight bytes.
template<typename eT> template<typename eT>
inline inline
std::string std::string
diskio::gen_bin_header(const Cube<eT>& x) diskio::gen_bin_header(const Cube<eT>& x)
{ {
arma_type_check<diskio::is_supported_type<eT>::value == false>::apply(); arma_type_check<diskio::is_supported_type<eT>::value == false>::apply();
arma_ignore(x);
if(is_u8<eT>::value == true) if(is_u8<eT>::value == true)
{ {
return std::string("ARMA_CUB_BIN_IU001"); return std::string("ARMA_CUB_BIN_IU001");
} }
else else
if(is_s8<eT>::value == true) if(is_s8<eT>::value == true)
{ {
return std::string("ARMA_CUB_BIN_IS001"); return std::string("ARMA_CUB_BIN_IS001");
} }
else else
 End of changes. 5 change blocks. 
6 lines changed or deleted 11 lines changed or added


 diskio_proto.hpp   diskio_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Ian Cullinan
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Ian Cullinan (ian dot cullinan at nicta dot com dot au)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 eGlueCube_meat.hpp   eGlueCube_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 eGlueCube_proto.hpp   eGlueCube_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 eGlue_meat.hpp   eGlue_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 eGlue_proto.hpp   eGlue_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 eOpCube_meat.hpp   eOpCube_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 eOpCube_proto.hpp   eOpCube_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 eOp_meat.hpp   eOp_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 eOp_proto.hpp   eOp_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 eglue_core_meat.hpp   eglue_core_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 373 skipping to change at line 370
out_mem[i] = P1[i] operator P2[i];\ out_mem[i] = P1[i] operator P2[i];\
}\ }\
} }
if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_appl ier(+); } if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_appl ier(+); }
else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_appl ier(-); } else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_appl ier(-); }
else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_appl ier(/); } else if(is_same_type<eglue_type, eglue_div >::value == true) { arma_appl ier(/); }
else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_appl ier(*); } else if(is_same_type<eglue_type, eglue_schur>::value == true) { arma_appl ier(*); }
else else
{ {
arma_stop("eglue_core::apply_proxy(): unhandled eglue_type"); arma_stop("eglue_core::apply(): unhandled eglue_type");
} }
} }
template<typename eglue_type> template<typename eglue_type>
template<typename T1, typename T2> template<typename T1, typename T2>
arma_hot arma_hot
inline inline
void void
eglue_core<eglue_type>::apply_inplace_plus(Cube<typename T1::elem_type>& ou t, const eGlueCube<T1, T2, eglue_type>& x) eglue_core<eglue_type>::apply_inplace_plus(Cube<typename T1::elem_type>& ou t, const eGlueCube<T1, T2, eglue_type>& x)
{ {
 End of changes. 2 change blocks. 
6 lines changed or deleted 3 lines changed or added


 eglue_core_proto.hpp   eglue_core_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 eop_aux.hpp   eop_aux.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 238 skipping to change at line 235
template<typename T1, typename T2> template<typename T1, typename T2>
arma_inline arma_inline
static static
typename arma_integral_only<T1>::result typename arma_integral_only<T1>::result
pow(const T1 base, const T2 exponent) pow(const T1 base, const T2 exponent)
{ {
return T1( std::pow( double(base), double(exponent) ) ); return T1( std::pow( double(base), double(exponent) ) );
} }
template<typename T1>
arma_inline
static
typename arma_float_or_cx_only<T1>::result
pow_int(const T1 base, const int exponent)
{
return std::pow(base, exponent);
}
template<typename T1>
arma_inline
static
typename arma_integral_only<T1>::result
pow_int(const T1 base, const int exponent)
{
return T1( std::pow( double(base), exponent) );
}
template<typename eT> template<typename eT>
arma_inline arma_inline
static static
typename arma_integral_only<eT>::result typename arma_integral_only<eT>::result
direct_eps(const eT x) direct_eps(const eT)
{ {
return eT(0); return eT(0);
} }
template<typename eT> template<typename eT>
inline inline
static static
typename arma_float_only<eT>::result typename arma_float_only<eT>::result
direct_eps(const eT x) direct_eps(const eT x)
{ {
 End of changes. 3 change blocks. 
24 lines changed or deleted 3 lines changed or added


 eop_core_meat.hpp   eop_core_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 626 skipping to change at line 623
// common // common
template<typename eop_type> template<typename eop_type>
template<typename eT> template<typename eT>
arma_hot arma_hot
arma_pure arma_pure
arma_inline arma_inline
eT eT
eop_core<eop_type>::process(const eT val, const eT k) eop_core<eop_type>::process(const eT val, const eT k)
{ {
arma_ignore(val);
arma_ignore(k);
arma_stop("eop_core::process(): unhandled eop_type"); arma_stop("eop_core::process(): unhandled eop_type");
return eT(0); return eT(0);
} }
template<> template<typename eT> arma_hot arma_const arma_inline eT template<> template<typename eT> arma_hot arma_const arma_inline eT
eop_core<eop_scalar_plus >::process(const eT val, const eT k) { return val + k; } eop_core<eop_scalar_plus >::process(const eT val, const eT k) { return val + k; }
template<> template<typename eT> arma_hot arma_const arma_inline eT template<> template<typename eT> arma_hot arma_const arma_inline eT
eop_core<eop_scalar_minus_pre >::process(const eT val, const eT k) { return k - val; } eop_core<eop_scalar_minus_pre >::process(const eT val, const eT k) { return k - val; }
skipping to change at line 649 skipping to change at line 649
template<> template<typename eT> arma_hot arma_const arma_inline eT template<> template<typename eT> arma_hot arma_const arma_inline eT
eop_core<eop_scalar_times >::process(const eT val, const eT k) { return val * k; } eop_core<eop_scalar_times >::process(const eT val, const eT k) { return val * k; }
template<> template<typename eT> arma_hot arma_const arma_inline eT template<> template<typename eT> arma_hot arma_const arma_inline eT
eop_core<eop_scalar_div_pre >::process(const eT val, const eT k) { return k / val; } eop_core<eop_scalar_div_pre >::process(const eT val, const eT k) { return k / val; }
template<> template<typename eT> arma_hot arma_const arma_inline eT template<> template<typename eT> arma_hot arma_const arma_inline eT
eop_core<eop_scalar_div_post >::process(const eT val, const eT k) { return val / k; } eop_core<eop_scalar_div_post >::process(const eT val, const eT k) { return val / k; }
template<> template<typename eT> arma_hot arma_const arma_inline eT template<> template<typename eT> arma_hot arma_const arma_inline eT
eop_core<eop_square >::process(const eT val, const eT k) { return val*val; } eop_core<eop_square >::process(const eT val, const eT ) { return val*val; }
template<> template<typename eT> arma_hot arma_const arma_inline eT template<> template<typename eT> arma_hot arma_const arma_inline eT
eop_core<eop_neg >::process(const eT val, const eT k) { return eop_aux::neg(val); } eop_core<eop_neg >::process(const eT val, const eT ) { return eop_aux::neg(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_sqrt >::process(const eT val, const eT k) { return eop_aux::sqrt(val); } eop_core<eop_sqrt >::process(const eT val, const eT ) { return eop_aux::sqrt(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_log >::process(const eT val, const eT k) { return eop_aux::log(val); } eop_core<eop_log >::process(const eT val, const eT ) { return eop_aux::log(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_log2 >::process(const eT val, const eT k) { return eop_aux::log2(val); } eop_core<eop_log2 >::process(const eT val, const eT ) { return eop_aux::log2(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_log10 >::process(const eT val, const eT k) { return eop_aux::log10(val); } eop_core<eop_log10 >::process(const eT val, const eT ) { return eop_aux::log10(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_trunc_log >::process(const eT val, const eT k) { return arma::trunc_log(val); } eop_core<eop_trunc_log >::process(const eT val, const eT ) { return arma::trunc_log(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_exp >::process(const eT val, const eT k) { return eop_aux::exp(val); } eop_core<eop_exp >::process(const eT val, const eT ) { return eop_aux::exp(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_exp2 >::process(const eT val, const eT k) { return eop_aux::exp2(val); } eop_core<eop_exp2 >::process(const eT val, const eT ) { return eop_aux::exp2(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_exp10 >::process(const eT val, const eT k) { return eop_aux::exp10(val); } eop_core<eop_exp10 >::process(const eT val, const eT ) { return eop_aux::exp10(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_trunc_exp >::process(const eT val, const eT k) { return arma::trunc_exp(val); } eop_core<eop_trunc_exp >::process(const eT val, const eT ) { return arma::trunc_exp(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_cos >::process(const eT val, const eT k) { return eop_aux::cos(val); } eop_core<eop_cos >::process(const eT val, const eT ) { return eop_aux::cos(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_sin >::process(const eT val, const eT k) { return eop_aux::sin(val); } eop_core<eop_sin >::process(const eT val, const eT ) { return eop_aux::sin(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_tan >::process(const eT val, const eT k) { return eop_aux::tan(val); } eop_core<eop_tan >::process(const eT val, const eT ) { return eop_aux::tan(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_acos >::process(const eT val, const eT k) { return eop_aux::acos(val); } eop_core<eop_acos >::process(const eT val, const eT ) { return eop_aux::acos(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_asin >::process(const eT val, const eT k) { return eop_aux::asin(val); } eop_core<eop_asin >::process(const eT val, const eT ) { return eop_aux::asin(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_atan >::process(const eT val, const eT k) { return eop_aux::atan(val); } eop_core<eop_atan >::process(const eT val, const eT ) { return eop_aux::atan(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_cosh >::process(const eT val, const eT k) { return eop_aux::cosh(val); } eop_core<eop_cosh >::process(const eT val, const eT ) { return eop_aux::cosh(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_sinh >::process(const eT val, const eT k) { return eop_aux::sinh(val); } eop_core<eop_sinh >::process(const eT val, const eT ) { return eop_aux::sinh(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_tanh >::process(const eT val, const eT k) { return eop_aux::tanh(val); } eop_core<eop_tanh >::process(const eT val, const eT ) { return eop_aux::tanh(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_acosh >::process(const eT val, const eT k) { return eop_aux::acosh(val); } eop_core<eop_acosh >::process(const eT val, const eT ) { return eop_aux::acosh(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_asinh >::process(const eT val, const eT k) { return eop_aux::asinh(val); } eop_core<eop_asinh >::process(const eT val, const eT ) { return eop_aux::asinh(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_atanh >::process(const eT val, const eT k) { return eop_aux::atanh(val); } eop_core<eop_atanh >::process(const eT val, const eT ) { return eop_aux::atanh(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_eps >::process(const eT val, const eT k) { return eop_aux::direct_eps(val); } eop_core<eop_eps >::process(const eT val, const eT ) { return eop_aux::direct_eps(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_abs >::process(const eT val, const eT k) { return eop_aux::arma_abs(val); } eop_core<eop_abs >::process(const eT val, const eT ) { return eop_aux::arma_abs(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_conj >::process(const eT val, const eT k) { return eop_aux::conj(val); } eop_core<eop_conj >::process(const eT val, const eT ) { return eop_aux::conj(val); }
template<> template<typename eT> arma_hot arma_pure arma_inline eT template<> template<typename eT> arma_hot arma_pure arma_inline eT
eop_core<eop_pow >::process(const eT val, const eT k) { return eop_aux::pow(val, k); } eop_core<eop_pow >::process(const eT val, const eT k) { return eop_aux::pow(val, k); }
//! @} //! @}
 End of changes. 28 change blocks. 
31 lines changed or deleted 31 lines changed or added


 eop_core_proto.hpp   eop_core_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 80 skipping to change at line 77
class eop_cosh : public eop_core<eop_cosh> {}; class eop_cosh : public eop_core<eop_cosh> {};
class eop_sinh : public eop_core<eop_sinh> {}; class eop_sinh : public eop_core<eop_sinh> {};
class eop_tanh : public eop_core<eop_tanh> {}; class eop_tanh : public eop_core<eop_tanh> {};
class eop_acosh : public eop_core<eop_acosh> {}; class eop_acosh : public eop_core<eop_acosh> {};
class eop_asinh : public eop_core<eop_asinh> {}; class eop_asinh : public eop_core<eop_asinh> {};
class eop_atanh : public eop_core<eop_atanh> {}; class eop_atanh : public eop_core<eop_atanh> {};
class eop_eps : public eop_core<eop_eps> {}; class eop_eps : public eop_core<eop_eps> {};
class eop_abs : public eop_core<eop_abs> {}; class eop_abs : public eop_core<eop_abs> {};
class eop_conj : public eop_core<eop_conj> {}; class eop_conj : public eop_core<eop_conj> {};
class eop_pow : public eop_core<eop_pow> {}; class eop_pow : public eop_core<eop_pow> {};
class eop_pow_int : public eop_core<eop_pow_int> {};
class eop_randu : public eop_core<eop_randu> {}; class eop_randu : public eop_core<eop_randu> {};
class eop_randn : public eop_core<eop_randn> {}; class eop_randn : public eop_core<eop_randn> {};
class eop_zeros : public eop_core<eop_zeros> {}; class eop_zeros : public eop_core<eop_zeros> {};
class eop_ones_full : public eop_core<eop_ones_full> {}; class eop_ones_full : public eop_core<eop_ones_full> {};
class eop_ones_diag : public eop_core<eop_ones_diag> {}; class eop_ones_diag : public eop_core<eop_ones_diag> {};
template<typename T1> struct is_generator { static const boo l value = false; }; template<typename T1> struct is_generator { static const boo l value = false; };
template<> struct is_generator<eop_randu> { static const boo l value = true; }; template<> struct is_generator<eop_randu> { static const boo l value = true; };
template<> struct is_generator<eop_randn> { static const boo l value = true; }; template<> struct is_generator<eop_randn> { static const boo l value = true; };
template<> struct is_generator<eop_zeros> { static const boo l value = true; }; template<> struct is_generator<eop_zeros> { static const boo l value = true; };
 End of changes. 2 change blocks. 
6 lines changed or deleted 2 lines changed or added


 field_meat.hpp   field_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Ian Cullinan
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Ian Cullinan (ian dot cullinan at nicta dot com dot au)
// //
// 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 1523 skipping to change at line 1520
return false; return false;
} }
} }
inline inline
bool bool
field_aux::save(const field< std::string >& x, const std::string& name, con st file_type type, std::string& err_msg) field_aux::save(const field< std::string >& x, const std::string& name, con st file_type type, std::string& err_msg)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(type);
err_msg.clear(); err_msg.clear();
return diskio::save_std_string(x, name); return diskio::save_std_string(x, name);
} }
inline inline
bool bool
field_aux::save(const field< std::string >& x, std::ostream& os, const file _type type, std::string& err_msg) field_aux::save(const field< std::string >& x, std::ostream& os, const file _type type, std::string& err_msg)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(type);
err_msg.clear(); err_msg.clear();
return diskio::save_std_string(x, os); return diskio::save_std_string(x, os);
} }
inline inline
bool bool
field_aux::load(field< std::string >& x, const std::string& name, const fil e_type type, std::string& err_msg) field_aux::load(field< std::string >& x, const std::string& name, const fil e_type type, std::string& err_msg)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(type);
return diskio::load_std_string(x, name, err_msg); return diskio::load_std_string(x, name, err_msg);
} }
inline inline
bool bool
field_aux::load(field< std::string >& x, std::istream& is, const file_type type, std::string& err_msg) field_aux::load(field< std::string >& x, std::istream& is, const file_type type, std::string& err_msg)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(type);
return diskio::load_std_string(x, is, err_msg); return diskio::load_std_string(x, is, err_msg);
} }
#ifdef ARMA_EXTRA_FIELD_MEAT #ifdef ARMA_EXTRA_FIELD_MEAT
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_FIELD_MEAT) #include ARMA_INCFILE_WRAP(ARMA_EXTRA_FIELD_MEAT)
#endif #endif
//! @} //! @}
 End of changes. 5 change blocks. 
6 lines changed or deleted 11 lines changed or added


 field_proto.hpp   field_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Ian Cullinan
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Ian Cullinan (ian dot cullinan at nicta dot com dot au)
// //
// 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 171 skipping to change at line 168
arma_aligned const field<oT>& M; arma_aligned const field<oT>& M;
arma_aligned u32 i; arma_aligned u32 i;
}; };
inline iterator begin(); inline iterator begin();
inline const_iterator begin() const; inline const_iterator begin() const;
inline iterator end(); inline iterator end();
inline const_iterator end() const; inline const_iterator end() const;
#ifdef ARMA_EXTRA_FIELD_PROTO
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_FIELD_PROTO)
#endif
private: private:
inline void init(const field<oT>& x); inline void init(const field<oT>& x);
inline void init(const u32 n_rows_in, const u32 n_cols_in); inline void init(const u32 n_rows_in, const u32 n_cols_in);
inline void delete_objects(); inline void delete_objects();
inline void create_objects(); inline void create_objects();
friend class field_aux; friend class field_aux;
friend class subview_field<oT>; friend class subview_field<oT>;
public:
#ifdef ARMA_EXTRA_FIELD_PROTO
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_FIELD_PROTO)
#endif
}; };
class field_aux class field_aux
{ {
public: public:
template<typename oT> inline static void reset_objects(field< oT >& x); template<typename oT> inline static void reset_objects(field< oT >& x);
template<typename eT> inline static void reset_objects(field< Mat<eT> >& x); template<typename eT> inline static void reset_objects(field< Mat<eT> >& x);
template<typename eT> inline static void reset_objects(field< Col<eT> >& x); template<typename eT> inline static void reset_objects(field< Col<eT> >& x);
template<typename eT> inline static void reset_objects(field< Row<eT> >& x); template<typename eT> inline static void reset_objects(field< Row<eT> >& x);
 End of changes. 3 change blocks. 
10 lines changed or deleted 9 lines changed or added


 fn_accu.hpp   fn_accu.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_as_scalar.hpp   fn_as_scalar.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_chol.hpp   fn_chol.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// This file is part of the Armadillo C++ library. // This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup fn_chol //! \addtogroup fn_chol
//! @{ //! @{
template<typename T1> template<typename T1>
inline inline
const Op<T1, op_chol> const Op<T1, op_chol>
chol(const Base<typename T1::elem_type,T1>& X, const typename arma_blas_typ e_only<typename T1::elem_type>::result* junk = 0) chol(const Base<typename T1::elem_type,T1>& X, const typename arma_blas_typ e_only<typename T1::elem_type>::result* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
return Op<T1, op_chol>(X.get_ref()); return Op<T1, op_chol>(X.get_ref());
} }
template<typename T1> template<typename T1>
inline inline
bool bool
chol(Mat<typename T1::elem_type>& out, const Base<typename T1::elem_type,T1 >& X, const typename arma_blas_type_only<typename T1::elem_type>::result* j unk = 0) chol(Mat<typename T1::elem_type>& out, const Base<typename T1::elem_type,T1 >& X, const typename arma_blas_type_only<typename T1::elem_type>::result* j unk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
out = chol(X); out = chol(X);
return (out.n_elem == 0) ? false : true; return (out.n_elem == 0) ? false : true;
} }
//! @} //! @}
 End of changes. 3 change blocks. 
5 lines changed or deleted 6 lines changed or added


 fn_conv.hpp   fn_conv.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_conv_to.hpp   fn_conv_to.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 47 skipping to change at line 44
}; };
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
out_eT out_eT
conv_to<out_eT>::from(const Base<in_eT, T1>& in, const typename arma_not_cx <in_eT>::result* junk) conv_to<out_eT>::from(const Base<in_eT, T1>& in, const typename arma_not_cx <in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
arma_type_check< is_supported_elem_type<out_eT>::value == false >::apply( ); arma_type_check< is_supported_elem_type<out_eT>::value == false >::apply( );
const unwrap<T1> tmp(in.get_ref()); const unwrap<T1> tmp(in.get_ref());
const Mat<in_eT>& X = tmp.M; const Mat<in_eT>& X = tmp.M;
arma_debug_check( (X.n_elem != 1), "conv_to(): given object doesn't have exactly one element" ); arma_debug_check( (X.n_elem != 1), "conv_to(): given object doesn't have exactly one element" );
return out_eT(X.mem[0]); return out_eT(X.mem[0]);
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
out_eT out_eT
conv_to<out_eT>::from(const Base<in_eT, T1>& in, const typename arma_cx_onl y<in_eT>::result* junk) conv_to<out_eT>::from(const Base<in_eT, T1>& in, const typename arma_cx_onl y<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
arma_type_check< is_supported_elem_type<out_eT>::value == false >::apply( ); arma_type_check< is_supported_elem_type<out_eT>::value == false >::apply( );
const unwrap<T1> tmp(in.get_ref()); const unwrap<T1> tmp(in.get_ref());
const Mat<in_eT>& X = tmp.M; const Mat<in_eT>& X = tmp.M;
arma_debug_check( (X.n_elem != 1), "conv_to(): given object doesn't have exactly one element" ); arma_debug_check( (X.n_elem != 1), "conv_to(): given object doesn't have exactly one element" );
out_eT out; out_eT out;
syslib::convert_cx_scalar(out, X.mem[0]); syslib::convert_cx_scalar(out, X.mem[0]);
skipping to change at line 87 skipping to change at line 88
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
out_eT out_eT
conv_to<out_eT>::from(const BaseCube<in_eT, T1>& in, const typename arma_no t_cx<in_eT>::result* junk) conv_to<out_eT>::from(const BaseCube<in_eT, T1>& in, const typename arma_no t_cx<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
arma_type_check< is_supported_elem_type<out_eT>::value == false >::apply( ); arma_type_check< is_supported_elem_type<out_eT>::value == false >::apply( );
const unwrap_cube<T1> tmp(in.get_ref()); const unwrap_cube<T1> tmp(in.get_ref());
const Cube<in_eT>& X = tmp.M; const Cube<in_eT>& X = tmp.M;
arma_debug_check( (X.n_elem != 1), "conv_to(): given object doesn't have exactly one element" ); arma_debug_check( (X.n_elem != 1), "conv_to(): given object doesn't have exactly one element" );
return out_eT(X.mem[0]); return out_eT(X.mem[0]);
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
out_eT out_eT
conv_to<out_eT>::from(const BaseCube<in_eT, T1>& in, const typename arma_cx _only<in_eT>::result* junk) conv_to<out_eT>::from(const BaseCube<in_eT, T1>& in, const typename arma_cx _only<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
arma_type_check< is_supported_elem_type<out_eT>::value == false >::apply( ); arma_type_check< is_supported_elem_type<out_eT>::value == false >::apply( );
const unwrap_cube<T1> tmp(in.get_ref()); const unwrap_cube<T1> tmp(in.get_ref());
const Cube<in_eT>& X = tmp.M; const Cube<in_eT>& X = tmp.M;
arma_debug_check( (X.n_elem != 1), "conv_to(): given object doesn't have exactly one element" ); arma_debug_check( (X.n_elem != 1), "conv_to(): given object doesn't have exactly one element" );
out_eT out; out_eT out;
syslib::convert_cx_scalar(out, X.mem[0]); syslib::convert_cx_scalar(out, X.mem[0]);
skipping to change at line 159 skipping to change at line 164
}; };
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
Mat<out_eT> Mat<out_eT>
conv_to< Mat<out_eT> >::from(const Base<in_eT, T1>& in, const typename arma _not_cx<in_eT>::result* junk) conv_to< Mat<out_eT> >::from(const Base<in_eT, T1>& in, const typename arma _not_cx<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const unwrap<T1> tmp(in.get_ref()); const unwrap<T1> tmp(in.get_ref());
const Mat<in_eT>& X = tmp.M; const Mat<in_eT>& X = tmp.M;
Mat<out_eT> out(X.n_rows, X.n_cols); Mat<out_eT> out(X.n_rows, X.n_cols);
syslib::copy_and_convert_elem( out.memptr(), X.memptr(), out.n_elem ); syslib::copy_and_convert_elem( out.memptr(), X.memptr(), out.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
Mat<out_eT> Mat<out_eT>
conv_to< Mat<out_eT> >::from(const Base<in_eT, T1>& in, const typename arma _cx_only<in_eT>::result* junk) conv_to< Mat<out_eT> >::from(const Base<in_eT, T1>& in, const typename arma _cx_only<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const unwrap<T1> tmp(in.get_ref()); const unwrap<T1> tmp(in.get_ref());
const Mat<in_eT>& X = tmp.M; const Mat<in_eT>& X = tmp.M;
Mat<out_eT> out(X.n_rows, X.n_cols); Mat<out_eT> out(X.n_rows, X.n_cols);
syslib::copy_and_convert_cx_elem( out.memptr(), X.memptr(), out.n_elem ); syslib::copy_and_convert_cx_elem( out.memptr(), X.memptr(), out.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Mat<out_eT> Mat<out_eT>
conv_to< Mat<out_eT> >::from(const std::vector<in_eT>& in, const typename a rma_not_cx<in_eT>::result* junk) conv_to< Mat<out_eT> >::from(const std::vector<in_eT>& in, const typename a rma_not_cx<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
Mat<out_eT> out(in.size(), 1); Mat<out_eT> out(in.size(), 1);
typename std::vector<in_eT>::const_iterator in_begin = in.begin(); typename std::vector<in_eT>::const_iterator in_begin = in.begin();
typename std::vector<in_eT>::const_iterator in_end = in.end(); typename std::vector<in_eT>::const_iterator in_end = in.end();
typename Mat<out_eT>::iterator out_begin = out.begin(); typename Mat<out_eT>::iterator out_begin = out.begin();
typename Mat<out_eT>::iterator out_end = out.end(); typename Mat<out_eT>::iterator out_end = out.end();
typename std::vector<in_eT>::const_iterator in_it; typename std::vector<in_eT>::const_iterator in_it;
typename Mat<out_eT>::iterator out_it; typename Mat<out_eT>::iterator out_it;
skipping to change at line 222 skipping to change at line 233
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Mat<out_eT> Mat<out_eT>
conv_to< Mat<out_eT> >::from(const std::vector<in_eT>& in, const typename a rma_cx_only<in_eT>::result* junk) conv_to< Mat<out_eT> >::from(const std::vector<in_eT>& in, const typename a rma_cx_only<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
Mat<out_eT> out(in.size(), 1); Mat<out_eT> out(in.size(), 1);
typename std::vector<in_eT>::const_iterator in_begin = in.begin(); typename std::vector<in_eT>::const_iterator in_begin = in.begin();
typename std::vector<in_eT>::const_iterator in_end = in.end(); typename std::vector<in_eT>::const_iterator in_end = in.end();
typename Mat<out_eT>::iterator out_begin = out.begin(); typename Mat<out_eT>::iterator out_begin = out.begin();
typename Mat<out_eT>::iterator out_end = out.end(); typename Mat<out_eT>::iterator out_end = out.end();
typename std::vector<in_eT>::const_iterator in_it; typename std::vector<in_eT>::const_iterator in_it;
typename Mat<out_eT>::iterator out_it; typename Mat<out_eT>::iterator out_it;
skipping to change at line 252 skipping to change at line 265
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Mat<out_eT> Mat<out_eT>
conv_to< Mat<out_eT> >::from(const itpp::Mat<in_eT>& in, const typename arm a_not_cx<in_eT>::result* junk) conv_to< Mat<out_eT> >::from(const itpp::Mat<in_eT>& in, const typename arm a_not_cx<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
Mat<out_eT> out(in.rows(), in.cols()); Mat<out_eT> out(in.rows(), in.cols());
syslib::copy_and_convert_elem( out.memptr(), in._data(), out.n_elem ); syslib::copy_and_convert_elem( out.memptr(), in._data(), out.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Mat<out_eT> Mat<out_eT>
conv_to< Mat<out_eT> >::from(const itpp::Mat<in_eT>& in, const typename arm a_cx_only<in_eT>::result* junk) conv_to< Mat<out_eT> >::from(const itpp::Mat<in_eT>& in, const typename arm a_cx_only<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
Mat<out_eT> out(in.rows(), in.cols()); Mat<out_eT> out(in.rows(), in.cols());
syslib::copy_and_convert_cx_elem( out.memptr(), in._data(), out.n_elem ); syslib::copy_and_convert_cx_elem( out.memptr(), in._data(), out.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Mat<out_eT> Mat<out_eT>
conv_to< Mat<out_eT> >::from(const itpp::Vec<in_eT>& in, const typename arm a_not_cx<in_eT>::result* junk) conv_to< Mat<out_eT> >::from(const itpp::Vec<in_eT>& in, const typename arm a_not_cx<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
Mat<out_eT> out(in.length(), 1); Mat<out_eT> out(in.length(), 1);
syslib::copy_and_convert_elem( out.memptr(), in._data(), out.n_elem ); syslib::copy_and_convert_elem( out.memptr(), in._data(), out.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Mat<out_eT> Mat<out_eT>
conv_to< Mat<out_eT> >::from(const itpp::Vec<in_eT>& in, const typename arm a_cx_only<in_eT>::result* junk) conv_to< Mat<out_eT> >::from(const itpp::Vec<in_eT>& in, const typename arm a_cx_only<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
Mat<out_eT> out(in.length(), 1); Mat<out_eT> out(in.length(), 1);
syslib::copy_and_convert_cx_elem( out.memptr(), in._data(), out.n_elem ); syslib::copy_and_convert_cx_elem( out.memptr(), in._data(), out.n_elem );
return out; return out;
} }
//! conversion to Armadillo row vectors from Armadillo Base objects, //! conversion to Armadillo row vectors from Armadillo Base objects,
//! as well as from std::vector, itpp::Mat and itpp::Vec //! as well as from std::vector, itpp::Mat and itpp::Vec
template<typename out_eT> template<typename out_eT>
skipping to change at line 344 skipping to change at line 365
}; };
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
Row<out_eT> Row<out_eT>
conv_to< Row<out_eT> >::from(const Base<in_eT, T1>& in, const typename arma _not_cx<in_eT>::result* junk) conv_to< Row<out_eT> >::from(const Base<in_eT, T1>& in, const typename arma _not_cx<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const unwrap<T1> tmp(in.get_ref()); const unwrap<T1> tmp(in.get_ref());
const Mat<in_eT>& X = tmp.M; const Mat<in_eT>& X = tmp.M;
arma_debug_check( (X.is_vec() == false), "conv_to(): given object can't b e interpreted as a vector" ); arma_debug_check( (X.is_vec() == false), "conv_to(): given object can't b e interpreted as a vector" );
Row<out_eT> out(X.n_elem); Row<out_eT> out(X.n_elem);
syslib::copy_and_convert_elem( out.memptr(), X.memptr(), out.n_elem ); syslib::copy_and_convert_elem( out.memptr(), X.memptr(), out.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
Row<out_eT> Row<out_eT>
conv_to< Row<out_eT> >::from(const Base<in_eT, T1>& in, const typename arma _cx_only<in_eT>::result* junk) conv_to< Row<out_eT> >::from(const Base<in_eT, T1>& in, const typename arma _cx_only<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const unwrap<T1> tmp(in.get_ref()); const unwrap<T1> tmp(in.get_ref());
const Mat<in_eT>& X = tmp.M; const Mat<in_eT>& X = tmp.M;
arma_debug_check( (X.is_vec() == false), "conv_to(): given object can't b e interpreted as a vector" ); arma_debug_check( (X.is_vec() == false), "conv_to(): given object can't b e interpreted as a vector" );
Row<out_eT> out(X.n_rows, X.n_cols); Row<out_eT> out(X.n_rows, X.n_cols);
syslib::copy_and_convert_cx_elem( out.memptr(), X.memptr(), out.n_elem ); syslib::copy_and_convert_cx_elem( out.memptr(), X.memptr(), out.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Row<out_eT> Row<out_eT>
conv_to< Row<out_eT> >::from(const std::vector<in_eT>& in, const typename a rma_not_cx<in_eT>::result* junk) conv_to< Row<out_eT> >::from(const std::vector<in_eT>& in, const typename a rma_not_cx<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
Row<out_eT> out( in.size() ); Row<out_eT> out( in.size() );
typename std::vector<in_eT>::const_iterator in_begin = in.begin(); typename std::vector<in_eT>::const_iterator in_begin = in.begin();
typename std::vector<in_eT>::const_iterator in_end = in.end(); typename std::vector<in_eT>::const_iterator in_end = in.end();
typename Col<out_eT>::iterator out_begin = out.begin(); typename Col<out_eT>::iterator out_begin = out.begin();
typename Col<out_eT>::iterator out_end = out.end(); typename Col<out_eT>::iterator out_end = out.end();
typename std::vector<in_eT>::const_iterator in_it; typename std::vector<in_eT>::const_iterator in_it;
typename Col<out_eT>::iterator out_it; typename Col<out_eT>::iterator out_it;
skipping to change at line 411 skipping to change at line 438
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Row<out_eT> Row<out_eT>
conv_to< Row<out_eT> >::from(const std::vector<in_eT>& in, const typename a rma_cx_only<in_eT>::result* junk) conv_to< Row<out_eT> >::from(const std::vector<in_eT>& in, const typename a rma_cx_only<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
Row<out_eT> out( in.size() ); Row<out_eT> out( in.size() );
typename std::vector<in_eT>::const_iterator in_begin = in.begin(); typename std::vector<in_eT>::const_iterator in_begin = in.begin();
typename std::vector<in_eT>::const_iterator in_end = in.end(); typename std::vector<in_eT>::const_iterator in_end = in.end();
typename Col<out_eT>::iterator out_begin = out.begin(); typename Col<out_eT>::iterator out_begin = out.begin();
typename Col<out_eT>::iterator out_end = out.end(); typename Col<out_eT>::iterator out_end = out.end();
typename std::vector<in_eT>::const_iterator in_it; typename std::vector<in_eT>::const_iterator in_it;
typename Col<out_eT>::iterator out_it; typename Col<out_eT>::iterator out_it;
skipping to change at line 441 skipping to change at line 470
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Row<out_eT> Row<out_eT>
conv_to< Row<out_eT> >::from(const itpp::Mat<in_eT>& in, const typename arm a_not_cx<in_eT>::result* junk) conv_to< Row<out_eT> >::from(const itpp::Mat<in_eT>& in, const typename arm a_not_cx<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const bool is_vec = ( (in.rows() == 1) || (in.cols() == 1) ); const bool is_vec = ( (in.rows() == 1) || (in.cols() == 1) );
arma_debug_check( (is_vec == false), "conv_to(): given object can't be in terpreted as a vector" ); arma_debug_check( (is_vec == false), "conv_to(): given object can't be in terpreted as a vector" );
Row<out_eT> out(in.rows() * in.cols()); Row<out_eT> out(in.rows() * in.cols());
syslib::copy_and_convert_elem( out.memptr(), in._data(), out.n_elem ); syslib::copy_and_convert_elem( out.memptr(), in._data(), out.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Row<out_eT> Row<out_eT>
conv_to< Row<out_eT> >::from(const itpp::Mat<in_eT>& in, const typename arm a_cx_only<in_eT>::result* junk) conv_to< Row<out_eT> >::from(const itpp::Mat<in_eT>& in, const typename arm a_cx_only<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const bool is_vec = ( (in.rows() == 1) || (in.cols() == 1) ); const bool is_vec = ( (in.rows() == 1) || (in.cols() == 1) );
Row<out_eT> out(in.rows() * in.cols()); Row<out_eT> out(in.rows() * in.cols());
syslib::copy_and_convert_cx_elem( out.memptr(), in._data(), out.n_elem ); syslib::copy_and_convert_cx_elem( out.memptr(), in._data(), out.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Row<out_eT> Row<out_eT>
conv_to< Row<out_eT> >::from(const itpp::Vec<in_eT>& in, const typename arm a_not_cx<in_eT>::result* junk) conv_to< Row<out_eT> >::from(const itpp::Vec<in_eT>& in, const typename arm a_not_cx<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
Row<out_eT> out(in.length()); Row<out_eT> out(in.length());
syslib::copy_and_convert_elem( out.memptr(), in._data(), out.n_elem ); syslib::copy_and_convert_elem( out.memptr(), in._data(), out.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Row<out_eT> Row<out_eT>
conv_to< Row<out_eT> >::from(const itpp::Vec<in_eT>& in, const typename arm a_cx_only<in_eT>::result* junk) conv_to< Row<out_eT> >::from(const itpp::Vec<in_eT>& in, const typename arm a_cx_only<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
Row<out_eT> out(in.length()); Row<out_eT> out(in.length());
syslib::copy_and_convert_cx_elem( out.memptr(), in._data(), out.n_elem ); syslib::copy_and_convert_cx_elem( out.memptr(), in._data(), out.n_elem );
return out; return out;
} }
//! conversion to Armadillo column vectors from Armadillo Base objects, //! conversion to Armadillo column vectors from Armadillo Base objects,
//! as well as from std::vector, itpp::Mat and itpp::Vec //! as well as from std::vector, itpp::Mat and itpp::Vec
template<typename out_eT> template<typename out_eT>
skipping to change at line 539 skipping to change at line 576
}; };
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
Col<out_eT> Col<out_eT>
conv_to< Col<out_eT> >::from(const Base<in_eT, T1>& in, const typename arma _not_cx<in_eT>::result* junk) conv_to< Col<out_eT> >::from(const Base<in_eT, T1>& in, const typename arma _not_cx<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const unwrap<T1> tmp(in.get_ref()); const unwrap<T1> tmp(in.get_ref());
const Mat<in_eT>& X = tmp.M; const Mat<in_eT>& X = tmp.M;
arma_debug_check( (X.is_vec() == false), "conv_to(): given object can't b e interpreted as a vector" ); arma_debug_check( (X.is_vec() == false), "conv_to(): given object can't b e interpreted as a vector" );
Col<out_eT> out(X.n_elem); Col<out_eT> out(X.n_elem);
syslib::copy_and_convert_elem( out.memptr(), X.memptr(), out.n_elem ); syslib::copy_and_convert_elem( out.memptr(), X.memptr(), out.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
Col<out_eT> Col<out_eT>
conv_to< Col<out_eT> >::from(const Base<in_eT, T1>& in, const typename arma _cx_only<in_eT>::result* junk) conv_to< Col<out_eT> >::from(const Base<in_eT, T1>& in, const typename arma _cx_only<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const unwrap<T1> tmp(in.get_ref()); const unwrap<T1> tmp(in.get_ref());
const Mat<in_eT>& X = tmp.M; const Mat<in_eT>& X = tmp.M;
arma_debug_check( (X.is_vec() == false), "conv_to(): given object can't b e interpreted as a vector" ); arma_debug_check( (X.is_vec() == false), "conv_to(): given object can't b e interpreted as a vector" );
Col<out_eT> out(X.n_rows, X.n_cols); Col<out_eT> out(X.n_rows, X.n_cols);
syslib::copy_and_convert_cx_elem( out.memptr(), X.memptr(), out.n_elem ); syslib::copy_and_convert_cx_elem( out.memptr(), X.memptr(), out.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Col<out_eT> Col<out_eT>
conv_to< Col<out_eT> >::from(const std::vector<in_eT>& in, const typename a rma_not_cx<in_eT>::result* junk) conv_to< Col<out_eT> >::from(const std::vector<in_eT>& in, const typename a rma_not_cx<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
Col<out_eT> out( in.size() ); Col<out_eT> out( in.size() );
typename std::vector<in_eT>::const_iterator in_begin = in.begin(); typename std::vector<in_eT>::const_iterator in_begin = in.begin();
typename std::vector<in_eT>::const_iterator in_end = in.end(); typename std::vector<in_eT>::const_iterator in_end = in.end();
typename Col<out_eT>::iterator out_begin = out.begin(); typename Col<out_eT>::iterator out_begin = out.begin();
typename Col<out_eT>::iterator out_end = out.end(); typename Col<out_eT>::iterator out_end = out.end();
typename std::vector<in_eT>::const_iterator in_it; typename std::vector<in_eT>::const_iterator in_it;
typename Col<out_eT>::iterator out_it; typename Col<out_eT>::iterator out_it;
skipping to change at line 606 skipping to change at line 649
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Col<out_eT> Col<out_eT>
conv_to< Col<out_eT> >::from(const std::vector<in_eT>& in, const typename a rma_cx_only<in_eT>::result* junk) conv_to< Col<out_eT> >::from(const std::vector<in_eT>& in, const typename a rma_cx_only<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
Col<out_eT> out( in.size() ); Col<out_eT> out( in.size() );
typename std::vector<in_eT>::const_iterator in_begin = in.begin(); typename std::vector<in_eT>::const_iterator in_begin = in.begin();
typename std::vector<in_eT>::const_iterator in_end = in.end(); typename std::vector<in_eT>::const_iterator in_end = in.end();
typename Col<out_eT>::iterator out_begin = out.begin(); typename Col<out_eT>::iterator out_begin = out.begin();
typename Col<out_eT>::iterator out_end = out.end(); typename Col<out_eT>::iterator out_end = out.end();
typename std::vector<in_eT>::const_iterator in_it; typename std::vector<in_eT>::const_iterator in_it;
typename Col<out_eT>::iterator out_it; typename Col<out_eT>::iterator out_it;
skipping to change at line 636 skipping to change at line 681
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Col<out_eT> Col<out_eT>
conv_to< Col<out_eT> >::from(const itpp::Mat<in_eT>& in, const typename arm a_not_cx<in_eT>::result* junk) conv_to< Col<out_eT> >::from(const itpp::Mat<in_eT>& in, const typename arm a_not_cx<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const bool is_vec = ( (in.rows() == 1) || (in.cols() == 1) ); const bool is_vec = ( (in.rows() == 1) || (in.cols() == 1) );
arma_debug_check( (is_vec == false), "conv_to(): given object can't be in terpreted as a vector" ); arma_debug_check( (is_vec == false), "conv_to(): given object can't be in terpreted as a vector" );
Col<out_eT> out(in.rows() * in.cols()); Col<out_eT> out(in.rows() * in.cols());
syslib::copy_and_convert_elem( out.memptr(), in._data(), out.n_elem ); syslib::copy_and_convert_elem( out.memptr(), in._data(), out.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Col<out_eT> Col<out_eT>
conv_to< Col<out_eT> >::from(const itpp::Mat<in_eT>& in, const typename arm a_cx_only<in_eT>::result* junk) conv_to< Col<out_eT> >::from(const itpp::Mat<in_eT>& in, const typename arm a_cx_only<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const bool is_vec = ( (in.rows() == 1) || (in.cols() == 1) ); const bool is_vec = ( (in.rows() == 1) || (in.cols() == 1) );
Col<out_eT> out(in.rows() * in.cols()); Col<out_eT> out(in.rows() * in.cols());
syslib::copy_and_convert_cx_elem( out.memptr(), in._data(), out.n_elem ); syslib::copy_and_convert_cx_elem( out.memptr(), in._data(), out.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Col<out_eT> Col<out_eT>
conv_to< Col<out_eT> >::from(const itpp::Vec<in_eT>& in, const typename arm a_not_cx<in_eT>::result* junk) conv_to< Col<out_eT> >::from(const itpp::Vec<in_eT>& in, const typename arm a_not_cx<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
Col<out_eT> out( in.length() ); Col<out_eT> out( in.length() );
syslib::copy_and_convert_elem( out.memptr(), in._data(), out.n_elem ); syslib::copy_and_convert_elem( out.memptr(), in._data(), out.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT> template<typename in_eT>
inline inline
Col<out_eT> Col<out_eT>
conv_to< Col<out_eT> >::from(const itpp::Vec<in_eT>& in, const typename arm a_cx_only<in_eT>::result* junk) conv_to< Col<out_eT> >::from(const itpp::Vec<in_eT>& in, const typename arm a_cx_only<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
Col<out_eT> out( in.length() ); Col<out_eT> out( in.length() );
syslib::copy_and_convert_cx_elem( out.memptr(), in._data(), out.n_elem ); syslib::copy_and_convert_cx_elem( out.memptr(), in._data(), out.n_elem );
return out; return out;
} }
//! conversion to Armadillo cubes from Armadillo BaseCube objects //! conversion to Armadillo cubes from Armadillo BaseCube objects
template<typename out_eT> template<typename out_eT>
class conv_to< Cube<out_eT> > class conv_to< Cube<out_eT> >
skipping to change at line 715 skipping to change at line 768
}; };
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
Cube<out_eT> Cube<out_eT>
conv_to< Cube<out_eT> >::from(const BaseCube<in_eT, T1>& in, const typename arma_not_cx<in_eT>::result* junk) conv_to< Cube<out_eT> >::from(const BaseCube<in_eT, T1>& in, const typename arma_not_cx<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const unwrap_cube<T1> tmp( in.get_ref() ); const unwrap_cube<T1> tmp( in.get_ref() );
const Cube<in_eT>& X = tmp.M; const Cube<in_eT>& X = tmp.M;
Cube<out_eT> out(X.n_rows, X.n_cols, X.n_slices); Cube<out_eT> out(X.n_rows, X.n_cols, X.n_slices);
syslib::copy_and_convert_elem( out.memptr(), X.memptr(), out.n_elem ); syslib::copy_and_convert_elem( out.memptr(), X.memptr(), out.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
Cube<out_eT> Cube<out_eT>
conv_to< Cube<out_eT> >::from(const BaseCube<in_eT, T1>& in, const typename arma_cx_only<in_eT>::result* junk) conv_to< Cube<out_eT> >::from(const BaseCube<in_eT, T1>& in, const typename arma_cx_only<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const unwrap_cube<T1> tmp( in.get_ref() ); const unwrap_cube<T1> tmp( in.get_ref() );
const Cube<in_eT>& X = tmp.M; const Cube<in_eT>& X = tmp.M;
Cube<out_eT> out(X.n_rows, X.n_cols, X.n_slices); Cube<out_eT> out(X.n_rows, X.n_cols, X.n_slices);
syslib::copy_and_convert_cx_elem( out.memptr(), X.memptr(), out.n_elem ); syslib::copy_and_convert_cx_elem( out.memptr(), X.memptr(), out.n_elem );
return out; return out;
} }
skipping to change at line 764 skipping to change at line 821
}; };
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
std::vector<out_eT> std::vector<out_eT>
conv_to< std::vector<out_eT> >::from(const Base<in_eT, T1>& in, const typen ame arma_not_cx<in_eT>::result* junk) conv_to< std::vector<out_eT> >::from(const Base<in_eT, T1>& in, const typen ame arma_not_cx<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const unwrap<T1> tmp(in.get_ref()); const unwrap<T1> tmp(in.get_ref());
const Mat<in_eT>& X = tmp.M; const Mat<in_eT>& X = tmp.M;
arma_debug_check( (X.is_vec() == false), "conv_to(): given object can't b e interpreted as a vector" ); arma_debug_check( (X.is_vec() == false), "conv_to(): given object can't b e interpreted as a vector" );
std::vector<out_eT> out(X.n_elem); std::vector<out_eT> out(X.n_elem);
typename Mat<in_eT>::const_iterator X_begin = X.begin(); typename Mat<in_eT>::const_iterator X_begin = X.begin();
typename Mat<in_eT>::const_iterator X_end = X.end(); typename Mat<in_eT>::const_iterator X_end = X.end();
skipping to change at line 796 skipping to change at line 855
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
std::vector<out_eT> std::vector<out_eT>
conv_to< std::vector<out_eT> >::from(const Base<in_eT, T1>& in, const typen ame arma_cx_only<in_eT>::result* junk) conv_to< std::vector<out_eT> >::from(const Base<in_eT, T1>& in, const typen ame arma_cx_only<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const unwrap<T1> tmp(in.get_ref()); const unwrap<T1> tmp(in.get_ref());
const Mat<in_eT>& X = tmp.M; const Mat<in_eT>& X = tmp.M;
arma_debug_check( (X.is_vec() == false), "conv_to(): given object can't b e interpreted as a vector" ); arma_debug_check( (X.is_vec() == false), "conv_to(): given object can't b e interpreted as a vector" );
std::vector<out_eT> out(X.n_elem); std::vector<out_eT> out(X.n_elem);
typename Mat<in_eT>::const_iterator X_begin = X.begin(); typename Mat<in_eT>::const_iterator X_begin = X.begin();
typename Mat<in_eT>::const_iterator X_end = X.end(); typename Mat<in_eT>::const_iterator X_end = X.end();
skipping to change at line 844 skipping to change at line 905
}; };
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
itpp::Mat<out_eT> itpp::Mat<out_eT>
conv_to< itpp::Mat<out_eT> >::from(const Base<in_eT, T1>& in, const typenam e arma_not_cx<in_eT>::result* junk) conv_to< itpp::Mat<out_eT> >::from(const Base<in_eT, T1>& in, const typenam e arma_not_cx<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const unwrap<T1> tmp( in.get_ref() ); const unwrap<T1> tmp( in.get_ref() );
const Mat<in_eT>& X = tmp.M; const Mat<in_eT>& X = tmp.M;
itpp::Mat<out_eT> out(X.n_rows, X.n_cols); itpp::Mat<out_eT> out(X.n_rows, X.n_cols);
syslib::copy_and_convert_elem( out._data(), X.memptr(), X.n_elem ); syslib::copy_and_convert_elem( out._data(), X.memptr(), X.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
itpp::Mat<out_eT> itpp::Mat<out_eT>
conv_to< itpp::Mat<out_eT> >::from(const Base<in_eT, T1>& in, const typenam e arma_cx_only<in_eT>::result* junk) conv_to< itpp::Mat<out_eT> >::from(const Base<in_eT, T1>& in, const typenam e arma_cx_only<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const unwrap<T1> tmp( in.get_ref() ); const unwrap<T1> tmp( in.get_ref() );
const Mat<in_eT>& X = tmp.M; const Mat<in_eT>& X = tmp.M;
itpp::Mat<out_eT> out(X.n_rows, X.n_cols); itpp::Mat<out_eT> out(X.n_rows, X.n_cols);
syslib::copy_and_convert_cx_elem( out._data(), X.memptr(), X.n_elem ); syslib::copy_and_convert_cx_elem( out._data(), X.memptr(), X.n_elem );
return out; return out;
} }
skipping to change at line 893 skipping to change at line 958
}; };
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
itpp::Vec<out_eT> itpp::Vec<out_eT>
conv_to< itpp::Vec<out_eT> >::from(const Base<in_eT, T1>& in, const typenam e arma_not_cx<in_eT>::result* junk) conv_to< itpp::Vec<out_eT> >::from(const Base<in_eT, T1>& in, const typenam e arma_not_cx<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const unwrap<T1> tmp( in.get_ref() ); const unwrap<T1> tmp( in.get_ref() );
const Mat<in_eT>& X = tmp.M; const Mat<in_eT>& X = tmp.M;
arma_debug_check( (X.is_vec() == false), "conv_to(): given object can't b e interpreted as a vector" ); arma_debug_check( (X.is_vec() == false), "conv_to(): given object can't b e interpreted as a vector" );
itpp::Vec<out_eT> out(X.n_elem); itpp::Vec<out_eT> out(X.n_elem);
syslib::copy_and_convert_elem( out._data(), X.memptr(), X.n_elem ); syslib::copy_and_convert_elem( out._data(), X.memptr(), X.n_elem );
return out; return out;
} }
template<typename out_eT> template<typename out_eT>
template<typename in_eT, typename T1> template<typename in_eT, typename T1>
inline inline
itpp::Vec<out_eT> itpp::Vec<out_eT>
conv_to< itpp::Vec<out_eT> >::from(const Base<in_eT, T1>& in, const typenam e arma_cx_only<in_eT>::result* junk) conv_to< itpp::Vec<out_eT> >::from(const Base<in_eT, T1>& in, const typenam e arma_cx_only<in_eT>::result* junk)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
const unwrap<T1> tmp( in.get_ref() ); const unwrap<T1> tmp( in.get_ref() );
const Mat<in_eT>& X = tmp.M; const Mat<in_eT>& X = tmp.M;
itpp::Vec<out_eT> out(X.n_elem); itpp::Vec<out_eT> out(X.n_elem);
syslib::copy_and_convert_cx_elem( out._data(), X.memptr(), X.n_elem ); syslib::copy_and_convert_cx_elem( out._data(), X.memptr(), X.n_elem );
return out; return out;
} }
 End of changes. 37 change blocks. 
5 lines changed or deleted 74 lines changed or added


 fn_cor.hpp   fn_cor.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 fn_cov.hpp   fn_cov.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 fn_cross.hpp   fn_cross.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_det.hpp   fn_det.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 28 skipping to change at line 25
//! determinant of mat //! determinant of mat
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
typename T1::elem_type typename T1::elem_type
det(const Base<typename T1::elem_type,T1>& X, const typename arma_blas_type _only<typename T1::elem_type>::result* junk = 0) det(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();
typedef typename T1::elem_type eT; arma_ignore(junk);
const unwrap<T1> tmp(X.get_ref());
const Mat<eT>& A = tmp.M;
arma_debug_check( !A.is_square(), "det(): matrix must be square" ); return auxlib::det(X);
return auxlib::det(A);
} }
//! determinant of diagmat //! determinant of diagmat
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
typename T1::elem_type typename T1::elem_type
det(const Op<T1, op_diagmat>& X) det(const Op<T1, op_diagmat>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
skipping to change at line 72 skipping to change at line 64
//! determinant of inv(A), without doing the inverse operation //! determinant of inv(A), without doing the inverse operation
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
typename T1::elem_type typename T1::elem_type
det(const Op<T1,op_inv>& in, const typename arma_blas_type_only<typename T1 ::elem_type>::result* junk = 0) det(const Op<T1,op_inv>& in, const typename arma_blas_type_only<typename T1 ::elem_type>::result* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
isnt_fltpt<eT>::check();
eT tmp = det(in.m); eT tmp = det(in.m);
arma_warn( (tmp == eT(0)), "det(): warning: denominator is zero" ); arma_warn( (tmp == eT(0)), "det(): warning: denominator is zero" );
return eT(1) / tmp; return eT(1) / tmp;
} }
//! determinant of trans(A) //! determinant of trans(A)
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
typename T1::elem_type typename T1::elem_type
det(const Op<T1,op_trans>& in, const typename arma_blas_type_only<typename T1::elem_type>::result* junk = 0) det(const Op<T1,op_trans>& in, const typename arma_blas_type_only<typename T1::elem_type>::result* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
const unwrap<T1> tmp(in.m); const unwrap<T1> tmp(in.m);
const Mat<eT>& X = tmp.M; const Mat<eT>& X = tmp.M;
return det(X); return det(X);
} }
//! @} //! @}
 End of changes. 6 change blocks. 
13 lines changed or deleted 8 lines changed or added


 fn_diagmat.hpp   fn_diagmat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_diagvec.hpp   fn_diagvec.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_dot.hpp   fn_dot.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_eig.hpp   fn_eig.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
// // Copyright (C) 2009 Edmund Highcock
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Edmund Highcock (edmund dot highcock at merton dot ox dot ac dot uk)
// //
// This file is part of the Armadillo C++ library. // This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup fn_eig //! \addtogroup fn_eig
//! @{ //! @{
// //
// symmetric/hermitian matrices // symmetric/hermitian matrices
// //
//! Eigenvalues of real/complex symmetric/hermitian matrix X //! Eigenvalues of real/complex symmetric/hermitian matrix X
template<typename T1> template<typename T1>
inline inline
void bool
eig_sym(Col<typename T1::pod_type>& eigval, const Base<typename T1::elem_ty eig_sym
pe,T1>& X, const typename arma_blas_type_only<typename T1::elem_type>::resu (
lt* junk = 0) Col<typename T1::pod_type>& eigval,
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();
typedef typename T1::elem_type eT; arma_ignore(junk);
// unwrap_check not used as T1::elem_type and T1::pod_type may not be the same. // unwrap_check not used as T1::elem_type and T1::pod_type may not be the same.
// furthermore, it doesn't matter if A is an alias of S, as auxlib::eig() // furthermore, it doesn't matter if X is an alias of eigval, as auxlib::
makes a copy of A eig_sym() makes a copy of X
const bool status = auxlib::eig_sym(eigval, X);
const unwrap<T1> tmp(X.get_ref()); if(status == false)
const Mat<eT>& A = tmp.M; {
arma_print("eig_sym(): failed to converge");
eigval.reset();
}
auxlib::eig_sym(eigval, A); return status;
} }
//! Eigenvalues of real/complex symmetric/hermitian matrix X //! Eigenvalues of real/complex symmetric/hermitian matrix X
template<typename T1> template<typename T1>
inline inline
Col<typename T1::pod_type> Col<typename T1::pod_type>
eig_sym(const Base<typename T1::elem_type,T1>& X, const typename arma_blas_ eig_sym
type_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);
Col<typename T1::pod_type> out; Col<typename T1::pod_type> out;
eig_sym(out, X); eig_sym(out, X);
return out; return out;
} }
//! Eigenvalues and eigenvectors of real/complex symmetric/hermitian matrix X //! Eigenvalues and eigenvectors of real/complex symmetric/hermitian matrix X
template<typename T1> template<typename T1>
inline inline
void bool
eig_sym eig_sym
( (
Col<typename T1::pod_type>& eigval, Col<typename T1::pod_type>& eigval,
Mat<typename T1::elem_type>& eigvec, Mat<typename T1::elem_type>& eigvec,
const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T1>& X,
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();
typedef typename T1::elem_type eT; arma_ignore(junk);
arma_debug_check( ( ((void*)(&eigval)) == ((void*)(&eigvec)) ), "eig_sym(
): eigval is an alias of eigvec" );
const unwrap<T1> tmp(X.get_ref()); const bool status = auxlib::eig_sym(eigval, eigvec, X);
const Mat<eT>& A = tmp.M;
auxlib::eig_sym(eigval, eigvec, A); if(status == false)
{
arma_print("eig_sym(): failed to converge");
eigval.reset();
eigvec.reset();
}
return status;
} }
// //
// general matrices // general matrices
// //
//! Eigenvalues and eigenvectors (both left and right) of general real/comp lex square matrix X //! Eigenvalues and eigenvectors (both left and right) of general real/comp lex square matrix X
template<typename T1> template<typename T1>
inline inline
void bool
eig_gen eig_gen
( (
Col< std::complex<typename T1::pod_type> >& eigval, Col< std::complex<typename T1::pod_type> >& eigval,
Mat<typename T1::elem_type>& l_eigvec, Mat<typename T1::elem_type>& l_eigvec,
Mat<typename T1::elem_type>& r_eigvec, Mat<typename T1::elem_type>& r_eigvec,
const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T1>& X,
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();
typedef typename T1::elem_type eT; arma_ignore(junk);
arma_debug_check
(
((&l_eigvec) == (&r_eigvec)),
"eig_gen(): l_eigvec is an alias of r_eigvec"
);
arma_debug_check
(
(
(((void*)(&eigval)) == ((void*)(&l_eigvec)))
||
(((void*)(&eigval)) == ((void*)(&r_eigvec)))
),
"eig_gen(): eigval is an alias of l_eigvec or r_eigvec"
);
const bool status = auxlib::eig_gen(eigval, l_eigvec, r_eigvec, X, 'b');
const unwrap<T1> tmp(X.get_ref()); if(status == false)
const Mat<eT>& A = tmp.M; {
arma_print("eig_gen(): failed to converge");
eigval.reset();
l_eigvec.reset();
r_eigvec.reset();
}
auxlib::eig_gen(eigval, l_eigvec, r_eigvec, A, 'b'); return status;
} }
//! Eigenvalues and eigenvectors of general real square matrix X. //! Eigenvalues and eigenvectors of general real square matrix X.
//! Optional argument 'side' specifies which eigenvectors should be compute d: //! Optional argument 'side' specifies which eigenvectors should be compute d:
//! 'r' for right (default) and 'l' for left. //! 'r' for right (default) and 'l' for left.
template<typename eT, typename T1> template<typename eT, typename T1>
inline inline
void bool
eig_gen eig_gen
( (
Col< std::complex<eT> >& eigval, Col< std::complex<eT> >& eigval,
Mat< std::complex<eT> >& eigvec, Mat< std::complex<eT> >& eigvec,
const Base<eT, T1>& X, const Base<eT, T1>& X,
const char side = 'r', const char side = 'r',
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);
//std::cout << "real" << std::endl; //std::cout << "real" << std::endl;
const unwrap<T1> tmp(X.get_ref()); arma_debug_check( ( ((void*)(&eigval)) == ((void*)(&eigvec)) ), "eig_gen(
const Mat<eT>& A = tmp.M; ): eigval is an alias of eigvec" );
Mat<eT> dummy_eigvec; Mat<eT> dummy_eigvec;
Mat<eT> tmp_eigvec; Mat<eT> tmp_eigvec;
bool status;
switch(side) switch(side)
{ {
case 'r': case 'r':
auxlib::eig_gen(eigval, dummy_eigvec, tmp_eigvec, A, side); status = auxlib::eig_gen(eigval, dummy_eigvec, tmp_eigvec, X, side);
break; break;
case 'l': case 'l':
auxlib::eig_gen(eigval, tmp_eigvec, dummy_eigvec, A, side); status = auxlib::eig_gen(eigval, tmp_eigvec, dummy_eigvec, X, side);
break; break;
default: default:
arma_stop("eig_gen(): parameter 'side' is invalid"); arma_stop("eig_gen(): parameter 'side' is invalid");
return; status = false;
} }
const u32 n = A.n_rows; if(status == false)
{
arma_print("eig_gen(): failed to converge");
eigval.reset();
eigvec.reset();
return false;
}
const u32 n = eigval.n_elem;
if(n > 0) if(n > 0)
{ {
eigvec.set_size(n,n); eigvec.set_size(n,n);
for(u32 j=0; j<n; ++j) for(u32 j=0; j<n; ++j)
{ {
if( (j < n-1) && (eigval[j] == std::conj(eigval[j+1])) ) if( (j < n-1) && (eigval[j] == std::conj(eigval[j+1])) )
{ {
// eigvec.col(j) = Mat< std::complex<eT> >( tmp_eigvec.col(j), t mp_eigvec.col(j+1) ); // eigvec.col(j) = Mat< std::complex<eT> >( tmp_eigvec.col(j), t mp_eigvec.col(j+1) );
skipping to change at line 180 skipping to change at line 235
for(u32 i=0; i<n; ++i) for(u32 i=0; i<n; ++i)
{ {
eigvec.at(i,j) = std::complex<eT>(tmp_eigvec.at(i,j), eT(0)); eigvec.at(i,j) = std::complex<eT>(tmp_eigvec.at(i,j), eT(0));
} }
} }
} }
} }
return true;
} }
//! Eigenvalues and eigenvectors of general complex square matrix X //! Eigenvalues and eigenvectors of general complex square matrix X
//! Optional argument 'side' specifies which eigenvectors should be compute d: //! Optional argument 'side' specifies which eigenvectors should be compute d:
//! 'r' for right (default) and 'l' for left. //! 'r' for right (default) and 'l' for left.
template<typename T, typename T1> template<typename T, typename T1>
inline inline
void bool
eig_gen eig_gen
( (
Col< std::complex<T> >& eigval, Col<std::complex<T> >& eigval,
Mat< std::complex<T> >& eigvec, Mat<std::complex<T> >& eigvec,
const Base<std::complex<T>, T1>& X, const Base<std::complex<T>, T1>& X,
const char side = 'r', const char side = 'r',
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);
//std::cout << "complex" << std::endl; //std::cout << "complex" << std::endl;
typedef typename std::complex<T> eT; arma_debug_check( ( ((void*)(&eigval)) == ((void*)(&eigvec)) ), "eig_gen( ): eigval is an alias of eigvec" );
const unwrap<T1> tmp(X.get_ref()); Mat< std::complex<T> > dummy_eigvec;
const Mat<eT>& A = tmp.M;
Mat<eT> dummy_eigvec; bool status;
switch(side) switch(side)
{ {
case 'r': case 'r':
auxlib::eig_gen(eigval, dummy_eigvec, eigvec, A, side); status = auxlib::eig_gen(eigval, dummy_eigvec, eigvec, X, side);
break; break;
case 'l': case 'l':
auxlib::eig_gen(eigval, eigvec, dummy_eigvec, A, side); status = auxlib::eig_gen(eigval, eigvec, dummy_eigvec, X, side);
break; break;
default: default:
arma_stop("eig_gen(): parameter 'side' is invalid"); arma_stop("eig_gen(): parameter 'side' is invalid");
status = false;
} }
if(status == false)
{
arma_print("eig_gen(): failed to converge");
eigval.reset();
eigvec.reset();
}
return status;
} }
//! @} //! @}
 End of changes. 39 change blocks. 
55 lines changed or deleted 124 lines changed or added


 fn_eps.hpp   fn_eps.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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 29 skipping to change at line 26
//! \brief //! \brief
//! eps version for non-complex matrices and vectors //! eps version for non-complex matrices and vectors
template<typename T1> template<typename T1>
inline inline
const eOp<T1, eop_eps> const eOp<T1, eop_eps>
eps(const Base<typename T1::elem_type, T1>& X, const typename arma_not_cx<t ypename T1::elem_type>::result* junk = 0) eps(const Base<typename T1::elem_type, T1>& X, const typename arma_not_cx<t ypename T1::elem_type>::result* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
return eOp<T1, eop_eps>(X.get_ref()); return eOp<T1, eop_eps>(X.get_ref());
} }
//! \brief //! \brief
//! eps version for complex matrices and vectors //! eps version for complex matrices and vectors
template<typename T1> template<typename T1>
inline inline
Mat< typename T1::pod_type > Mat< typename T1::pod_type >
eps(const Base< std::complex<typename T1::pod_type>, T1>& X, const typename arma_cx_only<typename T1::elem_type>::result* junk = 0) eps(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_extra_debug_sigprint();
arma_ignore(junk);
typedef typename T1::pod_type T; typedef typename T1::pod_type T;
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
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;
Mat<T> out(A.n_rows, A.n_cols); Mat<T> out(A.n_rows, A.n_cols);
T* out_mem = out.memptr(); T* out_mem = out.memptr();
const eT* A_mem = A.memptr(); const eT* A_mem = A.memptr();
skipping to change at line 69 skipping to change at line 70
return out; return out;
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
typename arma_integral_only<eT>::result typename arma_integral_only<eT>::result
eps(const eT& x) eps(const eT& x)
{ {
arma_ignore(x);
return eT(0); return eT(0);
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
arma_warn_unused arma_warn_unused
typename arma_float_only<eT>::result typename arma_float_only<eT>::result
eps(const eT& x) eps(const eT& x)
{ {
return eop_aux::direct_eps(x); return eop_aux::direct_eps(x);
 End of changes. 4 change blocks. 
6 lines changed or deleted 9 lines changed or added


 fn_flip.hpp   fn_flip.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_htrans.hpp   fn_htrans.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_inv.hpp   fn_inv.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 27 skipping to change at line 24
//! @{ //! @{
//! delayed matrix inverse //! delayed matrix inverse
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 _only<typename T1::elem_type>::result* junk = 0) inv(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);
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();
 End of changes. 2 change blocks. 
5 lines changed or deleted 4 lines changed or added


 fn_join.hpp   fn_join.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_kron.hpp   fn_kron.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 fn_log_det.hpp   fn_log_det.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// This file is part of the Armadillo C++ library. // This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup fn_log_det //! \addtogroup fn_log_det
//! @{ //! @{
//! log determinant of mat //! log determinant of mat
template<typename T1> template<typename T1>
inline inline
void void
log_det log_det
( (
typename T1::elem_type& out_val, typename T1::elem_type& out_val,
typename T1::pod_type& out_sign, typename T1::pod_type& out_sign,
const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T1>& X,
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();
typedef typename T1::elem_type eT; auxlib::log_det(out_val, out_sign, X);
const unwrap<T1> tmp(X.get_ref());
const Mat<eT>& A = tmp.M;
arma_debug_check( !A.is_square(), "log_det(): matrix must be square" );
auxlib::log_det(out_val, out_sign, A);
} }
template<typename T1> template<typename T1>
inline inline
void void
log_det log_det
( (
typename T1::elem_type& out_val, typename T1::elem_type& out_val,
typename T1::pod_type& out_sign, typename T1::pod_type& out_sign,
const Op<T1,op_diagmat>& X, const Op<T1,op_diagmat>& X,
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();
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef typename T1::pod_type T; typedef typename T1::pod_type T;
const diagmat_proxy<T1> A(X.m); const diagmat_proxy<T1> A(X.m);
 End of changes. 4 change blocks. 
18 lines changed or deleted 8 lines changed or added


 fn_lu.hpp   fn_lu.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// This file is part of the Armadillo C++ library. // This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup fn_lu //! \addtogroup fn_lu
//! @{ //! @{
//! immediate lower upper decomposition //! immediate lower upper decomposition, permutation info is embedded into L (similar to Matlab/Octave)
template<typename T1> template<typename T1>
inline inline
void void
lu lu
( (
Mat<typename T1::elem_type>& L, Mat<typename T1::elem_type>& L,
Mat<typename T1::elem_type>& U, Mat<typename T1::elem_type>& U,
const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T1>& X,
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();
typedef typename T1::elem_type eT; arma_ignore(junk);
arma_debug_check( (&L == &U), "lu(): L and U are the same object"); arma_debug_check( (&L == &U), "lu(): L and U are the same object");
const unwrap_check<T1> tmp1(X.get_ref(), L); auxlib::lu(L, U, X);
const Mat<eT>& A = tmp1.M;
const unwrap_check< Mat<eT> > tmp2(A, U);
const Mat<eT>& B = tmp2.M;
auxlib::lu(L, U, B);
} }
//! immediate lower upper decomposition, also providing the permutation mat rix //! immediate lower upper decomposition, also providing the permutation mat rix
template<typename T1> template<typename T1>
inline inline
void void
lu lu
( (
Mat<typename T1::elem_type>& L, Mat<typename T1::elem_type>& L,
Mat<typename T1::elem_type>& U, Mat<typename T1::elem_type>& U,
Mat<typename T1::elem_type>& P, Mat<typename T1::elem_type>& P,
const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T1>& X,
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();
typedef typename T1::elem_type eT; arma_ignore(junk);
arma_debug_check( ( (&L == &U) || (&L == &P) || (&U == &P) ), "lu(): two or more output objects are the same object"); arma_debug_check( ( (&L == &U) || (&L == &P) || (&U == &P) ), "lu(): two or more output objects are the same object");
const unwrap_check<T1> tmp1(X.get_ref(), L); auxlib::lu(L, U, P, X);
const Mat<eT>& A = tmp1.M;
const unwrap_check< Mat<eT> > tmp2(A, U);
const Mat<eT>& B = tmp2.M;
const unwrap_check< Mat<eT> > tmp3(B, P);
const Mat<eT>& C = tmp3.M;
auxlib::lu(L, U, P, C);
} }
//! @} //! @}
 End of changes. 8 change blocks. 
30 lines changed or deleted 12 lines changed or added


 fn_max.hpp   fn_max.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_mean.hpp   fn_mean.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_median.hpp   fn_median.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_min.hpp   fn_min.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_misc.hpp   fn_misc.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 36 skipping to change at line 33
linspace linspace
( (
const typename vec_type::pod_type start, const typename vec_type::pod_type start,
const typename vec_type::pod_type end, const typename vec_type::pod_type end,
const u32 num, const u32 num,
const typename arma_Mat_Col_Row_only<vec_type>::result* junk = 0 const typename arma_Mat_Col_Row_only<vec_type>::result* junk = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
arma_debug_check( (num < 2), "linspace(): num must be >= 2"); arma_debug_check( (num < 2), "linspace(): num must be >= 2");
typedef typename vec_type::elem_type eT; typedef typename vec_type::elem_type eT;
typedef typename vec_type::pod_type T; typedef typename vec_type::pod_type T;
const u32 n_rows = (is_Row<vec_type>::value == true) ? 1 : num; const u32 n_rows = (is_Row<vec_type>::value == true) ? 1 : num;
const u32 n_cols = (is_Row<vec_type>::value == true) ? num : 1; const u32 n_cols = (is_Row<vec_type>::value == true) ? num : 1;
Mat<eT> x(n_rows, n_cols); Mat<eT> x(n_rows, n_cols);
eT* x_mem = x.memptr(); eT* x_mem = x.memptr();
skipping to change at line 364 skipping to change at line 363
// //
// abs // abs
template<typename T1> template<typename T1>
arma_inline arma_inline
const eOp<T1, eop_abs> 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) 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_extra_debug_sigprint();
arma_ignore(junk);
return eOp<T1, eop_abs>(X.get_ref()); return eOp<T1, eop_abs>(X.get_ref());
} }
template<typename T1> template<typename T1>
arma_inline arma_inline
const eOpCube<T1, eop_abs> 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) 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_extra_debug_sigprint();
arma_ignore(junk);
return eOpCube<T1, eop_abs>(X.get_ref()); return eOpCube<T1, eop_abs>(X.get_ref());
} }
template<typename T1> template<typename T1>
inline inline
const mtOp<typename T1::pod_type, T1, op_abs> 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) 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_extra_debug_sigprint();
arma_ignore(junk);
return mtOp<typename T1::pod_type, T1, op_abs>( X.get_ref() ); return mtOp<typename T1::pod_type, T1, op_abs>( X.get_ref() );
} }
template<typename T1> template<typename T1>
inline inline
const mtOpCube<typename T1::pod_type, T1, op_abs> 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) 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_extra_debug_sigprint();
arma_ignore(junk);
return mtOpCube<typename T1::pod_type, T1, op_abs>( X.get_ref() ); return mtOpCube<typename T1::pod_type, T1, op_abs>( X.get_ref() );
} }
// //
// fabs // fabs
template<typename T1> template<typename T1>
arma_inline arma_inline
const eOp<T1, eop_abs> 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) 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_extra_debug_sigprint();
arma_ignore(junk);
return eOp<T1, eop_abs>(X.get_ref()); return eOp<T1, eop_abs>(X.get_ref());
} }
template<typename T1> template<typename T1>
arma_inline arma_inline
const eOpCube<T1, eop_abs> 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) 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_extra_debug_sigprint();
arma_ignore(junk);
return eOpCube<T1, eop_abs>(X.get_ref()); return eOpCube<T1, eop_abs>(X.get_ref());
} }
template<typename T1> template<typename T1>
inline inline
const mtOp<typename T1::pod_type, T1, op_abs> 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) 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_extra_debug_sigprint();
arma_ignore(junk);
return mtOp<typename T1::pod_type, T1, op_abs>( X.get_ref() ); return mtOp<typename T1::pod_type, T1, op_abs>( X.get_ref() );
} }
template<typename T1> template<typename T1>
arma_inline arma_inline
const mtOpCube<typename T1::pod_type, T1, op_abs> 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) 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_extra_debug_sigprint();
arma_ignore(junk);
return abs(X); return abs(X);
} }
// //
// square // square
template<typename T1> template<typename T1>
arma_inline arma_inline
const eOp<T1, eop_square> const eOp<T1, eop_square>
square(const Base<typename T1::elem_type,T1>& A) square(const Base<typename T1::elem_type,T1>& A)
skipping to change at line 611 skipping to change at line 626
const eOpCube<T1, eop_pow> const eOpCube<T1, eop_pow>
pow(const BaseCube<typename T1::elem_type,T1>& A, const typename T1::elem_t ype::value_type exponent) pow(const BaseCube<typename T1::elem_type,T1>& A, const typename T1::elem_t ype::value_type exponent)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
return eOpCube<T1, eop_pow>(A.get_ref(), eT(exponent)); return eOpCube<T1, eop_pow>(A.get_ref(), eT(exponent));
} }
// #if defined(ARMA_GOOD_COMPILER)
//
//
// // pow_s32 (integer exponent)
//
// template<typename T1>
// arma_inline
// const eOp<T1, eop_pow_int>
// pow(const Base<typename T1::elem_type,T1>& A, const int exponent)
// {
// arma_extra_debug_sigprint();
//
// if(exponent >= 0)
// {
// return eOp<T1, eop_pow_int>(A.get_ref(), exponent, 0);
// }
// else
// {
// return eOp<T1, eop_pow_int>(A.get_ref(), -exponent, 1);
// }
// }
//
//
//
// template<typename T1>
// arma_inline
// const eOpCube<T1, eop_pow_int>
// pow(const BaseCube<typename T1::elem_type,T1>& A, const int exponent)
// {
// arma_extra_debug_sigprint();
//
// if(exponent >= 0)
// {
// return eOpCube<T1, eop_pow_int>(A.get_ref(), exponent, 0);
// }
// else
// {
// return eOpCube<T1, eop_pow_int>(A.get_ref(), -exponent, 1);
// }
// }
//
//
//
// #endif
//! @} //! @}
 End of changes. 11 change blocks. 
50 lines changed or deleted 20 lines changed or added


 fn_norm.hpp   fn_norm.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 55 skipping to change at line 52
return acc; return acc;
} }
template<typename T1> template<typename T1>
arma_hot arma_hot
arma_inline arma_inline
typename T1::pod_type typename T1::pod_type
norm_2(const Proxy<T1>& A, const typename arma_not_cx<typename T1::elem_typ e>::result* junk = 0) norm_2(const Proxy<T1>& A, const typename arma_not_cx<typename T1::elem_typ e>::result* junk = 0)
{ {
arma_ignore(junk);
typedef typename T1::pod_type T; typedef typename T1::pod_type T;
typedef typename Proxy<T1>::ea_type ea_type; typedef typename Proxy<T1>::ea_type ea_type;
T acc = T(0); T acc = T(0);
ea_type P = A.get_ea(); ea_type P = A.get_ea();
const u32 N = A.get_n_elem(); const u32 N = A.get_n_elem();
u32 i,j; u32 i,j;
skipping to change at line 90 skipping to change at line 89
return std::sqrt(acc); return std::sqrt(acc);
} }
template<typename T1> template<typename T1>
arma_hot arma_hot
arma_inline arma_inline
typename T1::pod_type typename T1::pod_type
norm_2(const Proxy<T1>& A, const typename arma_cx_only<typename T1::elem_ty pe>::result* junk = 0) norm_2(const Proxy<T1>& A, const typename arma_cx_only<typename T1::elem_ty pe>::result* junk = 0)
{ {
arma_ignore(junk);
typedef typename T1::pod_type T; typedef typename T1::pod_type T;
typedef typename Proxy<T1>::ea_type ea_type; typedef typename Proxy<T1>::ea_type ea_type;
T acc = T(0); T acc = T(0);
ea_type P = A.get_ea(); ea_type P = A.get_ea();
const u32 N = A.get_n_elem(); const u32 N = A.get_n_elem();
for(u32 i=0; i<N; ++i) for(u32 i=0; i<N; ++i)
{ {
skipping to change at line 220 skipping to change at line 221
typename T1::pod_type typename T1::pod_type
norm norm
( (
const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T1>& X,
const u32 k, const u32 k,
const typename arma_float_or_cx_only<typename T1::elem_type>::result* jun k = 0 const typename arma_float_or_cx_only<typename T1::elem_type>::result* jun k = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef typename T1::pod_type T; typedef typename T1::pod_type T;
const Proxy<T1> A(X.get_ref()); const Proxy<T1> A(X.get_ref());
arma_debug_check( (A.get_n_elem() == 0), "n orm(): given object has no elements" ); arma_debug_check( (A.get_n_elem() == 0), "n orm(): given object has no elements" );
arma_debug_check( !( (A.get_n_rows() == 1) || (A.get_n_cols() == 1) ), "n orm(): given object must be a vector" ); arma_debug_check( !( (A.get_n_rows() == 1) || (A.get_n_cols() == 1) ), "n orm(): given object must be a vector" );
switch(k) switch(k)
{ {
skipping to change at line 260 skipping to change at line 263
typename T1::pod_type typename T1::pod_type
norm norm
( (
const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T1>& X,
const char* method, const char* method,
const typename arma_float_or_cx_only<typename T1::elem_type>::result* jun k = 0 const typename arma_float_or_cx_only<typename T1::elem_type>::result* jun k = 0
) )
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef typename T1::pod_type T; typedef typename T1::pod_type T;
const Proxy<T1> A(X.get_ref()); const Proxy<T1> A(X.get_ref());
arma_debug_check( (A.get_n_elem() == 0), "n orm(): given object has no elements" ); arma_debug_check( (A.get_n_elem() == 0), "n orm(): given object has no elements" );
arma_debug_check( !( (A.get_n_rows() == 1) || (A.get_n_cols() == 1) ), "n orm(): given object must be a vector" ); arma_debug_check( !( (A.get_n_rows() == 1) || (A.get_n_cols() == 1) ), "n orm(): given object must be a vector" );
const char sig = method[0]; const char sig = method[0];
 End of changes. 5 change blocks. 
5 lines changed or deleted 10 lines changed or added


 fn_ones.hpp   fn_ones.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 36 skipping to change at line 33
return eOp<colvec, eop_ones_full>(n_elem, 1); return eOp<colvec, eop_ones_full>(n_elem, 1);
} }
template<typename vec_type> template<typename vec_type>
arma_inline arma_inline
const eOp<vec_type, eop_ones_full> const eOp<vec_type, eop_ones_full>
ones(const u32 n_elem, const typename arma_Mat_Col_Row_only<vec_type>::resu lt* junk = 0) ones(const u32 n_elem, const typename arma_Mat_Col_Row_only<vec_type>::resu lt* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
if(is_Row<vec_type>::value == true) if(is_Row<vec_type>::value == true)
{ {
return eOp<vec_type, eop_ones_full>(1, n_elem); return eOp<vec_type, eop_ones_full>(1, n_elem);
} }
else else
{ {
return eOp<vec_type, eop_ones_full>(n_elem, 1); return eOp<vec_type, eop_ones_full>(n_elem, 1);
} }
} }
skipping to change at line 63 skipping to change at line 62
return eOp<mat, eop_ones_full>(n_rows, n_cols); return eOp<mat, eop_ones_full>(n_rows, n_cols);
} }
template<typename mat_type> template<typename mat_type>
arma_inline arma_inline
const eOp<mat_type, eop_ones_full> const eOp<mat_type, eop_ones_full>
ones(const u32 n_rows, const u32 n_cols, const typename arma_Mat_Col_Row_on ly<mat_type>::result* junk = 0) ones(const u32 n_rows, const u32 n_cols, const typename arma_Mat_Col_Row_on ly<mat_type>::result* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_type_check<is_Mat<mat_type>::value == false>::apply(); arma_ignore(junk);
return eOp<mat_type, eop_ones_full>(n_rows, n_cols); return eOp<mat_type, eop_ones_full>(n_rows, n_cols);
} }
arma_inline arma_inline
const eOpCube<cube, eop_ones_full> const eOpCube<cube, eop_ones_full>
ones(const u32 n_rows, const u32 n_cols, const u32 n_slices) ones(const u32 n_rows, const u32 n_cols, const u32 n_slices)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return eOpCube<cube, eop_ones_full>(n_rows, n_cols, n_slices); return eOpCube<cube, eop_ones_full>(n_rows, n_cols, n_slices);
} }
template<typename cube_type> template<typename cube_type>
arma_inline arma_inline
const eOpCube<cube_type, eop_ones_full> const eOpCube<cube_type, eop_ones_full>
ones(const u32 n_rows, const u32 n_cols, const u32 n_slices, const typename arma_Cube_only<cube_type>::result* junk = 0) ones(const u32 n_rows, const u32 n_cols, const u32 n_slices, const typename arma_Cube_only<cube_type>::result* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_type_check<is_Cube<cube_type>::value == false>::apply(); arma_ignore(junk);
return eOpCube<cube_type, eop_ones_full>(n_rows, n_cols, n_slices); return eOpCube<cube_type, eop_ones_full>(n_rows, n_cols, n_slices);
} }
//! Delayed generation of a matrix with the elements along the main diagona l set to one //! Delayed generation of a matrix with the elements along the main diagona l set to one
//! and off-diagonal elements set to zero //! and off-diagonal elements set to zero
arma_inline arma_inline
const eOp<mat, eop_ones_diag> const eOp<mat, eop_ones_diag>
eye(const u32 n_rows, const u32 n_cols) eye(const u32 n_rows, const u32 n_cols)
{ {
skipping to change at line 107 skipping to change at line 106
return eOp<mat, eop_ones_diag>(n_rows, n_cols); return eOp<mat, eop_ones_diag>(n_rows, n_cols);
} }
template<typename mat_type> template<typename mat_type>
arma_inline arma_inline
const eOp<mat_type, eop_ones_diag> const eOp<mat_type, eop_ones_diag>
eye(const u32 n_rows, const u32 n_cols, const typename arma_Mat_Col_Row_onl y<mat_type>::result* junk = 0) eye(const u32 n_rows, const u32 n_cols, const typename arma_Mat_Col_Row_onl y<mat_type>::result* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_type_check<is_Mat_only<mat_type>::value == false>::apply(); arma_ignore(junk);
return eOp<mat_type, eop_ones_diag>(n_rows, n_cols); return eOp<mat_type, eop_ones_diag>(n_rows, n_cols);
} }
//! @} //! @}
 End of changes. 5 change blocks. 
8 lines changed or deleted 7 lines changed or added


 fn_pinv.hpp   fn_pinv.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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 32 skipping to change at line 29
const Op<T1, op_pinv> const Op<T1, op_pinv>
pinv pinv
( (
const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T1>& X,
const typename T1::elem_type tol = 0.0, const typename T1::elem_type tol = 0.0,
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);
return Op<T1, op_pinv>(X.get_ref(), tol); return Op<T1, op_pinv>(X.get_ref(), tol);
} }
//! @} //! @}
 End of changes. 2 change blocks. 
6 lines changed or deleted 5 lines changed or added


 fn_princomp.hpp   fn_princomp.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
// // Copyright (C) 2010 Dimitrios Bouzas
// Authors:
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 fn_princomp_cov.hpp   fn_princomp_cov.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
// // Copyright (C) 2010 Dimitrios Bouzas
// Authors:
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 fn_prod.hpp   fn_prod.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_qr.hpp   fn_qr.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// This file is part of the Armadillo C++ library. // This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup fn_qr //! \addtogroup fn_qr
//! @{ //! @{
//! QR decomposition //! QR decomposition
template<typename T1> template<typename T1>
inline inline
void void
qr qr
( (
Mat<typename T1::elem_type>& Q, Mat<typename T1::elem_type>& Q,
Mat<typename T1::elem_type>& R, Mat<typename T1::elem_type>& R,
const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T1>& X,
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();
typedef typename T1::elem_type eT; arma_ignore(junk);
arma_debug_check( (&Q == &R), "qr(): Q and R are the same object"); arma_debug_check( (&Q == &R), "qr(): Q and R are the same object");
const unwrap_check<T1> tmp1(X.get_ref(), Q); const bool status = auxlib::qr(Q, R, X);
const Mat<eT>& A = tmp1.M;
const unwrap_check< Mat<eT> > tmp2(A, R);
const Mat<eT>& B = tmp2.M;
const bool ok = auxlib::qr(Q, R, B); if(status == false)
if(ok == false)
{ {
arma_print("qr(): failed to converge");
Q.reset(); Q.reset();
R.reset(); R.reset();
arma_print("qr(): factorisation failed");
} }
} }
//! @} //! @}
 End of changes. 8 change blocks. 
18 lines changed or deleted 8 lines changed or added


 fn_randn.hpp   fn_randn.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 51 skipping to change at line 48
return eOp<colvec, eop_randn>(n_elem, 1); return eOp<colvec, eop_randn>(n_elem, 1);
} }
template<typename vec_type> template<typename vec_type>
arma_inline arma_inline
const eOp<vec_type, eop_randn> const eOp<vec_type, eop_randn>
randn(const u32 n_elem, const typename arma_Mat_Col_Row_only<vec_type>::res ult* junk = 0) randn(const u32 n_elem, const typename arma_Mat_Col_Row_only<vec_type>::res ult* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
if(is_Row<vec_type>::value == true) if(is_Row<vec_type>::value == true)
{ {
return eOp<vec_type, eop_randn>(1, n_elem); return eOp<vec_type, eop_randn>(1, n_elem);
} }
else else
{ {
return eOp<vec_type, eop_randn>(n_elem, 1); return eOp<vec_type, eop_randn>(n_elem, 1);
} }
} }
skipping to change at line 78 skipping to change at line 77
return eOp<mat, eop_randn>(n_rows, n_cols); return eOp<mat, eop_randn>(n_rows, n_cols);
} }
template<typename mat_type> template<typename mat_type>
arma_inline arma_inline
const eOp<mat_type, eop_randn> const eOp<mat_type, eop_randn>
randn(const u32 n_rows, const u32 n_cols, const typename arma_Mat_Col_Row_o nly<mat_type>::result* junk = 0) randn(const u32 n_rows, const u32 n_cols, const typename arma_Mat_Col_Row_o nly<mat_type>::result* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
return eOp<mat_type, eop_randn>(n_rows, n_cols); return eOp<mat_type, eop_randn>(n_rows, n_cols);
} }
arma_inline arma_inline
const eOpCube<cube, eop_randn> const eOpCube<cube, eop_randn>
randn(const u32 n_rows, const u32 n_cols, const u32 n_slices) randn(const u32 n_rows, const u32 n_cols, const u32 n_slices)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return eOpCube<cube, eop_randn>(n_rows, n_cols, n_slices); return eOpCube<cube, eop_randn>(n_rows, n_cols, n_slices);
} }
template<typename cube_type> template<typename cube_type>
arma_inline arma_inline
const eOpCube<cube_type, eop_randn> const eOpCube<cube_type, eop_randn>
randn(const u32 n_rows, const u32 n_cols, const u32 n_slices, const typenam e arma_Cube_only<cube_type>::result* junk = 0) randn(const u32 n_rows, const u32 n_cols, const u32 n_slices, const typenam e arma_Cube_only<cube_type>::result* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
return eOpCube<cube_type, eop_randn>(n_rows, n_cols, n_slices); return eOpCube<cube_type, eop_randn>(n_rows, n_cols, n_slices);
} }
//! @} //! @}
 End of changes. 4 change blocks. 
5 lines changed or deleted 8 lines changed or added


 fn_randu.hpp   fn_randu.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 51 skipping to change at line 48
return eOp<colvec, eop_randu>(n_elem, 1); return eOp<colvec, eop_randu>(n_elem, 1);
} }
template<typename vec_type> template<typename vec_type>
arma_inline arma_inline
const eOp<vec_type, eop_randu> const eOp<vec_type, eop_randu>
randu(const u32 n_elem, const typename arma_Mat_Col_Row_only<vec_type>::res ult* junk = 0) randu(const u32 n_elem, const typename arma_Mat_Col_Row_only<vec_type>::res ult* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
if(is_Row<vec_type>::value == true) if(is_Row<vec_type>::value == true)
{ {
return eOp<vec_type, eop_randu>(1, n_elem); return eOp<vec_type, eop_randu>(1, n_elem);
} }
else else
{ {
return eOp<vec_type, eop_randu>(n_elem, 1); return eOp<vec_type, eop_randu>(n_elem, 1);
} }
} }
skipping to change at line 78 skipping to change at line 77
return eOp<mat, eop_randu>(n_rows, n_cols); return eOp<mat, eop_randu>(n_rows, n_cols);
} }
template<typename mat_type> template<typename mat_type>
arma_inline arma_inline
const eOp<mat_type, eop_randu> const eOp<mat_type, eop_randu>
randu(const u32 n_rows, const u32 n_cols, const typename arma_Mat_Col_Row_o nly<mat_type>::result* junk = 0) randu(const u32 n_rows, const u32 n_cols, const typename arma_Mat_Col_Row_o nly<mat_type>::result* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
return eOp<mat_type, eop_randu>(n_rows, n_cols); return eOp<mat_type, eop_randu>(n_rows, n_cols);
} }
arma_inline arma_inline
const eOpCube<cube, eop_randu> const eOpCube<cube, eop_randu>
randu(const u32 n_rows, const u32 n_cols, const u32 n_slices) randu(const u32 n_rows, const u32 n_cols, const u32 n_slices)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return eOpCube<cube, eop_randu>(n_rows, n_cols, n_slices); return eOpCube<cube, eop_randu>(n_rows, n_cols, n_slices);
} }
template<typename cube_type> template<typename cube_type>
arma_inline arma_inline
const eOpCube<cube_type, eop_randu> const eOpCube<cube_type, eop_randu>
randu(const u32 n_rows, const u32 n_cols, const u32 n_slices, const typenam e arma_Cube_only<cube_type>::result* junk = 0) randu(const u32 n_rows, const u32 n_cols, const u32 n_slices, const typenam e arma_Cube_only<cube_type>::result* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return eOpCube<cube_type, eop_randu>(n_rows, n_cols, n_slices); arma_ignore(junk);
}
//
// old functions, kept for compatibility with old user code
//! Generate a dense matrix with all elements set to random values in the [
0,1] interval (uniform distribution)
inline
arma_deprecated
const eOp<mat, eop_randu>
rand(const u32 n_rows, const u32 n_cols)
{
arma_extra_debug_sigprint();
arma_print("rand() is deprecated; please use randu() instead");
return eOp<mat, eop_randu>(n_rows, n_cols);
}
inline
arma_deprecated
const eOpCube<cube, eop_randu>
rand(const u32 n_rows, const u32 n_cols, const u32 n_slices)
{
arma_extra_debug_sigprint();
arma_print("rand() is deprecated; please use randu() instead");
return eOpCube<cube, eop_randu>(n_rows, n_cols, n_slices);
}
template<typename mat_type>
inline
arma_deprecated
const eOp<mat_type, eop_randu>
rand(const u32 n_rows, const u32 n_cols)
{
arma_extra_debug_sigprint();
arma_type_check<is_Mat<mat_type>::value == false>::apply();
arma_print("rand() is deprecated; please use randu() instead");
return eOp<mat_type, eop_randu>(n_rows, n_cols);
}
template<typename cube_type>
inline
arma_deprecated
const eOpCube<cube_type, eop_randu>
rand(const u32 n_rows, const u32 n_cols, const u32 n_slices)
{
arma_extra_debug_sigprint();
arma_type_check<is_Cube<cube_type>::value == false>::apply();
arma_print("rand() is deprecated; please use randu() instead");
return eOpCube<cube_type, eop_randu>(n_rows, n_cols, n_slices); return eOpCube<cube_type, eop_randu>(n_rows, n_cols, n_slices);
} }
//! Generate a vector with all elements set to random values in the [0,1] i
nterval (uniform distribution)
inline
arma_deprecated
const eOp<colvec, eop_randu>
rand(const u32 n_elem)
{
arma_extra_debug_sigprint();
arma_print("rand() is deprecated; please use randu() instead");
return eOp<colvec, eop_randu>(n_elem, 1);
}
template<typename vec_type>
inline
arma_deprecated
const eOp<vec_type, eop_randu>
rand(const u32 n_elem)
{
arma_extra_debug_sigprint();
arma_print("rand() is deprecated; please use randu() instead");
arma_type_check< (is_Col<vec_type>::value == false) && (is_Row<vec_type>:
:value == false) >::apply();
if(is_Row<vec_type>::value == true)
{
return eOp<vec_type, eop_randu>(1, n_elem);
}
else
{
return eOp<vec_type, eop_randu>(n_elem, 1);
}
}
//! @} //! @}
 End of changes. 5 change blocks. 
100 lines changed or deleted 7 lines changed or added


 fn_rank.hpp   fn_rank.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// This file is part of the Armadillo C++ library. // This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup fn_rank //! \addtogroup fn_rank
//! @{ //! @{
template<typename T1> template<typename T1>
inline inline
arma_warn_unused arma_warn_unused
u32 u32
rank rank
( (
const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T1>& X,
typename T1::pod_type tol = 0.0, typename T1::pod_type tol = 0.0,
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);
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef typename T1::pod_type T; typedef typename T1::pod_type T;
const unwrap<T1> tmp(X.get_ref()); u32 X_n_rows;
const Mat<eT>& A = tmp.M; u32 X_n_cols;
Col<T> s; Col<T> s;
const bool status = auxlib::svd(s, A);
const bool status = auxlib::svd(s, X, X_n_rows, X_n_cols);
if(status == true) if(status == true)
{ {
if(tol == T(0)) if(tol == T(0))
{ {
tol = (std::max)(A.n_rows, A.n_cols) * eop_aux::direct_eps(max(s)); tol = (std::max)(X_n_rows, X_n_cols) * eop_aux::direct_eps(max(s));
} }
// count non zero valued elements in s // count non zero valued elements in s
const T* s_mem = s.memptr(); const T* s_mem = s.memptr();
const u32 n_elem = s.n_elem; const u32 n_elem = s.n_elem;
u32 count = 0; u32 count = 0;
for(u32 i=0; i<n_elem; ++i) for(u32 i=0; i<n_elem; ++i)
{ {
if(s_mem[i] > tol) if(s_mem[i] > tol)
{ {
++count; ++count;
} }
} }
return count; return count;
} }
else else
{ {
arma_print("rank(): singular value decomposition failed"); arma_print("rank(): failed to converge");
return u32(0); return u32(0);
} }
} }
//! @} //! @}
 End of changes. 8 change blocks. 
14 lines changed or deleted 12 lines changed or added


 fn_repmat.hpp   fn_repmat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 fn_reshape.hpp   fn_reshape.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_shuffle.hpp   fn_shuffle.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 fn_solve.hpp   fn_solve.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 39 skipping to change at line 36
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);
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
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);
out = solve(A,B); out = solve(A,B);
return (out.n_elem == 0) ? false : true; return (out.n_elem == 0) ? false : true;
} }
//! @} //! @}
 End of changes. 3 change blocks. 
5 lines changed or deleted 6 lines changed or added


 fn_sort.hpp   fn_sort.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_sort_index.hpp   fn_sort_index.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_stddev.hpp   fn_stddev.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_sum.hpp   fn_sum.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_svd.hpp   fn_svd.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// This file is part of the Armadillo C++ library. // This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup fn_svd //! \addtogroup fn_svd
//! @{ //! @{
template<typename T1> template<typename T1>
inline inline
bool bool
svd svd
( (
Col<typename T1::pod_type>& S, Col<typename T1::pod_type>& S,
const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T1>& X,
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();
typedef typename T1::elem_type eT; arma_ignore(junk);
// unwrap_check not used as T1::elem_type and T1::pod_type may not be the
same.
// furthermore, it doesn't matter if A is an alias of S, as auxlib::svd()
makes a copy of A
const unwrap<T1> tmp(X.get_ref()); // it doesn't matter if X is an alias of S, as auxlib::svd() makes a copy
const Mat<eT>& A = tmp.M; of X
const bool status = auxlib::svd(S, A); const bool status = auxlib::svd(S, X);
if(status == false) if(status == false)
{ {
arma_print("svd(): singular value decomposition failed"); arma_print("svd(): failed to converge");
S.reset();
} }
return status; return status;
} }
template<typename T1> template<typename T1>
inline inline
Col<typename T1::pod_type> Col<typename T1::pod_type>
svd svd
( (
const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T1>& X,
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();
Col<typename T1::pod_type> out; arma_ignore(junk);
const bool status = svd(out, X); Col<typename T1::pod_type> out;
if(status == false) svd(out, X);
{
out.set_size(0);
}
return out; return out;
} }
template<typename T1> template<typename T1>
inline inline
bool bool
svd svd
( (
Mat<typename T1::elem_type>& U, Mat<typename T1::elem_type>& U,
Col<typename T1::pod_type>& S, Col<typename T1::pod_type >& S,
Mat<typename T1::elem_type>& V, Mat<typename T1::elem_type>& V,
const Base<typename T1::elem_type,T1>& X, const Base<typename T1::elem_type,T1>& X,
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);
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
arma_debug_check( ( ((void*)(&U) == (void*)(&S)) || (&U == &V) || ((void* )(&S) == (void*)(&V)) ), "svd(): two or more output objects are the same ob ject" ); arma_debug_check( ( ((void*)(&U) == (void*)(&S)) || (&U == &V) || ((void* )(&S) == (void*)(&V)) ), "svd(): two or more output objects are the same ob ject" );
const unwrap<T1> tmp(X.get_ref()); // auxlib::svd() makes an internal copy of X
const Mat<eT>& A = tmp.M; const bool status = auxlib::svd(U, S, V, X);
// auxlib::svd() makes an internal copy of A
const bool status = auxlib::svd(U, S, V, A);
if(status == false) if(status == false)
{ {
arma_print("svd(): singular value decomposition failed"); arma_print("svd(): failed to converge");
U.reset();
S.reset();
V.reset();
} }
return status; return status;
} }
//! @} //! @}
 End of changes. 13 change blocks. 
29 lines changed or deleted 21 lines changed or added


 fn_toeplitz.hpp   fn_toeplitz.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_trace.hpp   fn_trace.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_trans.hpp   fn_trans.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_trig.hpp   fn_trig.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_trunc_exp.hpp   fn_trunc_exp.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_trunc_log.hpp   fn_trunc_log.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_var.hpp   fn_var.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 fn_zeros.hpp   fn_zeros.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 36 skipping to change at line 33
return eOp<colvec, eop_zeros>(n_elem, 1); return eOp<colvec, eop_zeros>(n_elem, 1);
} }
template<typename vec_type> template<typename vec_type>
arma_inline arma_inline
const eOp<vec_type, eop_zeros> const eOp<vec_type, eop_zeros>
zeros(const u32 n_elem, const typename arma_Mat_Col_Row_only<vec_type>::res ult* junk = 0) zeros(const u32 n_elem, const typename arma_Mat_Col_Row_only<vec_type>::res ult* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
if(is_Row<vec_type>::value == true) if(is_Row<vec_type>::value == true)
{ {
return eOp<vec_type, eop_zeros>(1, n_elem); return eOp<vec_type, eop_zeros>(1, n_elem);
} }
else else
{ {
return eOp<vec_type, eop_zeros>(n_elem, 1); return eOp<vec_type, eop_zeros>(n_elem, 1);
} }
} }
skipping to change at line 63 skipping to change at line 62
return eOp<mat, eop_zeros>(n_rows, n_cols); return eOp<mat, eop_zeros>(n_rows, n_cols);
} }
template<typename mat_type> template<typename mat_type>
arma_inline arma_inline
const eOp<mat_type, eop_zeros> const eOp<mat_type, eop_zeros>
zeros(const u32 n_rows, const u32 n_cols, const typename arma_Mat_Col_Row_o nly<mat_type>::result* junk = 0) zeros(const u32 n_rows, const u32 n_cols, const typename arma_Mat_Col_Row_o nly<mat_type>::result* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_type_check<is_Mat<mat_type>::value == false>::apply(); arma_ignore(junk);
return eOp<mat_type, eop_zeros>(n_rows, n_cols); return eOp<mat_type, eop_zeros>(n_rows, n_cols);
} }
arma_inline arma_inline
const eOpCube<cube, eop_zeros> const eOpCube<cube, eop_zeros>
zeros(const u32 n_rows, const u32 n_cols, const u32 n_slices) zeros(const u32 n_rows, const u32 n_cols, const u32 n_slices)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
return eOpCube<cube, eop_zeros>(n_rows, n_cols, n_slices); return eOpCube<cube, eop_zeros>(n_rows, n_cols, n_slices);
} }
template<typename cube_type> template<typename cube_type>
arma_inline arma_inline
const eOpCube<cube_type, eop_zeros> const eOpCube<cube_type, eop_zeros>
zeros(const u32 n_rows, const u32 n_cols, const u32 n_slices, const typenam e arma_Cube_only<cube_type>::result* junk = 0) zeros(const u32 n_rows, const u32 n_cols, const u32 n_slices, const typenam e arma_Cube_only<cube_type>::result* junk = 0)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_type_check<is_Cube<cube_type>::value == false>::apply(); arma_ignore(junk);
return eOpCube<cube_type, eop_zeros>(n_rows, n_cols, n_slices); return eOpCube<cube_type, eop_zeros>(n_rows, n_cols, n_slices);
} }
//! @} //! @}
 End of changes. 4 change blocks. 
7 lines changed or deleted 6 lines changed or added


 format_wrap.hpp   format_wrap.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 488 skipping to change at line 485
template<typename T1, typename T2> template<typename T1, typename T2>
struct basic_format_only< basic_format<T1, T2> > { typedef basic_format <T1,T2> result; }; struct basic_format_only< basic_format<T1, T2> > { typedef basic_format <T1,T2> result; };
#endif #endif
template<typename T1> template<typename T1>
inline inline
static static
const T1& const T1&
str_wrapper(const T1& x, const typename string_only<T1>::result* junk = 0 ) str_wrapper(const T1& x, const typename string_only<T1>::result* junk = 0 )
{ {
arma_ignore(junk);
return x; return x;
} }
template<typename T1> template<typename T1>
inline inline
static static
const T1* const T1*
str_wrapper(const T1* x, const typename char_only<T1>::result* junk = 0) str_wrapper(const T1* x, const typename char_only<T1>::result* junk = 0)
{ {
arma_ignore(junk);
return x; return x;
} }
template<typename T1> template<typename T1>
inline inline
static static
std::string std::string
str_wrapper(const T1& x, const typename basic_format_only<T1>::result* ju nk = 0) str_wrapper(const T1& x, const typename basic_format_only<T1>::result* ju nk = 0)
{ {
arma_ignore(junk);
return str(x); return str(x);
} }
} }
//! @} //! @}
 End of changes. 4 change blocks. 
5 lines changed or deleted 8 lines changed or added


 forward_proto.hpp   forward_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 gemm.hpp   gemm.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 441 skipping to change at line 438
(do_trans_A) ? A.n_rows : C.n_rows, (do_trans_A) ? A.n_rows : C.n_rows,
B.mem, B.mem,
(do_trans_B) ? C.n_cols : ( (do_trans_A) ? A.n_rows : A.n_cols ), (do_trans_B) ? C.n_cols : ( (do_trans_A) ? A.n_rows : A.n_cols ),
(use_beta) ? beta : eT(0), (use_beta) ? beta : eT(0),
C.memptr(), C.memptr(),
C.n_rows C.n_rows
); );
} }
#elif defined(ARMA_USE_BLAS) #elif defined(ARMA_USE_BLAS)
{ {
arma_extra_debug_print("blas::gemm_()"); arma_extra_debug_print("blas::gemm()");
const char trans_A = (do_trans_A) ? 'T' : 'N'; const char trans_A = (do_trans_A) ? 'T' : 'N';
const char trans_B = (do_trans_B) ? 'T' : 'N'; const char trans_B = (do_trans_B) ? 'T' : 'N';
const blas_int m = C.n_rows; const blas_int m = C.n_rows;
const blas_int n = C.n_cols; const blas_int n = C.n_cols;
const blas_int k = (do_trans_A) ? A.n_rows : A.n_cols; const blas_int k = (do_trans_A) ? A.n_rows : A.n_cols;
const eT local_alpha = (use_alpha) ? alpha : eT(1); const eT local_alpha = (use_alpha) ? alpha : eT(1);
const blas_int lda = (do_trans_A) ? k : m; const blas_int lda = (do_trans_A) ? k : m;
const blas_int ldb = (do_trans_B) ? n : k; const blas_int ldb = (do_trans_B) ? n : k;
const eT local_beta = (use_beta) ? beta : eT(0); const eT local_beta = (use_beta) ? beta : eT(0);
arma_extra_debug_print( arma_boost::format("blas::gemm_(): trans_A arma_extra_debug_print( arma_boost::format("blas::gemm(): trans_A =
= %c") % trans_A ); %c") % trans_A );
arma_extra_debug_print( arma_boost::format("blas::gemm_(): trans_B arma_extra_debug_print( arma_boost::format("blas::gemm(): trans_B =
= %c") % trans_B ); %c") % trans_B );
blas::gemm_<eT> blas::gemm<eT>
( (
&trans_A, &trans_A,
&trans_B, &trans_B,
&m, &m,
&n, &n,
&k, &k,
&local_alpha, &local_alpha,
A.mem, A.mem,
&lda, &lda,
B.mem, B.mem,
 End of changes. 4 change blocks. 
11 lines changed or deleted 8 lines changed or added


 gemm_mixed.hpp   gemm_mixed.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 gemv.hpp   gemv.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 160 skipping to change at line 157
A.n_rows, A.n_rows,
x, x,
1, 1,
(use_beta) ? beta : eT(0), (use_beta) ? beta : eT(0),
y, y,
1 1
); );
} }
#elif defined(ARMA_USE_BLAS) #elif defined(ARMA_USE_BLAS)
{ {
arma_extra_debug_print("blas::gemv_()"); arma_extra_debug_print("blas::gemv()");
const char trans_A = (do_trans_A) ? 'T' : 'N'; const char trans_A = (do_trans_A) ? 'T' : 'N';
const blas_int m = A.n_rows; const blas_int m = A.n_rows;
const blas_int n = A.n_cols; const blas_int n = A.n_cols;
const eT local_alpha = (use_alpha) ? alpha : eT(1); const eT local_alpha = (use_alpha) ? alpha : eT(1);
//const blas_int lda = A.n_rows; //const blas_int lda = A.n_rows;
const blas_int inc = 1; const blas_int inc = 1;
const eT local_beta = (use_beta) ? beta : eT(0); const eT local_beta = (use_beta) ? beta : eT(0);
arma_extra_debug_print( arma_boost::format("blas::gemv_(): trans_A = %c") % trans_A ); arma_extra_debug_print( arma_boost::format("blas::gemv(): trans_A = %c") % trans_A );
blas::gemv_<eT> blas::gemv<eT>
( (
&trans_A, &trans_A,
&m, &m,
&n, &n,
&local_alpha, &local_alpha,
A.mem, A.mem,
&m, // lda &m, // lda
x, x,
&inc, &inc,
&local_beta, &local_beta,
 End of changes. 4 change blocks. 
8 lines changed or deleted 5 lines changed or added


 glue_conv_meat.hpp   glue_conv_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 glue_conv_proto.hpp   glue_conv_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 glue_cor_meat.hpp   glue_cor_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 glue_cor_proto.hpp   glue_cor_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 glue_cov_meat.hpp   glue_cov_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 glue_cov_proto.hpp   glue_cov_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 glue_cross_meat.hpp   glue_cross_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 glue_cross_proto.hpp   glue_cross_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 glue_join_meat.hpp   glue_join_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 glue_join_proto.hpp   glue_join_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 glue_kron_meat.hpp   glue_kron_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 glue_kron_proto.hpp   glue_kron_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 glue_mixed_meat.hpp   glue_mixed_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 glue_mixed_proto.hpp   glue_mixed_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 glue_relational_meat.hpp   glue_relational_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 glue_relational_proto.hpp   glue_relational_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 glue_solve_meat.hpp   glue_solve_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 34 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.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)
 End of changes. 2 change blocks. 
5 lines changed or deleted 3 lines changed or added


 glue_solve_proto.hpp   glue_solve_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 glue_times_meat.hpp   glue_times_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 glue_times_proto.hpp   glue_times_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 glue_toeplitz_meat.hpp   glue_toeplitz_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 glue_toeplitz_proto.hpp   glue_toeplitz_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 injector_meat.hpp   injector_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 injector_proto.hpp   injector_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 itpp_wrap.hpp   itpp_wrap.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 lapack_proto.hpp   lapack_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
// // Copyright (C) 2009 Edmund Highcock
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Edmund Highcock (edmund dot highcock at merton dot ox dot ac dot uk)
// //
// 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 28 skipping to change at line 25
//! \namespace lapack namespace for LAPACK functions //! \namespace lapack namespace for LAPACK functions
namespace lapack namespace lapack
{ {
//! \addtogroup LAPACK //! \addtogroup LAPACK
//! @{ //! @{
extern "C" extern "C"
{ {
// LU factorisation // LU factorisation
void sgetrf_(blas_int* m, blas_int* n, float* a, blas_int* lda, blas_i void arma_fortran(sgetrf)(blas_int* m, blas_int* n, float* a, blas_int
nt* ipiv, blas_int* info); * lda, blas_int* ipiv, blas_int* info);
void dgetrf_(blas_int* m, blas_int* n, double* a, blas_int* lda, blas_i void arma_fortran(dgetrf)(blas_int* m, blas_int* n, double* a, blas_int
nt* ipiv, blas_int* info); * lda, blas_int* ipiv, blas_int* info);
void cgetrf_(blas_int* m, blas_int* n, void* a, blas_int* lda, blas_i void arma_fortran(cgetrf)(blas_int* m, blas_int* n, void* a, blas_int
nt* ipiv, blas_int* info); * lda, blas_int* ipiv, blas_int* info);
void zgetrf_(blas_int* m, blas_int* n, void* a, blas_int* lda, blas_i void arma_fortran(zgetrf)(blas_int* m, blas_int* n, void* a, blas_int
nt* ipiv, blas_int* info); * lda, blas_int* ipiv, blas_int* info);
// matrix inversion // matrix inversion
void sgetri_(blas_int* n, float* a, blas_int* lda, blas_int* ipiv, fl void arma_fortran(sgetri)(blas_int* n, float* a, blas_int* lda, blas_i
oat* work, blas_int* lwork, blas_int* info); nt* ipiv, float* work, blas_int* lwork, blas_int* info);
void dgetri_(blas_int* n, double* a, blas_int* lda, blas_int* ipiv, dou void arma_fortran(dgetri)(blas_int* n, double* a, blas_int* lda, blas_i
ble* work, blas_int* lwork, blas_int* info); nt* ipiv, double* work, blas_int* lwork, blas_int* info);
void cgetri_(blas_int* n, void* a, blas_int* lda, blas_int* ipiv, v void arma_fortran(cgetri)(blas_int* n, void* a, blas_int* lda, blas_i
oid* work, blas_int* lwork, blas_int* info); nt* ipiv, void* work, blas_int* lwork, blas_int* info);
void zgetri_(blas_int* n, void* a, blas_int* lda, blas_int* ipiv, v void arma_fortran(zgetri)(blas_int* n, void* a, blas_int* lda, blas_i
oid* work, blas_int* lwork, blas_int* info); nt* ipiv, void* work, blas_int* lwork, blas_int* info);
// eigenvector decomposition of symmetric real matrices // eigenvector decomposition of symmetric real matrices
void ssyev_(char* jobz, char* uplo, blas_int* n, float* a, blas_int* l void arma_fortran(ssyev)(char* jobz, char* uplo, blas_int* n, float* a
da, float* w, float* work, blas_int* lwork, blas_int* info); , blas_int* lda, float* w, float* work, blas_int* lwork, blas_int* info);
void dsyev_(char* jobz, char* uplo, blas_int* n, double* a, blas_int* l void arma_fortran(dsyev)(char* jobz, char* uplo, blas_int* n, double* a
da, double* w, double* work, blas_int* lwork, blas_int* info); , 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 cheev_(char* jobz, char* uplo, blas_int* n, void* a, blas_int* l void arma_fortran(cheev)(char* jobz, char* uplo, blas_int* n, void* a
da, float* w, void* work, blas_int* lwork, float* rwork, blas_int* info , blas_int* lda, float* w, void* work, blas_int* lwork, float* rwork, b
); las_int* info);
void zheev_(char* jobz, char* uplo, blas_int* n, void* a, blas_int* l void arma_fortran(zheev)(char* jobz, char* uplo, blas_int* n, void* a
da, double* w, void* work, blas_int* lwork, double* rwork, blas_int* info , 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 sgeev_(char* jobvl, char* jobvr, blas_int* n, float* a, blas_int* void arma_fortran(sgeev)(char* jobvl, char* jobvr, blas_int* n, float*
lda, float* wr, float* wi, float* vl, blas_int* ldvl, float* vr, blas_ a, blas_int* lda, float* wr, float* wi, float* vl, blas_int* ldvl, flo
int* ldvr, float* work, blas_int* lwork, blas_int* info); at* vr, blas_int* ldvr, float* work, blas_int* lwork, blas_int* info);
void dgeev_(char* jobvl, char* jobvr, blas_int* n, double* a, blas_int* void arma_fortran(dgeev)(char* jobvl, char* jobvr, blas_int* n, double*
lda, double* wr, double* wi, double* vl, blas_int* ldvl, double* vr, blas_ a, blas_int* lda, double* wr, double* wi, double* vl, blas_int* ldvl, doub
int* ldvr, double* work, blas_int* lwork, blas_int* info); le* vr, blas_int* ldvr, double* work, blas_int* lwork, blas_int* info);
// eigenvector decomposition of general complex matrices // eigenvector decomposition of general complex matrices
void cgeev_(char* jobvr, char* jobvl, blas_int* n, void* a, blas_int* l void arma_fortran(cgeev)(char* jobvr, char* jobvl, blas_int* n, void* a
da, void* w, void* vl, blas_int* ldvl, void* vr, blas_int* ldvr, void* work , blas_int* lda, void* w, void* vl, blas_int* ldvl, void* vr, blas_int* ldv
, blas_int* lwork, float* rwork, blas_int* info); r, void* work, blas_int* lwork, float* rwork, blas_int* info);
void zgeev_(char* jobvl, char* jobvr, blas_int* n, void* a, blas_int* l void arma_fortran(zgeev)(char* jobvl, char* jobvr, blas_int* n, void* a
da, void* w, void* vl, blas_int* ldvl, void* vr, blas_int* ldvr, void* work , blas_int* lda, void* w, void* vl, blas_int* ldvl, void* vr, blas_int* ldv
, blas_int* lwork, double* rwork, blas_int* info); r, void* work, blas_int* lwork, double* rwork, blas_int* info);
// Cholesky decomposition // Cholesky decomposition
void spotrf_(char* uplo, blas_int* n, float* a, blas_int* lda, blas_in void arma_fortran(spotrf)(char* uplo, blas_int* n, float* a, blas_int*
t* info); lda, blas_int* info);
void dpotrf_(char* uplo, blas_int* n, double* a, blas_int* lda, blas_in void arma_fortran(dpotrf)(char* uplo, blas_int* n, double* a, blas_int*
t* info); lda, blas_int* info);
void cpotrf_(char* uplo, blas_int* n, void* a, blas_int* lda, blas_in void arma_fortran(cpotrf)(char* uplo, blas_int* n, void* a, blas_int*
t* info); lda, blas_int* info);
void zpotrf_(char* uplo, blas_int* n, void* a, blas_int* lda, blas_in void arma_fortran(zpotrf)(char* uplo, blas_int* n, void* a, blas_int*
t* info); lda, blas_int* info);
// QR decomposition // QR decomposition
void sgeqrf_(blas_int* m, blas_int* n, float* a, blas_int* lda, float void arma_fortran(sgeqrf)(blas_int* m, blas_int* n, float* a, blas_int
* tau, float* work, blas_int* lwork, blas_int* info); * lda, float* tau, float* work, blas_int* lwork, blas_int* info);
void dgeqrf_(blas_int* m, blas_int* n, double* a, blas_int* lda, double void arma_fortran(dgeqrf)(blas_int* m, blas_int* n, double* a, blas_int
* tau, double* work, blas_int* lwork, blas_int* info); * lda, double* tau, double* work, blas_int* lwork, blas_int* info);
void cgeqrf_(blas_int* m, blas_int* n, void* a, blas_int* lda, void void arma_fortran(cgeqrf)(blas_int* m, blas_int* n, void* a, blas_int
* tau, void* work, blas_int* lwork, blas_int* info); * lda, void* tau, void* work, blas_int* lwork, blas_int* info);
void zgeqrf_(blas_int* m, blas_int* n, void* a, blas_int* lda, void void arma_fortran(zgeqrf)(blas_int* m, blas_int* n, void* a, blas_int
* tau, void* work, blas_int* lwork, blas_int* info); * lda, void* tau, void* work, blas_int* lwork, blas_int* info);
// Q matrix calculation from QR decomposition (real matrices) // Q matrix calculation from QR decomposition (real matrices)
void sorgqr_(blas_int* m, blas_int* n, blas_int* k, float* a, blas_int void arma_fortran(sorgqr)(blas_int* m, blas_int* n, blas_int* k, float
* lda, float* tau, float* work, blas_int* lwork, blas_int* info); * a, blas_int* lda, float* tau, float* work, blas_int* lwork, blas_int* i
void dorgqr_(blas_int* m, blas_int* n, blas_int* k, double* a, blas_int nfo);
* lda, double* tau, double* work, blas_int* lwork, blas_int* info); void arma_fortran(dorgqr)(blas_int* m, blas_int* n, blas_int* k, double
* a, blas_int* lda, double* tau, double* work, blas_int* lwork, blas_int* i
nfo);
// Q matrix calculation from QR decomposition (complex matrices) // Q matrix calculation from QR decomposition (complex matrices)
void cungqr_(blas_int* m, blas_int* n, blas_int* k, void* a, blas_int void arma_fortran(cungqr)(blas_int* m, blas_int* n, blas_int* k, void
* lda, void* tau, void* work, blas_int* lwork, blas_int* info); * a, blas_int* lda, void* tau, void* work, blas_int* lwork, blas_int* i
void zungqr_(blas_int* m, blas_int* n, blas_int* k, void* a, blas_int nfo);
* lda, void* tau, void* work, blas_int* lwork, blas_int* info); void arma_fortran(zungqr)(blas_int* m, blas_int* n, blas_int* k, void
* a, blas_int* lda, void* tau, void* work, blas_int* lwork, blas_int* i
nfo);
// SVD (real matrices) // SVD (real matrices)
void sgesvd_(char* jobu, char* jobvt, blas_int* m, blas_int* n, float* void arma_fortran(sgesvd)(char* jobu, char* jobvt, blas_int* m, blas_in
a, blas_int* lda, float* s, float* u, blas_int* ldu, float* vt, blas_in t* n, float* a, blas_int* lda, float* s, float* u, blas_int* ldu, float*
t* ldvt, float* work, blas_int* lwork, blas_int* info); vt, blas_int* ldvt, float* work, blas_int* lwork, blas_int* info);
void dgesvd_(char* jobu, char* jobvt, blas_int* m, blas_int* n, double* void arma_fortran(dgesvd)(char* jobu, char* jobvt, blas_int* m, blas_in
a, blas_int* lda, double* s, double* u, blas_int* ldu, double* vt, blas_in t* n, double* a, blas_int* lda, double* s, double* u, blas_int* ldu, double
t* ldvt, double* work, blas_int* lwork, blas_int* info); * vt, blas_int* ldvt, double* work, blas_int* lwork, blas_int* info);
// SVD (complex matrices) // SVD (complex matrices)
void cgesvd_(char* jobu, char* jobvt, blas_int* m, blas_int* n, void* void arma_fortran(cgesvd)(char* jobu, char* jobvt, blas_int* m, blas_in
a, blas_int* lda, float* s, void* u, blas_int* ldu, void* vt, blas_in t* n, void* a, blas_int* lda, float* s, void* u, blas_int* ldu, void*
t* ldvt, void* work, blas_int* lwork, float* rwork, blas_int* info); vt, blas_int* ldvt, void* work, blas_int* lwork, float* rwork, blas_in
void zgesvd_(char* jobu, char* jobvt, blas_int* m, blas_int* n, void* t* info);
a, blas_int* lda, double* s, void* u, blas_int* ldu, void* vt, blas_in void arma_fortran(zgesvd)(char* jobu, char* jobvt, blas_int* m, blas_in
t* ldvt, void* work, blas_int* lwork, double* rwork, blas_int* info); t* n, void* a, blas_int* lda, double* s, void* u, blas_int* ldu, void*
vt, blas_int* ldvt, void* work, blas_int* lwork, double* rwork, blas_in
t* info);
// solve system of linear equations, using LU decomposition // solve system of linear equations, using LU decomposition
void sgesv_(blas_int* n, blas_int* nrhs, float* a, blas_int* lda, blas void arma_fortran(sgesv)(blas_int* n, blas_int* nrhs, float* a, blas_i
_int* ipiv, float* b, blas_int* ldb, blas_int* info); nt* lda, blas_int* ipiv, float* b, blas_int* ldb, blas_int* info);
void dgesv_(blas_int* n, blas_int* nrhs, double* a, blas_int* lda, blas void arma_fortran(dgesv)(blas_int* n, blas_int* nrhs, double* a, blas_i
_int* ipiv, double* b, blas_int* ldb, blas_int* info); nt* lda, blas_int* ipiv, double* b, blas_int* ldb, blas_int* info);
void cgesv_(blas_int* n, blas_int* nrhs, void* a, blas_int* lda, blas void arma_fortran(cgesv)(blas_int* n, blas_int* nrhs, void* a, blas_i
_int* ipiv, void* b, blas_int* ldb, blas_int* info); nt* lda, blas_int* ipiv, void* b, blas_int* ldb, blas_int* info);
void zgesv_(blas_int* n, blas_int* nrhs, void* a, blas_int* lda, blas void arma_fortran(zgesv)(blas_int* n, blas_int* nrhs, void* a, blas_i
_int* ipiv, void* b, blas_int* ldb, blas_int* info); 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 sgels_(char* trans, blas_int* m, blas_int* n, blas_int* nrhs, floa void arma_fortran(sgels)(char* trans, blas_int* m, blas_int* n, blas_in
t* a, blas_int* lda, float* b, blas_int* ldb, float* work, blas_int* lwo t* nrhs, float* a, blas_int* lda, float* b, blas_int* ldb, float* work,
rk, blas_int* info); blas_int* lwork, blas_int* info);
void dgels_(char* trans, blas_int* m, blas_int* n, blas_int* nrhs, doub void arma_fortran(dgels)(char* trans, blas_int* m, blas_int* n, blas_in
le* a, blas_int* lda, double* b, blas_int* ldb, double* work, blas_int* lwo t* nrhs, double* a, blas_int* lda, double* b, blas_int* ldb, double* work,
rk, blas_int* info); blas_int* lwork, blas_int* info);
void cgels_(char* trans, blas_int* m, blas_int* n, blas_int* nrhs, void void arma_fortran(cgels)(char* trans, blas_int* m, blas_int* n, blas_in
* a, blas_int* lda, void* b, blas_int* ldb, void* work, blas_int* lwo t* nrhs, void* a, blas_int* lda, void* b, blas_int* ldb, void* work,
rk, blas_int* info); blas_int* lwork, blas_int* info);
void zgels_(char* trans, blas_int* m, blas_int* n, blas_int* nrhs, void void arma_fortran(zgels)(char* trans, blas_int* m, blas_int* n, blas_in
* a, blas_int* lda, void* b, blas_int* ldb, void* work, blas_int* lwo t* nrhs, void* a, blas_int* lda, void* b, blas_int* ldb, void* work,
rk, blas_int* info); blas_int* lwork, blas_int* info);
// void dgeqp3_(blas_int* m, blas_int* n, double* a, blas_int* lda, bla
s_int* jpvt, double* tau, double* work, blas_int* lwork, blas_int* info);
// void dormqr_(char* side, char* trans, blas_int* m, blas_int* n, blas
_int* k, double* a, blas_int* lda, double* tau, double* c, blas_int* ldc, d
ouble* work, blas_int* lwork, blas_int* info);
// void dposv_(char* uplo, blas_int* n, blas_int* nrhs, double* a, bla
s_int* lda, double* b, blas_int* ldb, blas_int* info);
// void 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* in
fo);
// void 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* bwork, blas_in
t* 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(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);
} }
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, bl as_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();
if(is_float<eT>::value == true) if(is_float<eT>::value == true)
{ {
typedef float T; typedef float T;
sgetrf_(m, n, (T*)a, lda, ipiv, info); arma_fortran(sgetrf)(m, n, (T*)a, lda, ipiv, info);
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
dgetrf_(m, n, (T*)a, lda, ipiv, info); arma_fortran(dgetrf)(m, n, (T*)a, lda, ipiv, info);
} }
else else
if(is_supported_complex_float<eT>::value == true) if(is_supported_complex_float<eT>::value == true)
{ {
typedef std::complex<float> T; typedef std::complex<float> T;
cgetrf_(m, n, (T*)a, lda, ipiv, info); arma_fortran(cgetrf)(m, n, (T*)a, lda, ipiv, 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;
zgetrf_(m, n, (T*)a, lda, ipiv, info); arma_fortran(zgetrf)(m, n, (T*)a, lda, ipiv, info);
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
getri_(blas_int* n, eT* a, blas_int* lda, blas_int* ipiv, eT* work, blas _int* lwork, blas_int* info) getri(blas_int* n, eT* a, blas_int* lda, blas_int* ipiv, eT* 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;
sgetri_(n, (T*)a, lda, ipiv, (T*)work, lwork, info); arma_fortran(sgetri)(n, (T*)a, lda, ipiv, (T*)work, lwork, info);
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
dgetri_(n, (T*)a, lda, ipiv, (T*)work, lwork, info); arma_fortran(dgetri)(n, (T*)a, lda, ipiv, (T*)work, lwork, info);
} }
else else
if(is_supported_complex_float<eT>::value == true) if(is_supported_complex_float<eT>::value == true)
{ {
typedef std::complex<float> T; typedef std::complex<float> T;
cgetri_(n, (T*)a, lda, ipiv, (T*)work, lwork, info); arma_fortran(cgetri)(n, (T*)a, lda, ipiv, (T*)work, 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;
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
syev_(char* jobz, char* uplo, blas_int* n, eT* a, blas_int* lda, eT* w, eT* 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;
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
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
dsyev_(jobz, uplo, n, (T*)a, lda, (T*)w, (T*)work, lwork, info); arma_fortran(dsyev)(jobz, uplo, n, (T*)a, lda, (T*)w, (T*)work, lwork , info);
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
heev_ heev
( (
char* jobz, char* uplo, blas_int* n, char* jobz, char* uplo, blas_int* n,
eT* a, blas_int* lda, typename eT::value_type* w, eT* a, blas_int* lda, typename eT::value_type* w,
eT* work, blas_int* lwork, typename eT::value_type* rwork, eT* work, blas_int* lwork, typename eT::value_type* rwork,
blas_int* info 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_supported_complex_float<eT>::value == true) if(is_supported_complex_float<eT>::value == true)
{ {
typedef float T; typedef float T;
typedef typename std::complex<T> cx_T; typedef typename std::complex<T> cx_T;
cheev_(jobz, uplo, n, (cx_T*)a, lda, (T*)w, (cx_T*)work, lwork, (T*)r work, info); arma_fortran(cheev)(jobz, uplo, n, (cx_T*)a, lda, (T*)w, (cx_T*)work, lwork, (T*)rwork, info);
} }
else else
if(is_supported_complex_double<eT>::value == true) if(is_supported_complex_double<eT>::value == true)
{ {
typedef double T; typedef double T;
typedef typename std::complex<T> cx_T; typedef typename std::complex<T> cx_T;
zheev_(jobz, uplo, n, (cx_T*)a, lda, (T*)w, (cx_T*)work, lwork, (T*)r work, info); arma_fortran(zheev)(jobz, uplo, n, (cx_T*)a, lda, (T*)w, (cx_T*)work, lwork, (T*)rwork, info);
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
geev_ geev
( (
char* jobvl, char* jobvr, blas_int* n, char* jobvl, char* jobvr, blas_int* n,
eT* a, blas_int* lda, eT* wr, eT* wi, eT* vl, eT* a, blas_int* lda, eT* wr, eT* wi, eT* vl,
blas_int* ldvl, eT* vr, blas_int* ldvr, blas_int* ldvl, eT* vr, blas_int* ldvr,
eT* work, blas_int* lwork, eT* work, blas_int* lwork,
blas_int* info 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;
sgeev_(jobvl, jobvr, n, (T*)a, lda, (T*)wr, (T*)wi, (T*)vl, ldvl, (T *)vr, ldvr, (T*)work, lwork, info); arma_fortran(sgeev)(jobvl, jobvr, n, (T*)a, lda, (T*)wr, (T*)wi, (T* )vl, ldvl, (T*)vr, ldvr, (T*)work, lwork, info);
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
dgeev_(jobvl, jobvr, n, (T*)a, lda, (T*)wr, (T*)wi, (T*)vl, ldvl, (T *)vr, ldvr, (T*)work, lwork, info); arma_fortran(dgeev)(jobvl, jobvr, n, (T*)a, lda, (T*)wr, (T*)wi, (T* )vl, ldvl, (T*)vr, ldvr, (T*)work, lwork, info);
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
cx_geev_ cx_geev
( (
char* jobvl, char* jobvr, blas_int* n, char* jobvl, char* jobvr, blas_int* n,
eT* a, blas_int* lda, eT* w, eT* a, blas_int* lda, eT* w,
eT* vl, blas_int* ldvl, eT* vl, blas_int* ldvl,
eT* vr, blas_int* ldvr, eT* vr, blas_int* ldvr,
eT* work, blas_int* lwork, typename eT::value_type* rwork, eT* work, blas_int* lwork, typename eT::value_type* rwork,
blas_int* info 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_supported_complex_float<eT>::value == true) if(is_supported_complex_float<eT>::value == true)
{ {
typedef float T; typedef float T;
typedef typename std::complex<T> cx_T; typedef typename std::complex<T> cx_T;
cgeev_(jobvl, jobvr, n, (cx_T*)a, lda, (cx_T*)w, (cx_T*)vl, ldvl, (cx _T*)vr, ldvr, (cx_T*)work, lwork, (T*)rwork, info); arma_fortran(cgeev)(jobvl, jobvr, n, (cx_T*)a, lda, (cx_T*)w, (cx_T*) vl, ldvl, (cx_T*)vr, ldvr, (cx_T*)work, lwork, (T*)rwork, info);
} }
else else
if(is_supported_complex_double<eT>::value == true) if(is_supported_complex_double<eT>::value == true)
{ {
typedef double T; typedef double T;
typedef typename std::complex<T> cx_T; typedef typename std::complex<T> cx_T;
zgeev_(jobvl, jobvr, n, (cx_T*)a, lda, (cx_T*)w, (cx_T*)vl, ldvl, (cx _T*)vr, ldvr, (cx_T*)work, lwork, (T*)rwork, info); arma_fortran(zgeev)(jobvl, jobvr, n, (cx_T*)a, lda, (cx_T*)w, (cx_T*) vl, ldvl, (cx_T*)vr, ldvr, (cx_T*)work, lwork, (T*)rwork, info);
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
potrf_(char* uplo, blas_int* n, eT* a, blas_int* lda, blas_int* info) potrf(char* uplo, blas_int* n, eT* a, blas_int* lda, 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;
spotrf_(uplo, n, (T*)a, lda, info); arma_fortran(spotrf)(uplo, n, (T*)a, lda, info);
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
dpotrf_(uplo, n, (T*)a, lda, info); arma_fortran(dpotrf)(uplo, n, (T*)a, lda, info);
} }
else else
if(is_supported_complex_float<eT>::value == true) if(is_supported_complex_float<eT>::value == true)
{ {
typedef std::complex<float> T; typedef std::complex<float> T;
cpotrf_(uplo, n, (T*)a, lda, info); arma_fortran(cpotrf)(uplo, n, (T*)a, lda, 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;
zpotrf_(uplo, n, (T*)a, lda, info); arma_fortran(zpotrf)(uplo, n, (T*)a, lda, info);
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
geqrf_(blas_int* m, blas_int* n, eT* a, blas_int* lda, eT* tau, eT* work, blas_int* lwork, blas_int* info) geqrf(blas_int* m, blas_int* n, eT* a, blas_int* lda, eT* tau, eT* 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;
sgeqrf_(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork, info); arma_fortran(sgeqrf)(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork, info );
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
dgeqrf_(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork, info); arma_fortran(dgeqrf)(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork, info );
} }
else else
if(is_supported_complex_float<eT>::value == true) if(is_supported_complex_float<eT>::value == true)
{ {
typedef std::complex<float> T; typedef std::complex<float> T;
cgeqrf_(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork, info); arma_fortran(cgeqrf)(m, n, (T*)a, lda, (T*)tau, (T*)work, 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;
zgeqrf_(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork, info); arma_fortran(zgeqrf)(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork, info );
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
orgqr_(blas_int* m, blas_int* n, blas_int* k, eT* a, blas_int* lda, eT* t au, eT* work, blas_int* lwork, blas_int* info) orgqr(blas_int* m, blas_int* n, blas_int* k, eT* a, blas_int* lda, eT* ta u, eT* 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;
sorgqr_(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwork, info); arma_fortran(sorgqr)(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwork, i nfo);
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
dorgqr_(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwork, info); arma_fortran(dorgqr)(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwork, i nfo);
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
ungqr_(blas_int* m, blas_int* n, blas_int* k, eT* a, blas_int* lda, eT* t au, eT* work, blas_int* lwork, blas_int* info) ungqr(blas_int* m, blas_int* n, blas_int* k, eT* a, blas_int* lda, eT* ta u, eT* 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_supported_complex_float<eT>::value == true) if(is_supported_complex_float<eT>::value == true)
{ {
typedef float T; typedef float T;
cungqr_(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwork, info); arma_fortran(cungqr)(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwork, i nfo);
} }
else else
if(is_supported_complex_double<eT>::value == true) if(is_supported_complex_double<eT>::value == true)
{ {
typedef double T; typedef double T;
zungqr_(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwork, info); arma_fortran(zungqr)(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwork, i nfo);
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
gesvd_ gesvd
( (
char* jobu, char* jobvt, blas_int* m, blas_int* n, eT* a, blas_int* lda , char* jobu, char* jobvt, blas_int* m, blas_int* n, eT* a, blas_int* lda ,
eT* s, eT* u, blas_int* ldu, eT* vt, blas_int* ldvt, eT* s, eT* u, blas_int* ldu, eT* vt, blas_int* ldvt,
eT* work, blas_int* lwork, blas_int* info eT* 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;
sgesvd_(jobu, jobvt, m, n, (T*)a, lda, (T*)s, (T*)u, ldu, (T*)vt, ldv t, (T*)work, lwork, info); arma_fortran(sgesvd)(jobu, jobvt, m, n, (T*)a, lda, (T*)s, (T*)u, ldu , (T*)vt, ldvt, (T*)work, lwork, info);
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
dgesvd_(jobu, jobvt, m, n, (T*)a, lda, (T*)s, (T*)u, ldu, (T*)vt, ldv t, (T*)work, lwork, info); arma_fortran(dgesvd)(jobu, jobvt, m, n, (T*)a, lda, (T*)s, (T*)u, ldu , (T*)vt, ldvt, (T*)work, lwork, info);
} }
} }
template<typename T> template<typename T>
inline inline
void void
cx_gesvd_ cx_gesvd
( (
char* jobu, char* jobvt, blas_int* m, blas_int* n, std::complex<T>* a, blas_int* lda, char* jobu, char* jobvt, blas_int* m, blas_int* n, std::complex<T>* a, blas_int* lda,
T* s, std::complex<T>* u, blas_int* ldu, std::complex<T>* vt, blas_int* ldvt, T* s, std::complex<T>* u, blas_int* ldu, std::complex<T>* vt, blas_int* ldvt,
std::complex<T>* work, blas_int* lwork, T* rwork, blas_int* info std::complex<T>* work, blas_int* lwork, T* rwork, blas_int* info
) )
{ {
arma_type_check<is_supported_blas_type<T>::value == false>::apply(); arma_type_check<is_supported_blas_type<T>::value == false>::apply();
arma_type_check<is_supported_blas_type< std::complex<T> >::value == fal se>::apply(); arma_type_check<is_supported_blas_type< std::complex<T> >::value == fal se>::apply();
if(is_float<T>::value == true) if(is_float<T>::value == true)
{ {
typedef float bT; typedef float bT;
cgesvd_ arma_fortran(cgesvd)
( (
jobu, jobvt, m, n, (std::complex<bT>*)a, lda, jobu, jobvt, m, n, (std::complex<bT>*)a, lda,
(bT*)s, (std::complex<bT>*)u, ldu, (std::complex<bT>*)vt, ldvt, (bT*)s, (std::complex<bT>*)u, ldu, (std::complex<bT>*)vt, ldvt,
(std::complex<bT>*)work, lwork, (bT*)rwork, info (std::complex<bT>*)work, lwork, (bT*)rwork, info
); );
} }
else else
if(is_double<T>::value == true) if(is_double<T>::value == true)
{ {
typedef double bT; typedef double bT;
zgesvd_ arma_fortran(zgesvd)
( (
jobu, jobvt, m, n, (std::complex<bT>*)a, lda, jobu, jobvt, m, n, (std::complex<bT>*)a, lda,
(bT*)s, (std::complex<bT>*)u, ldu, (std::complex<bT>*)vt, ldvt, (bT*)s, (std::complex<bT>*)u, ldu, (std::complex<bT>*)vt, ldvt,
(std::complex<bT>*)work, lwork, (bT*)rwork, info (std::complex<bT>*)work, lwork, (bT*)rwork, info
); );
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
gesv_(blas_int* n, blas_int* nrhs, eT* a, blas_int* lda, blas_int* ipiv, eT* b, blas_int* ldb, blas_int* info) gesv(blas_int* n, blas_int* nrhs, eT* a, blas_int* lda, blas_int* ipiv, e T* b, blas_int* ldb, 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;
sgesv_(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info); arma_fortran(sgesv)(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info);
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
dgesv_(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info); arma_fortran(dgesv)(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info);
} }
else else
if(is_supported_complex_float<eT>::value == true) if(is_supported_complex_float<eT>::value == true)
{ {
typedef std::complex<float> T; typedef std::complex<float> T;
cgesv_(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info); arma_fortran(cgesv)(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, 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;
zgesv_(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info); arma_fortran(zgesv)(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info);
} }
} }
template<typename eT> template<typename eT>
inline inline
void void
//sgels_(char* trans, blas_int* m, blas_int* n, blas_int* nrhs, float* a, gels(char* trans, blas_int* m, blas_int* n, blas_int* nrhs, eT* a, blas_i
blas_int* lda, float* b, blas_int* ldb, float* work, blas_int* lwork, bla nt* lda, eT* b, blas_int* ldb, eT* work, blas_int* lwork, blas_int* info)
s_int* info);
gels_(char* trans, blas_int* m, blas_int* n, blas_int* nrhs, eT* a, blas_
int* lda, eT* b, blas_int* ldb, eT* 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;
sgels_(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)work, lwork, in fo); arma_fortran(sgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)wo rk, lwork, info);
} }
else else
if(is_double<eT>::value == true) if(is_double<eT>::value == true)
{ {
typedef double T; typedef double T;
dgels_(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)work, lwork, in fo); arma_fortran(dgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)wo rk, lwork, info);
} }
else else
if(is_supported_complex_float<eT>::value == true) if(is_supported_complex_float<eT>::value == true)
{ {
typedef std::complex<float> T; typedef std::complex<float> T;
cgels_(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)work, lwork, in fo); 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;
zgels_(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)work, lwork, in fo); arma_fortran(zgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)wo rk, lwork, info);
} }
} }
//! @} //! @}
} }
#endif #endif
 End of changes. 70 change blocks. 
173 lines changed or deleted 173 lines changed or added


 mtGlueCube_meat.hpp   mtGlueCube_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 mtGlueCube_proto.hpp   mtGlueCube_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 mtGlue_meat.hpp   mtGlue_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 mtGlue_proto.hpp   mtGlue_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 mtOpCube_meat.hpp   mtOpCube_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 82 skipping to change at line 79
inline inline
mtOpCube<out_eT, T1, op_type>::mtOpCube(const char junk, const T1& in_m, co nst out_eT in_aux) mtOpCube<out_eT, T1, op_type>::mtOpCube(const char junk, const T1& in_m, co nst out_eT in_aux)
: m(in_m) : m(in_m)
, aux(aux) , aux(aux)
, aux_out_eT(in_aux) , aux_out_eT(in_aux)
, aux_u32_a(aux_u32_a) , aux_u32_a(aux_u32_a)
, aux_u32_b(aux_u32_b) , aux_u32_b(aux_u32_b)
, aux_u32_c(aux_u32_c) , aux_u32_c(aux_u32_c)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(junk);
} }
template<typename out_eT, typename T1, typename op_type> template<typename out_eT, typename T1, typename op_type>
inline inline
mtOpCube<out_eT, T1, op_type>::~mtOpCube() mtOpCube<out_eT, T1, op_type>::~mtOpCube()
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
//! @} //! @}
 End of changes. 2 change blocks. 
5 lines changed or deleted 3 lines changed or added


 mtOpCube_proto.hpp   mtOpCube_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 mtOp_meat.hpp   mtOp_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 76 skipping to change at line 73
template<typename out_eT, typename T1, typename op_type> template<typename out_eT, typename T1, typename op_type>
inline inline
mtOp<out_eT, T1, op_type>::mtOp(const char junk, const T1& in_m, const out_ eT in_aux) mtOp<out_eT, T1, op_type>::mtOp(const char junk, const T1& in_m, const out_ eT in_aux)
: m(in_m) : m(in_m)
, aux(aux) , aux(aux)
, aux_out_eT(in_aux) , aux_out_eT(in_aux)
, aux_u32_a(aux_u32_a) , aux_u32_a(aux_u32_a)
, aux_u32_b(aux_u32_b) , aux_u32_b(aux_u32_b)
{ {
arma_ignore(junk);
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
template<typename out_eT, typename T1, typename op_type> template<typename out_eT, typename T1, typename op_type>
inline inline
mtOp<out_eT, T1, op_type>::~mtOp() mtOp<out_eT, T1, op_type>::~mtOp()
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
 End of changes. 2 change blocks. 
5 lines changed or deleted 4 lines changed or added


 mtOp_proto.hpp   mtOp_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_chol_meat.hpp   op_chol_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// This file is part of the Armadillo C++ library. // This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup op_chol //! \addtogroup op_chol
//! @{ //! @{
template<typename T1> template<typename T1>
inline inline
void void
op_chol::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_chol>& X) op_chol::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_chol>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; const bool status = auxlib::chol(out, X.m);
const unwrap_check<T1> tmp(X.m, out);
const Mat<eT>& A = tmp.M;
arma_debug_check( (A.is_square() == false), "chol(): given matrix is not
square");
const bool ok = auxlib::chol(out, A);
if(ok == false) if(status == false)
{ {
arma_print("chol(): failed to converge");
out.reset(); out.reset();
arma_print("chol(): matrix factorisation failed");
} }
} }
//! @} //! @}
 End of changes. 5 change blocks. 
16 lines changed or deleted 5 lines changed or added


 op_chol_proto.hpp   op_chol_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_cor_meat.hpp   op_cor_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 op_cor_proto.hpp   op_cor_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 op_cov_meat.hpp   op_cov_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 op_cov_proto.hpp   op_cov_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 op_cx_scalar_meat.hpp   op_cx_scalar_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_cx_scalar_proto.hpp   op_cx_scalar_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_diagmat_meat.hpp   op_diagmat_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_diagmat_proto.hpp   op_diagmat_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_diagvec_meat.hpp   op_diagvec_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_diagvec_proto.hpp   op_diagvec_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_dot_meat.hpp   op_dot_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 71 skipping to change at line 68
} }
else else
{ {
#if defined(ARMA_USE_ATLAS) #if defined(ARMA_USE_ATLAS)
{ {
return atlas::cblas_dot(n_elem, A, B); return atlas::cblas_dot(n_elem, A, B);
} }
#elif defined(ARMA_USE_BLAS) #elif defined(ARMA_USE_BLAS)
{ {
const blas_int n = n_elem; const blas_int n = n_elem;
return blas::dot_(&n, A, B); return blas::dot(&n, A, B);
} }
#else #else
{ {
return op_dot::direct_dot_arma(n_elem, A, B); return op_dot::direct_dot_arma(n_elem, A, B);
} }
#endif #endif
} }
} }
//! for two arrays, complex version //! for two arrays, complex version
 End of changes. 2 change blocks. 
6 lines changed or deleted 3 lines changed or added


 op_dot_proto.hpp   op_dot_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_dotext_meat.hpp   op_dotext_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_dotext_proto.hpp   op_dotext_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_find_meat.hpp   op_find_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
// // Copyright (C) 2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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 61 skipping to change at line 58
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_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(junk2);
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
const eT val = X.aux; const eT val = X.aux;
const Proxy<T1> P(X.m); const Proxy<T1> P(X.m);
const u32 n_elem = P.get_n_elem(); const u32 n_elem = P.get_n_elem();
indices.set_size(n_elem, 1); indices.set_size(n_elem, 1);
skipping to change at line 161 skipping to change at line 161
return n_nz; return n_nz;
} }
template<typename T1, typename T2, typename glue_type> template<typename T1, typename T2, typename glue_type>
inline inline
u32 u32
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(junk2);
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;
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(); const u32 n_elem = A.get_n_elem();
skipping to change at line 215 skipping to change at line 219
return n_nz; return n_nz;
} }
template<typename T1, typename T2, typename glue_type> template<typename T1, typename T2, typename glue_type>
inline inline
u32 u32
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(junk2);
arma_ignore(junk3);
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(); 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();
 End of changes. 7 change blocks. 
9 lines changed or deleted 17 lines changed or added


 op_find_proto.hpp   op_find_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
// // Copyright (C) 2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 op_flip_meat.hpp   op_flip_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_flip_proto.hpp   op_flip_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_htrans_meat.hpp   op_htrans_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_htrans_proto.hpp   op_htrans_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_inv_meat.hpp   op_inv_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 31 skipping to change at line 28
inline inline
void void
op_inv::apply(Mat<eT>& out, const Mat<eT>& A) op_inv::apply(Mat<eT>& out, const Mat<eT>& A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
// no need to check for aliasing, due to: // no need to check for aliasing, due to:
// - auxlib::inv() copies A to out before inversion // - auxlib::inv() copies A to out before inversion
// - for 2x2 and 3x3 matrices the code is alias safe // - for 2x2 and 3x3 matrices the code is alias safe
arma_debug_check( !A.is_square(), "op_inv::apply(): matrix must be square auxlib::inv(out, A);
" );
const bool status = auxlib::inv(out, A);
if(status == false)
{
arma_warn( true, "inv(): matrix appears to be singular" );
out.set_size(0,0);
}
} }
//! immediate inverse of T1, storing the result in a dense matrix //! immediate inverse of T1, storing the result in a dense matrix
template<typename T1> template<typename T1>
inline inline
void void
op_inv::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_inv>& X) op_inv::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_inv>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
const strip_diagmat<T1> strip(X.m); const strip_diagmat<T1> strip(X.m);
if(strip.do_diagmat == true) if(strip.do_diagmat == true)
{ {
op_inv::apply_diag(out, strip.M); op_inv::apply_diag(out, strip.M);
} }
else else
{ {
const unwrap<T1> tmp(X.m); auxlib::inv(out, X.m);
const Mat<eT>& A = tmp.M;
op_inv::apply(out, A);
} }
} }
template<typename T1> template<typename T1>
inline inline
void void
op_inv::apply_diag(Mat<typename T1::elem_type>& out, const Base<typename T1 ::elem_type, T1>& X) op_inv::apply_diag(Mat<typename T1::elem_type>& out, const Base<typename T1 ::elem_type, T1>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
 End of changes. 3 change blocks. 
19 lines changed or deleted 4 lines changed or added


 op_inv_proto.hpp   op_inv_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// This file is part of the Armadillo C++ library. // This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup op_inv //! \addtogroup op_inv
//! @{ //! @{
//! 'invert matrix' operation //! 'invert matrix' operation
class op_inv class op_inv
{ {
public: public:
// mat
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);
}; };
 End of changes. 2 change blocks. 
7 lines changed or deleted 2 lines changed or added


 op_max_meat.hpp   op_max_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_max_proto.hpp   op_max_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_mean_meat.hpp   op_mean_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_mean_proto.hpp   op_mean_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_median_meat.hpp   op_median_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_median_proto.hpp   op_median_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_min_meat.hpp   op_min_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_min_proto.hpp   op_min_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_misc_meat.hpp   op_misc_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_misc_proto.hpp   op_misc_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_pinv_meat.hpp   op_pinv_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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 39 skipping to change at line 36
// SVD decomposition // SVD decomposition
Mat<eT> U; Mat<eT> U;
Col<eT> s; Col<eT> s;
Mat<eT> V; Mat<eT> V;
const bool status = (n_cols > n_rows) ? svd(U,s,V,trans(A)) : svd(U,s,V,A ); const bool status = (n_cols > n_rows) ? svd(U,s,V,trans(A)) : svd(U,s,V,A );
if(status == false) if(status == false)
{ {
out.set_size(0,0); out.reset();
return; return;
} }
// set tolerance to default if it hasn't been specified as an argument // set tolerance to default if it hasn't been specified as an argument
if(tol == eT(0)) if(tol == eT(0))
{ {
tol = (std::max)(n_rows,n_cols) * eop_aux::direct_eps(max(s)); tol = (std::max)(n_rows,n_cols) * eop_aux::direct_eps(max(s));
} }
// count non zero valued elements in s // count non zero valued elements in s
u32 count = 0;
for(u32 i = 0; i < s.n_elem; ++i) const u32 s_n_rows = s.n_rows;
u32 count = 0;
for(u32 i=0; i < s_n_rows; ++i)
{ {
if(s[i] > tol) if(s[i] > tol)
{ {
++count; ++count;
} }
} }
if(count != 0) if(count != 0)
{ {
// reduce the length of s in order to contain only the values above tol erance // reduce the length of s in order to contain only the values above tol erance
s = s.rows(0,count-1); if(count < s_n_rows)
{
//s = s.rows(0,count-1);
s.shed_rows(count, s_n_rows-1);
}
// set the elements of s equal to their reciprocals // set the elements of s equal to their reciprocals
s = eT(1) / s; s = eT(1) / s;
if(A.n_cols <= A.n_rows) if(A.n_cols <= A.n_rows)
{ {
out = V.cols(0,count-1) * diagmat(s) * trans(U.cols(0,count-1)); out = ( V.n_cols > count ? V.cols(0,count-1) : V ) * diagmat(s) * tra ns( U.n_cols > count ? U.cols(0,count-1) : U );
} }
else else
{ {
out = U.cols(0,count-1) * diagmat(s) * trans(V.cols(0,count-1)); out = ( U.n_cols > count ? U.cols(0,count-1) : U ) * diagmat(s) * tra ns( V.n_cols > count ? V.cols(0,count-1) : V );
} }
} }
else else
{ {
out.zeros(n_cols, n_rows); out.zeros(n_cols, n_rows);
} }
} }
template<typename T> template<typename T>
inline inline
skipping to change at line 103 skipping to change at line 107
// SVD decomposition // SVD decomposition
Mat<eT> U; Mat<eT> U;
Col< T> s; Col< T> s;
Mat<eT> V; Mat<eT> V;
const bool status = (n_cols > n_rows) ? svd(U,s,V,htrans(A)) : svd(U,s,V, A); const bool status = (n_cols > n_rows) ? svd(U,s,V,htrans(A)) : svd(U,s,V, A);
if(status == false) if(status == false)
{ {
out.set_size(0,0); out.reset();
return; return;
} }
// set tolerance to default if it hasn't been specified as an argument // set tolerance to default if it hasn't been specified as an argument
if(tol == T(0)) if(tol == T(0))
{ {
tol = (std::max)(n_rows,n_cols) * eop_aux::direct_eps(max(s)); tol = (std::max)(n_rows,n_cols) * eop_aux::direct_eps(max(s));
} }
// count non zero valued elements in s // count non zero valued elements in s
u32 count = 0;
for(u32 i = 0; i < s.n_elem; ++i) const u32 s_n_rows = s.n_rows;
u32 count = 0;
for(u32 i = 0; i < s_n_rows; ++i)
{ {
if(s[i] > tol) if(s[i] > tol)
{ {
++count; ++count;
} }
} }
if(count != 0) if(count != 0)
{ {
// reduce the length of s in order to contain only the values above tol erance // reduce the length of s in order to contain only the values above tol erance
s = s.rows(0,count-1); if(count < s_n_rows)
{
// s = s.rows(0,count-1);
s.shed_rows(count, s_n_rows-1);
}
// set the elements of s equal to their reciprocals // set the elements of s equal to their reciprocals
s = T(1) / s; s = T(1) / s;
if(n_rows >= n_cols) if(n_rows >= n_cols)
{ {
out = V.cols(0,count-1) * diagmat(s) * htrans(U.cols(0,count-1)); out = ( V.n_cols > count ? V.cols(0,count-1) : V ) * diagmat(s) * htr ans( U.n_cols > count ? U.cols(0,count-1) : U );
} }
else else
{ {
out = U.cols(0,count-1) * diagmat(s) * htrans(V.cols(0,count-1)); out = ( U.n_cols > count ? U.cols(0,count-1) : U ) * diagmat(s) * htr ans( V.n_cols > count ? V.cols(0,count-1) : V );
} }
} }
else else
{ {
out.zeros(n_cols, n_rows); out.zeros(n_cols, n_rows);
} }
} }
template<typename T1> template<typename T1>
inline inline
skipping to change at line 159 skipping to change at line 170
op_pinv::apply(Mat<typename T1::pod_type>& out, const Op<T1,op_pinv>& in) op_pinv::apply(Mat<typename T1::pod_type>& out, const Op<T1,op_pinv>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::pod_type eT; typedef typename T1::pod_type eT;
const eT tol = in.aux; const eT tol = in.aux;
arma_debug_check((tol < eT(0)), "pinv(): tol must be >= 0"); arma_debug_check((tol < eT(0)), "pinv(): tol must be >= 0");
const unwrap_check<T1> tmp(in.m, out); const unwrap<T1> tmp(in.m);
const Mat<eT>& A = tmp.M; const Mat<eT>& A = tmp.M;
op_pinv::direct_pinv(out, A, tol); op_pinv::direct_pinv(out, A, tol);
} }
template<typename T1> template<typename T1>
inline inline
void void
op_pinv::apply(Mat< std::complex<typename T1::pod_type> >& out, const Op<T1 ,op_pinv>& in) op_pinv::apply(Mat< std::complex<typename T1::pod_type> >& out, const Op<T1 ,op_pinv>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::pod_type T; typedef typename T1::pod_type T;
typedef typename std::complex<T> eT;
typedef typename std::complex<typename T1::pod_type> eT;
const T tol = in.aux.real(); const T tol = in.aux.real();
arma_debug_check((tol < T(0)), "pinv(): tol must be >= 0"); arma_debug_check((tol < T(0)), "pinv(): tol must be >= 0");
const unwrap_check<T1> tmp(in.m, out); const unwrap<T1> tmp(in.m);
const Mat<eT>& A = tmp.M; const Mat<eT>& A = tmp.M;
op_pinv::direct_pinv(out, A, tol); op_pinv::direct_pinv(out, A, tol);
} }
//! @} //! @}
 End of changes. 14 change blocks. 
25 lines changed or deleted 35 lines changed or added


 op_pinv_proto.hpp   op_pinv_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 op_princomp_cov_meat.hpp   op_princomp_cov_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
// // Copyright (C) 2010 Dimitrios Bouzas
// Authors:
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 op_princomp_cov_proto.hpp   op_princomp_cov_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
// // Copyright (C) 2010 Dimitrios Bouzas
// Authors:
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 op_princomp_meat.hpp   op_princomp_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
// // Copyright (C) 2010 Dimitrios Bouzas
// Authors:
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 op_princomp_proto.hpp   op_princomp_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
// // Copyright (C) 2010 Dimitrios Bouzas
// Authors:
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 op_prod_meat.hpp   op_prod_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_prod_proto.hpp   op_prod_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_relational_meat.hpp   op_relational_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_relational_proto.hpp   op_relational_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_repmat_meat.hpp   op_repmat_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 op_repmat_proto.hpp   op_repmat_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 op_reshape_meat.hpp   op_reshape_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_reshape_proto.hpp   op_reshape_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_shuffle_meat.hpp   op_shuffle_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 op_shuffle_proto.hpp   op_shuffle_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
// // Copyright (C) 2009-2010 Dimitrios Bouzas
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// - Dimitrios Bouzas (dimitris dot mpouzas at gmail dot com)
// //
// 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)
 End of changes. 1 change blocks. 
6 lines changed or deleted 3 lines changed or added


 op_sort_meat.hpp   op_sort_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_sort_proto.hpp   op_sort_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_stddev_meat.hpp   op_stddev_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_stddev_proto.hpp   op_stddev_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_sum_meat.hpp   op_sum_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_sum_proto.hpp   op_sum_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_trans_meat.hpp   op_trans_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_trans_proto.hpp   op_trans_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_var_meat.hpp   op_var_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 op_var_proto.hpp   op_var_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 operator_cube_div.hpp   operator_cube_div.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 operator_cube_minus.hpp   operator_cube_minus.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 operator_cube_plus.hpp   operator_cube_plus.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 operator_cube_relational.hpp   operator_cube_relational.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 operator_cube_schur.hpp   operator_cube_schur.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 operator_cube_times.hpp   operator_cube_times.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 operator_div.hpp   operator_div.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 operator_minus.hpp   operator_minus.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 operator_ostream.hpp   operator_ostream.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 operator_plus.hpp   operator_plus.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 operator_relational.hpp   operator_relational.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 operator_schur.hpp   operator_schur.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 operator_times.hpp   operator_times.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 podarray_meat.hpp   podarray_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 145 skipping to change at line 142
podarray<eT>::set_size(const u32 new_n_elem) podarray<eT>::set_size(const u32 new_n_elem)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
init(new_n_elem); init(new_n_elem);
} }
template<typename eT> template<typename eT>
inline inline
void void
podarray<eT>::reset()
{
arma_extra_debug_sigprint();
init(0);
}
template<typename eT>
inline
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) for(u32 i=0; i<n_elem; ++i)
{ {
access::rw(mem[i]) = val; access::rw(mem[i]) = val;
} }
} }
 End of changes. 2 change blocks. 
5 lines changed or deleted 12 lines changed or added


 podarray_proto.hpp   podarray_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 57 skipping to change at line 54
arma_inline explicit podarray(const eT* X, const u32 new_N); arma_inline explicit podarray(const eT* X, const u32 new_N);
arma_inline eT& operator[] (const u32 i); arma_inline eT& operator[] (const u32 i);
arma_inline eT operator[] (const u32 i) const; arma_inline eT operator[] (const u32 i) const;
arma_inline eT& operator() (const u32 i); arma_inline eT& operator() (const u32 i);
arma_inline eT operator() (const u32 i) const; arma_inline eT operator() (const u32 i) const;
inline void set_size(const u32 new_n_elem); inline void set_size(const u32 new_n_elem);
inline void reset();
inline void fill(const eT val); inline void fill(const eT val);
inline void zeros(); inline void zeros();
inline void zeros(const u32 new_n_elem); inline void zeros(const u32 new_n_elem);
arma_inline eT* memptr(); arma_inline eT* memptr();
arma_inline const eT* memptr() const; arma_inline const eT* memptr() const;
protected: protected:
 End of changes. 2 change blocks. 
5 lines changed or deleted 3 lines changed or added


 promote_type.hpp   promote_type.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 restrictors.hpp   restrictors.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 running_stat_meat.hpp   running_stat_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 running_stat_proto.hpp   running_stat_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 running_stat_vec_meat.hpp   running_stat_vec_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 running_stat_vec_proto.hpp   running_stat_vec_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 span.hpp   span.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 strip.hpp   strip.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 subview_cube_meat.hpp   subview_cube_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 subview_cube_proto.hpp   subview_cube_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 subview_field_meat.hpp   subview_field_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 subview_field_proto.hpp   subview_field_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 subview_meat.hpp   subview_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 subview_proto.hpp   subview_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 syslib_proto.hpp   syslib_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 traits.hpp   traits.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 353 skipping to change at line 350
static const bool value = false; static const bool value = false;
arma_inline static void check() {} arma_inline static void check() {}
}; };
// //
// //
// //
template<typename T1> template<typename T1>
struct isnt_fltpt
{
static const bool value = true;
inline static void check()
{
arma_static_assert<false> ERROR___TYPE_MISMATCH;
ERROR___TYPE_MISMATCH = ERROR___TYPE_MISMATCH;
}
};
struct isnt_fltpt_false
{
static const bool value = false;
arma_inline static void check() {}
};
template<> struct isnt_fltpt< float > : public isnt_fltpt_fa
lse {};
template<> struct isnt_fltpt< double > : public isnt_fltpt_fa
lse {};
template<> struct isnt_fltpt< long double > : public isnt_fltpt_fa
lse {};
template<> struct isnt_fltpt< std::complex<float> > : public isnt_fltpt_fa
lse {};
template<> struct isnt_fltpt< std::complex<double> > : public isnt_fltpt_fa
lse {};
template<typename T1>
struct is_u8 struct is_u8
{ static const bool value = false; }; { static const bool value = false; };
template<> template<>
struct is_u8<u8> struct is_u8<u8>
{ static const bool value = true; }; { static const bool value = true; };
template<typename T1> template<typename T1>
struct is_s8 struct is_s8
{ static const bool value = false; }; { static const bool value = false; };
skipping to change at line 554 skipping to change at line 526
is_supported_complex_float<T1>::value || is_supported_complex_float<T1>::value ||
is_supported_complex_double<T1>::value; is_supported_complex_double<T1>::value;
}; };
template<typename T> template<typename T>
struct is_signed struct is_signed
{ {
static const bool value = (T(-1) < T(0)); static const bool value = (T(-1) < T(0));
}; };
template<> struct is_signed<unsigned char > { static const bool value = fal
se; };
template<> struct is_signed<unsigned short> { static const bool value = fal
se; };
template<> struct is_signed<unsigned int > { static const bool value = fal
se; };
template<> struct is_signed<unsigned long > { static const bool value = fal
se; };
template<typename T> template<typename T>
struct is_non_integral struct is_non_integral
{ {
static const bool value = (T(1.0) != T(1.1)); static const bool value = (T(1.0) != T(1.1));
}; };
// //
class arma_junk_class; class arma_junk_class;
 End of changes. 3 change blocks. 
35 lines changed or deleted 11 lines changed or added


 typedef.hpp   typedef.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 29 skipping to change at line 26
#if UCHAR_MAX >= 0xff #if UCHAR_MAX >= 0xff
//! unsigned 8 bit type //! unsigned 8 bit type
typedef unsigned char u8; typedef unsigned char u8;
typedef char s8; typedef char s8;
#else #else
#error "don't know how to typedef 'u8' on this system" #error "don't know how to typedef 'u8' on this system"
#endif #endif
// NOTE: // NOTE:
// "signed char" is not the same as "char". // "signed char" is not the same as "char".
// see http://www.embedded.com/columns/programmingpointers/206107018 // http://www.embedded.com/columns/programmingpointers/206107018
// http://en.wikipedia.org/wiki/C_variable_types_and_declarations
#if USHRT_MAX >= 0xffff #if USHRT_MAX >= 0xffff
//! unsigned 16 bit type //! unsigned 16 bit type
typedef unsigned short u16; typedef unsigned short u16;
typedef short s16; typedef short s16;
#else #else
#error "don't know how to typedef 'u16' on this system" #error "don't know how to typedef 'u16' on this system"
#endif #endif
#if UINT_MAX >= 0xffffffff #if UINT_MAX >= 0xffffffff
skipping to change at line 64 skipping to change at line 62
// //
// //! unsigned 16 bit type // //! unsigned 16 bit type
// typedef uint16_t u16; // typedef uint16_t u16;
// //
// //! unsigned 32 bit type // //! unsigned 32 bit type
// typedef uint32_t u32; // typedef uint32_t u32;
// //
// //! signed 32 bit type // //! signed 32 bit type
// typedef int32_t s32; // typedef int32_t s32;
#if !defined(ARMA_BLAS_LONG_INT) #if defined(ARMA_BLAS_LONG_LONG)
typedef int blas_int; typedef long long blas_int;
#elif defined(ARMA_BLAS_LONG)
typedef long blas_int;
#else #else
typedef long blas_int; typedef int blas_int;
#endif #endif
typedef std::complex<float> cx_float; typedef std::complex<float> cx_float;
typedef std::complex<double> cx_double; typedef std::complex<double> cx_double;
typedef Mat<unsigned char> uchar_mat; typedef Mat<unsigned char> uchar_mat;
typedef Col<unsigned char> uchar_vec; typedef Col<unsigned char> uchar_vec;
typedef Col<unsigned char> uchar_colvec; typedef Col<unsigned char> uchar_colvec;
typedef Row<unsigned char> uchar_rowvec; typedef Row<unsigned char> uchar_rowvec;
typedef Cube<unsigned char> uchar_cube; typedef Cube<unsigned char> uchar_cube;
 End of changes. 4 change blocks. 
9 lines changed or deleted 9 lines changed or added


 typedef_fixed.hpp   typedef_fixed.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// This file is part of the Armadillo C++ library. // This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup typedef_fixed //! \addtogroup typedef_fixed
//! @{ //! @{
typedef umat::fixed<2,2> umat22; typedef umat::fixed<2,2> umat22;
typedef umat::fixed<3,3> umat33; typedef umat::fixed<3,3> umat33;
typedef umat::fixed<4,4> umat44; typedef umat::fixed<4,4> umat44;
typedef umat::fixed<5,5> umat55;
typedef umat::fixed<6,6> umat66;
typedef umat::fixed<7,7> umat77;
typedef umat::fixed<8,8> umat88;
typedef umat::fixed<9,9> umat99;
typedef imat::fixed<2,2> imat22; typedef imat::fixed<2,2> imat22;
typedef imat::fixed<3,3> imat33; typedef imat::fixed<3,3> imat33;
typedef imat::fixed<4,4> imat44; typedef imat::fixed<4,4> imat44;
typedef imat::fixed<5,5> imat55;
typedef imat::fixed<6,6> imat66;
typedef imat::fixed<7,7> imat77;
typedef imat::fixed<8,8> imat88;
typedef imat::fixed<9,9> imat99;
typedef fmat::fixed<2,2> fmat22; typedef fmat::fixed<2,2> fmat22;
typedef fmat::fixed<3,3> fmat33; typedef fmat::fixed<3,3> fmat33;
typedef fmat::fixed<4,4> fmat44; typedef fmat::fixed<4,4> fmat44;
typedef fmat::fixed<5,5> fmat55;
typedef fmat::fixed<6,6> fmat66;
typedef fmat::fixed<7,7> fmat77;
typedef fmat::fixed<8,8> fmat88;
typedef fmat::fixed<9,9> fmat99;
typedef mat::fixed<2,2> mat22; typedef mat::fixed<2,2> mat22;
typedef mat::fixed<3,3> mat33; typedef mat::fixed<3,3> mat33;
typedef mat::fixed<4,4> mat44; typedef mat::fixed<4,4> mat44;
typedef mat::fixed<5,5> mat55;
typedef mat::fixed<6,6> mat66;
typedef mat::fixed<7,7> mat77;
typedef mat::fixed<8,8> mat88;
typedef mat::fixed<9,9> mat99;
typedef cx_fmat::fixed<2,2> cx_fmat22; typedef cx_fmat::fixed<2,2> cx_fmat22;
typedef cx_fmat::fixed<3,3> cx_fmat33; typedef cx_fmat::fixed<3,3> cx_fmat33;
typedef cx_fmat::fixed<4,4> cx_fmat44; typedef cx_fmat::fixed<4,4> cx_fmat44;
typedef cx_fmat::fixed<5,5> cx_fmat55;
typedef cx_fmat::fixed<6,6> cx_fmat66;
typedef cx_fmat::fixed<7,7> cx_fmat77;
typedef cx_fmat::fixed<8,8> cx_fmat88;
typedef cx_fmat::fixed<9,9> cx_fmat99;
typedef cx_mat::fixed<2,2> cx_mat22; typedef cx_mat::fixed<2,2> cx_mat22;
typedef cx_mat::fixed<3,3> cx_mat33; typedef cx_mat::fixed<3,3> cx_mat33;
typedef cx_mat::fixed<4,4> cx_mat44; typedef cx_mat::fixed<4,4> cx_mat44;
typedef cx_mat::fixed<5,5> cx_mat55;
typedef cx_mat::fixed<6,6> cx_mat66;
typedef cx_mat::fixed<7,7> cx_mat77;
typedef cx_mat::fixed<8,8> cx_mat88;
typedef cx_mat::fixed<9,9> cx_mat99;
// //
typedef uvec::fixed<2> uvec2; typedef uvec::fixed<2> uvec2;
typedef uvec::fixed<3> uvec3; typedef uvec::fixed<3> uvec3;
typedef uvec::fixed<4> uvec4; typedef uvec::fixed<4> uvec4;
typedef uvec::fixed<5> uvec5;
typedef uvec::fixed<6> uvec6;
typedef uvec::fixed<7> uvec7;
typedef uvec::fixed<8> uvec8;
typedef uvec::fixed<9> uvec9;
typedef ivec::fixed<2> ivec2; typedef ivec::fixed<2> ivec2;
typedef ivec::fixed<3> ivec3; typedef ivec::fixed<3> ivec3;
typedef ivec::fixed<4> ivec4; typedef ivec::fixed<4> ivec4;
typedef ivec::fixed<5> ivec5;
typedef ivec::fixed<6> ivec6;
typedef ivec::fixed<7> ivec7;
typedef ivec::fixed<8> ivec8;
typedef ivec::fixed<9> ivec9;
typedef fvec::fixed<2> fvec2; typedef fvec::fixed<2> fvec2;
typedef fvec::fixed<3> fvec3; typedef fvec::fixed<3> fvec3;
typedef fvec::fixed<4> fvec4; typedef fvec::fixed<4> fvec4;
typedef fvec::fixed<5> fvec5;
typedef fvec::fixed<6> fvec6;
typedef fvec::fixed<7> fvec7;
typedef fvec::fixed<8> fvec8;
typedef fvec::fixed<9> fvec9;
typedef vec::fixed<2> vec2; typedef vec::fixed<2> vec2;
typedef vec::fixed<3> vec3; typedef vec::fixed<3> vec3;
typedef vec::fixed<4> vec4; typedef vec::fixed<4> vec4;
typedef vec::fixed<5> vec5;
typedef vec::fixed<6> vec6;
typedef vec::fixed<7> vec7;
typedef vec::fixed<8> vec8;
typedef vec::fixed<9> vec9;
typedef cx_fvec::fixed<2> cx_fvec2; typedef cx_fvec::fixed<2> cx_fvec2;
typedef cx_fvec::fixed<3> cx_fvec3; typedef cx_fvec::fixed<3> cx_fvec3;
typedef cx_fvec::fixed<4> cx_fvec4; typedef cx_fvec::fixed<4> cx_fvec4;
typedef cx_fvec::fixed<5> cx_fvec5;
typedef cx_fvec::fixed<6> cx_fvec6;
typedef cx_fvec::fixed<7> cx_fvec7;
typedef cx_fvec::fixed<8> cx_fvec8;
typedef cx_fvec::fixed<9> cx_fvec9;
typedef cx_vec::fixed<2> cx_vec2; typedef cx_vec::fixed<2> cx_vec2;
typedef cx_vec::fixed<3> cx_vec3; typedef cx_vec::fixed<3> cx_vec3;
typedef cx_vec::fixed<4> cx_vec4; typedef cx_vec::fixed<4> cx_vec4;
typedef cx_vec::fixed<5> cx_vec5;
typedef cx_vec::fixed<6> cx_vec6;
typedef cx_vec::fixed<7> cx_vec7;
typedef cx_vec::fixed<8> cx_vec8;
typedef cx_vec::fixed<9> cx_vec9;
// //
typedef ucolvec::fixed<2> ucolvec2; typedef ucolvec::fixed<2> ucolvec2;
typedef ucolvec::fixed<3> ucolvec3; typedef ucolvec::fixed<3> ucolvec3;
typedef ucolvec::fixed<4> ucolvec4; typedef ucolvec::fixed<4> ucolvec4;
typedef ucolvec::fixed<5> ucolvec5;
typedef ucolvec::fixed<6> ucolvec6;
typedef ucolvec::fixed<7> ucolvec7;
typedef ucolvec::fixed<8> ucolvec8;
typedef ucolvec::fixed<9> ucolvec9;
typedef icolvec::fixed<2> icolvec2; typedef icolvec::fixed<2> icolvec2;
typedef icolvec::fixed<3> icolvec3; typedef icolvec::fixed<3> icolvec3;
typedef icolvec::fixed<4> icolvec4; typedef icolvec::fixed<4> icolvec4;
typedef icolvec::fixed<5> icolvec5;
typedef icolvec::fixed<6> icolvec6;
typedef icolvec::fixed<7> icolvec7;
typedef icolvec::fixed<8> icolvec8;
typedef icolvec::fixed<9> icolvec9;
typedef fcolvec::fixed<2> fcolvec2; typedef fcolvec::fixed<2> fcolvec2;
typedef fcolvec::fixed<3> fcolvec3; typedef fcolvec::fixed<3> fcolvec3;
typedef fcolvec::fixed<4> fcolvec4; typedef fcolvec::fixed<4> fcolvec4;
typedef fcolvec::fixed<5> fcolvec5;
typedef fcolvec::fixed<6> fcolvec6;
typedef fcolvec::fixed<7> fcolvec7;
typedef fcolvec::fixed<8> fcolvec8;
typedef fcolvec::fixed<9> fcolvec9;
typedef colvec::fixed<2> colvec2; typedef colvec::fixed<2> colvec2;
typedef colvec::fixed<3> colvec3; typedef colvec::fixed<3> colvec3;
typedef colvec::fixed<4> colvec4; typedef colvec::fixed<4> colvec4;
typedef colvec::fixed<5> colvec5;
typedef colvec::fixed<6> colvec6;
typedef colvec::fixed<7> colvec7;
typedef colvec::fixed<8> colvec8;
typedef colvec::fixed<9> colvec9;
typedef cx_fcolvec::fixed<2> cx_fcolvec2; typedef cx_fcolvec::fixed<2> cx_fcolvec2;
typedef cx_fcolvec::fixed<3> cx_fcolvec3; typedef cx_fcolvec::fixed<3> cx_fcolvec3;
typedef cx_fcolvec::fixed<4> cx_fcolvec4; typedef cx_fcolvec::fixed<4> cx_fcolvec4;
typedef cx_fcolvec::fixed<5> cx_fcolvec5;
typedef cx_fcolvec::fixed<6> cx_fcolvec6;
typedef cx_fcolvec::fixed<7> cx_fcolvec7;
typedef cx_fcolvec::fixed<8> cx_fcolvec8;
typedef cx_fcolvec::fixed<9> cx_fcolvec9;
typedef cx_colvec::fixed<2> cx_colvec2; typedef cx_colvec::fixed<2> cx_colvec2;
typedef cx_colvec::fixed<3> cx_colvec3; typedef cx_colvec::fixed<3> cx_colvec3;
typedef cx_colvec::fixed<4> cx_colvec4; typedef cx_colvec::fixed<4> cx_colvec4;
typedef cx_colvec::fixed<5> cx_colvec5;
typedef cx_colvec::fixed<6> cx_colvec6;
typedef cx_colvec::fixed<7> cx_colvec7;
typedef cx_colvec::fixed<8> cx_colvec8;
typedef cx_colvec::fixed<9> cx_colvec9;
// //
typedef urowvec::fixed<2> urowvec2; typedef urowvec::fixed<2> urowvec2;
typedef urowvec::fixed<3> urowvec3; typedef urowvec::fixed<3> urowvec3;
typedef urowvec::fixed<4> urowvec4; typedef urowvec::fixed<4> urowvec4;
typedef urowvec::fixed<5> urowvec5;
typedef urowvec::fixed<6> urowvec6;
typedef urowvec::fixed<7> urowvec7;
typedef urowvec::fixed<8> urowvec8;
typedef urowvec::fixed<9> urowvec9;
typedef irowvec::fixed<2> irowvec2; typedef irowvec::fixed<2> irowvec2;
typedef irowvec::fixed<3> irowvec3; typedef irowvec::fixed<3> irowvec3;
typedef irowvec::fixed<4> irowvec4; typedef irowvec::fixed<4> irowvec4;
typedef irowvec::fixed<5> irowvec5;
typedef irowvec::fixed<6> irowvec6;
typedef irowvec::fixed<7> irowvec7;
typedef irowvec::fixed<8> irowvec8;
typedef irowvec::fixed<9> irowvec9;
typedef frowvec::fixed<2> frowvec2; typedef frowvec::fixed<2> frowvec2;
typedef frowvec::fixed<3> frowvec3; typedef frowvec::fixed<3> frowvec3;
typedef frowvec::fixed<4> frowvec4; typedef frowvec::fixed<4> frowvec4;
typedef frowvec::fixed<5> frowvec5;
typedef frowvec::fixed<6> frowvec6;
typedef frowvec::fixed<7> frowvec7;
typedef frowvec::fixed<8> frowvec8;
typedef frowvec::fixed<9> frowvec9;
typedef rowvec::fixed<2> rowvec2; typedef rowvec::fixed<2> rowvec2;
typedef rowvec::fixed<3> rowvec3; typedef rowvec::fixed<3> rowvec3;
typedef rowvec::fixed<4> rowvec4; typedef rowvec::fixed<4> rowvec4;
typedef rowvec::fixed<5> rowvec5;
typedef rowvec::fixed<6> rowvec6;
typedef rowvec::fixed<7> rowvec7;
typedef rowvec::fixed<8> rowvec8;
typedef rowvec::fixed<9> rowvec9;
typedef cx_frowvec::fixed<2> cx_frowvec2; typedef cx_frowvec::fixed<2> cx_frowvec2;
typedef cx_frowvec::fixed<3> cx_frowvec3; typedef cx_frowvec::fixed<3> cx_frowvec3;
typedef cx_frowvec::fixed<4> cx_frowvec4; typedef cx_frowvec::fixed<4> cx_frowvec4;
typedef cx_frowvec::fixed<5> cx_frowvec5;
typedef cx_frowvec::fixed<6> cx_frowvec6;
typedef cx_frowvec::fixed<7> cx_frowvec7;
typedef cx_frowvec::fixed<8> cx_frowvec8;
typedef cx_frowvec::fixed<9> cx_frowvec9;
typedef cx_rowvec::fixed<2> cx_rowvec2; typedef cx_rowvec::fixed<2> cx_rowvec2;
typedef cx_rowvec::fixed<3> cx_rowvec3; typedef cx_rowvec::fixed<3> cx_rowvec3;
typedef cx_rowvec::fixed<4> cx_rowvec4; typedef cx_rowvec::fixed<4> cx_rowvec4;
typedef cx_rowvec::fixed<5> cx_rowvec5;
typedef cx_rowvec::fixed<6> cx_rowvec6;
typedef cx_rowvec::fixed<7> cx_rowvec7;
typedef cx_rowvec::fixed<8> cx_rowvec8;
typedef cx_rowvec::fixed<9> cx_rowvec9;
//! @} //! @}
 End of changes. 25 change blocks. 
5 lines changed or deleted 122 lines changed or added


 unwrap.hpp   unwrap.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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 121 skipping to change at line 118
{ {
public: public:
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
inline inline
unwrap_check(const T1& A, const Mat<eT>& B) unwrap_check(const T1& A, const Mat<eT>& B)
: M(A) : M(A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(B);
} }
inline inline
~unwrap_check() ~unwrap_check()
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
const Mat<eT> M; const Mat<eT> M;
}; };
skipping to change at line 677 skipping to change at line 675
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
inline partial_unwrap_check(const T1& A, const Mat<eT>& B) inline partial_unwrap_check(const T1& A, const Mat<eT>& B)
: do_trans(false) : do_trans(false)
, do_times(false) , do_times(false)
, val (1) , val (1)
, M (A) , M (A)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(B);
} }
inline inline
~partial_unwrap_check() ~partial_unwrap_check()
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
const bool do_trans; const bool do_trans;
const bool do_times; const bool do_times;
skipping to change at line 811 skipping to change at line 810
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
inline inline
partial_unwrap_check(const Op<T1,op_trans>& A, const Mat<eT>& B) partial_unwrap_check(const Op<T1,op_trans>& A, const Mat<eT>& B)
: do_trans(true) : do_trans(true)
, do_times(false) , do_times(false)
, val (1) , val (1)
, M (A.m) , M (A.m)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(B);
} }
inline inline
~partial_unwrap_check() ~partial_unwrap_check()
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
const bool do_trans; const bool do_trans;
const bool do_times; const bool do_times;
skipping to change at line 1079 skipping to change at line 1079
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
inline inline
partial_unwrap_check(const eOp<T1,eop_scalar_times>& A, const Mat<eT>& B) partial_unwrap_check(const eOp<T1,eop_scalar_times>& A, const Mat<eT>& B)
: do_trans(false) : do_trans(false)
, do_times(true) , do_times(true)
, val (A.aux) , val (A.aux)
, M (A.P.Q) , M (A.P.Q)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(B);
} }
inline inline
~partial_unwrap_check() ~partial_unwrap_check()
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
const bool do_trans; const bool do_trans;
const bool do_times; const bool do_times;
skipping to change at line 1106 skipping to change at line 1107
public: public:
inline inline
partial_unwrap_check(const eOp<Mat<eT>,eop_scalar_times>& A, const Mat<eT >& B) partial_unwrap_check(const eOp<Mat<eT>,eop_scalar_times>& A, const Mat<eT >& B)
: do_trans(false) : do_trans(false)
, do_times(true) , do_times(true)
, val (A.aux) , val (A.aux)
, M (A.P.Q) , M (A.P.Q)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(B);
} }
inline inline
~partial_unwrap_check() ~partial_unwrap_check()
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
const bool do_trans; const bool do_trans;
const bool do_times; const bool do_times;
skipping to change at line 1133 skipping to change at line 1135
public: public:
inline inline
partial_unwrap_check(const eOp<Row<eT>,eop_scalar_times>& A, const Mat<eT >& B) partial_unwrap_check(const eOp<Row<eT>,eop_scalar_times>& A, const Mat<eT >& B)
: do_trans(false) : do_trans(false)
, do_times(true) , do_times(true)
, val (A.aux) , val (A.aux)
, M (A.P.Q) , M (A.P.Q)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(B);
} }
inline inline
~partial_unwrap_check() ~partial_unwrap_check()
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
const bool do_trans; const bool do_trans;
const bool do_times; const bool do_times;
skipping to change at line 1160 skipping to change at line 1163
public: public:
inline inline
partial_unwrap_check(const eOp<Col<eT>,eop_scalar_times>& A, const Mat<eT >& B) partial_unwrap_check(const eOp<Col<eT>,eop_scalar_times>& A, const Mat<eT >& B)
: do_trans(false) : do_trans(false)
, do_times(true) , do_times(true)
, val (A.aux) , val (A.aux)
, M (A.P.Q) , M (A.P.Q)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
arma_ignore(B);
} }
inline inline
~partial_unwrap_check() ~partial_unwrap_check()
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
const bool do_trans; const bool do_trans;
const bool do_times; const bool do_times;
 End of changes. 8 change blocks. 
5 lines changed or deleted 9 lines changed or added


 unwrap_cube.hpp   unwrap_cube.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 upgrade_val.hpp   upgrade_val.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2009-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 wall_clock_meat.hpp   wall_clock_meat.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 lines changed or added


 wall_clock_proto.hpp   wall_clock_proto.hpp 
// Copyright (C) 2010 NICTA and the authors listed below // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
// http://nicta.com.au // Copyright (C) 2008-2010 Conrad Sanderson
//
// Authors:
// - Conrad Sanderson (conradsand at ieee dot org)
// //
// 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)
 End of changes. 1 change blocks. 
5 lines changed or deleted 2 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/