arma_version.hpp | arma_version.hpp | |||
---|---|---|---|---|
skipping to change at line 18 | skipping to change at line 18 | |||
// Lesser General Public License (LGPL) as published | // Lesser General Public License (LGPL) as published | |||
// by the Free Software Foundation, either version 3 | // by the Free Software Foundation, either version 3 | |||
// of the License or (at your option) any later version. | // of the License or (at your option) any later version. | |||
// (see http://www.opensource.org/licenses for more info) | // (see http://www.opensource.org/licenses for more info) | |||
//! \addtogroup arma_version | //! \addtogroup arma_version | |||
//! @{ | //! @{ | |||
#define ARMA_VERSION_MAJOR 2 | #define ARMA_VERSION_MAJOR 2 | |||
#define ARMA_VERSION_MINOR 4 | #define ARMA_VERSION_MINOR 4 | |||
#define ARMA_VERSION_PATCH 3 | #define ARMA_VERSION_PATCH 4 | |||
#define ARMA_VERSION_NAME "Loco Lounge Lizard" | #define ARMA_VERSION_NAME "Loco Lounge Lizard" | |||
struct arma_version | struct arma_version | |||
{ | { | |||
static const unsigned int major = ARMA_VERSION_MAJOR; | static const unsigned int major = ARMA_VERSION_MAJOR; | |||
static const unsigned int minor = ARMA_VERSION_MINOR; | static const unsigned int minor = ARMA_VERSION_MINOR; | |||
static const unsigned int patch = ARMA_VERSION_PATCH; | static const unsigned int patch = ARMA_VERSION_PATCH; | |||
static | static | |||
inline | inline | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
armadillo | armadillo | |||
---|---|---|---|---|
// Copyright (C) 2008-2011 NICTA (www.nicta.com.au) | // Copyright (C) 2008-2012 NICTA (www.nicta.com.au) | |||
// Copyright (C) 2008-2011 Conrad Sanderson | // Copyright (C) 2008-2012 Conrad Sanderson | |||
// | // | |||
// 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 38 | skipping to change at line 38 | |||
#include <vector> | #include <vector> | |||
#include "armadillo_bits/config.hpp" | #include "armadillo_bits/config.hpp" | |||
#include "armadillo_bits/compiler_setup.hpp" | #include "armadillo_bits/compiler_setup.hpp" | |||
#include "armadillo_bits/undefine_conflicts.hpp" | #include "armadillo_bits/undefine_conflicts.hpp" | |||
#if defined(ARMA_USE_CXX11) | #if defined(ARMA_USE_CXX11) | |||
#include <initializer_list> | #include <initializer_list> | |||
#endif | #endif | |||
#if !defined(ARMA_HAVE_GETTIMEOFDAY) && !defined(ARMA_USE_BOOST_DATE) | ||||
#include <ctime> | ||||
#endif | ||||
#if defined(ARMA_HAVE_GETTIMEOFDAY) | #if defined(ARMA_HAVE_GETTIMEOFDAY) | |||
#include <sys/time.h> | #include <sys/time.h> | |||
#undef ARMA_USE_BOOST_DATE | #undef ARMA_USE_BOOST_DATE | |||
#endif | #endif | |||
#if defined(ARMA_USE_BOOST_DATE) | #if defined(ARMA_USE_BOOST_DATE) | |||
#include <boost/date_time/posix_time/posix_time.hpp> | #include <boost/date_time/posix_time/posix_time.hpp> | |||
#endif | #endif | |||
#if defined(ARMA_HAVE_STD_TR1) | #if defined(ARMA_HAVE_STD_TR1) | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 6 lines changed or added | |||
auxlib_meat.hpp | auxlib_meat.hpp | |||
---|---|---|---|---|
// Copyright (C) 2008-2011 NICTA (www.nicta.com.au) | // Copyright (C) 2008-2012 NICTA (www.nicta.com.au) | |||
// Copyright (C) 2008-2011 Conrad Sanderson | // Copyright (C) 2008-2012 Conrad Sanderson | |||
// Copyright (C) 2009 Edmund Highcock | // Copyright (C) 2009 Edmund Highcock | |||
// Copyright (C) 2011 James Sanders | // Copyright (C) 2011 James Sanders | |||
// Copyright (C) 2011 Stanislav Funiak | // Copyright (C) 2011 Stanislav Funiak | |||
// | // | |||
// 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 | |||
skipping to change at line 2598 | skipping to change at line 2598 | |||
template<typename eT> | template<typename eT> | |||
inline | inline | |||
bool | bool | |||
auxlib::schur_dec(Mat<eT>& Z, Mat<eT>& T, const Mat<eT>& A) | auxlib::schur_dec(Mat<eT>& Z, Mat<eT>& T, const Mat<eT>& A) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
#if defined(ARMA_USE_LAPACK) | #if defined(ARMA_USE_LAPACK) | |||
{ | { | |||
arma_debug_check( (A.is_square() == false), "schur_dec(): matrix A is n ot square" ); | arma_debug_check( (A.is_square() == false), "schur_dec(): given matrix is not square" ); | |||
if(A.is_empty()) | if(A.is_empty()) | |||
{ | { | |||
Z.reset(); | Z.reset(); | |||
T.reset(); | T.reset(); | |||
return true; | return true; | |||
} | } | |||
const uword A_n_rows = A.n_rows; | const uword A_n_rows = A.n_rows; | |||
skipping to change at line 2707 | skipping to change at line 2707 | |||
// | // | |||
// syl (solution of the Sylvester equation AX + XB = C) | // syl (solution of the Sylvester equation AX + XB = C) | |||
template<typename eT> | template<typename eT> | |||
inline | inline | |||
bool | bool | |||
auxlib::syl(Mat<eT>& X, const Mat<eT>& A, const Mat<eT>& B, const Mat<eT>& C) | auxlib::syl(Mat<eT>& X, const Mat<eT>& A, const Mat<eT>& B, const Mat<eT>& C) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
arma_debug_check( (A.is_square() == false), "syl(): matrix A is not squar | arma_debug_check | |||
e" ); | ( | |||
arma_debug_check( (B.is_square() == false), "syl(): matrix B is not squar | (A.is_square() == false) || (B.is_square() == false), | |||
e" ); | "syl(): given matrix is not square" | |||
); | ||||
arma_debug_check( (C.n_rows != A.n_rows) || (C.n_cols != B.n_cols), "syl( | ||||
): matrices are not conformant" ); | arma_debug_check | |||
( | ||||
(C.n_rows != A.n_rows) || (C.n_cols != B.n_cols), | ||||
"syl(): matrices are not conformant" | ||||
); | ||||
if(A.is_empty() || B.is_empty() || C.is_empty()) | if(A.is_empty() || B.is_empty() || C.is_empty()) | |||
{ | { | |||
X.reset(); | X.reset(); | |||
return true; | return true; | |||
} | } | |||
bool status; | ||||
#if defined(ARMA_USE_LAPACK) | #if defined(ARMA_USE_LAPACK) | |||
{ | { | |||
Mat<eT> Z1, Z2, T1, T2; | Mat<eT> Z1, Z2, T1, T2; | |||
status = auxlib::schur_dec(Z1, T1, A); | const bool status_sd1 = auxlib::schur_dec(Z1, T1, A); | |||
if(status == false) | const bool status_sd2 = auxlib::schur_dec(Z2, T2, B); | |||
{ | ||||
return false; | ||||
} | ||||
status = auxlib::schur_dec(Z2, T2, B); | if( (status_sd1 == false) || (status_sd2 == false) ) | |||
if(status == false) | ||||
{ | { | |||
return false; | return false; | |||
} | } | |||
char trana = 'N'; | char trana = 'N'; | |||
char tranb = 'N'; | char tranb = 'N'; | |||
blas_int isgn = +1; | blas_int isgn = +1; | |||
blas_int m = blas_int(T1.n_rows); | blas_int m = blas_int(T1.n_rows); | |||
blas_int n = blas_int(T2.n_cols); | blas_int n = blas_int(T2.n_cols); | |||
skipping to change at line 2754 | skipping to change at line 2755 | |||
Mat<eT> Y = trans(Z1) * C * Z2; | Mat<eT> Y = trans(Z1) * C * Z2; | |||
lapack::trsyl<eT>(&trana, &tranb, &isgn, &m, &n, T1.memptr(), &m, T2.me mptr(), &n, Y.memptr(), &m, &scale, &info); | lapack::trsyl<eT>(&trana, &tranb, &isgn, &m, &n, T1.memptr(), &m, T2.me mptr(), &n, Y.memptr(), &m, &scale, &info); | |||
//Y /= scale; | //Y /= scale; | |||
Y /= (-scale); | Y /= (-scale); | |||
X = Z1 * Y * trans(Z2); | X = Z1 * Y * trans(Z2); | |||
status = (info == 0); | return (info >= 0); | |||
} | } | |||
#else | #else | |||
{ | { | |||
arma_stop("syl(): use of LAPACK needs to be enabled"); | arma_stop("syl(): use of LAPACK needs to be enabled"); | |||
return false; | return false; | |||
} | } | |||
#endif | #endif | |||
return status; | ||||
} | } | |||
// | // | |||
// lyap (solution of the continuous Lyapunov equation AX + XA^H + Q = 0) | // lyap (solution of the continuous Lyapunov equation AX + XA^H + Q = 0) | |||
template<typename eT> | template<typename eT> | |||
inline | inline | |||
bool | bool | |||
auxlib::lyap(Mat<eT>& X, const Mat<eT>& A, const Mat<eT>& Q) | auxlib::lyap(Mat<eT>& X, const Mat<eT>& A, const Mat<eT>& Q) | |||
{ | { | |||
End of changes. 8 change blocks. | ||||
22 lines changed or deleted | 18 lines changed or added | |||
config.hpp | config.hpp | |||
---|---|---|---|---|
skipping to change at line 70 | skipping to change at line 70 | |||
#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_USE_WRAPPER | #define ARMA_USE_WRAPPER | |||
#define ARMA_DEFAULT_OSTREAM std::cout | #if !defined(ARMA_DEFAULT_OSTREAM) | |||
#define ARMA_DEFAULT_OSTREAM std::cout | ||||
#endif | ||||
#define ARMA_PRINT_LOGIC_ERRORS | #define ARMA_PRINT_LOGIC_ERRORS | |||
#define ARMA_PRINT_RUNTIME_ERRORS | #define ARMA_PRINT_RUNTIME_ERRORS | |||
#define ARMA_HAVE_STD_ISFINITE | #define ARMA_HAVE_STD_ISFINITE | |||
#define ARMA_HAVE_STD_ISINF | #define ARMA_HAVE_STD_ISINF | |||
#define ARMA_HAVE_STD_ISNAN | #define ARMA_HAVE_STD_ISNAN | |||
#define ARMA_HAVE_STD_SNPRINTF | #define ARMA_HAVE_STD_SNPRINTF | |||
#define ARMA_HAVE_LOG1P | #define ARMA_HAVE_LOG1P | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 3 lines changed or added | |||
fn_conv_to.hpp | fn_conv_to.hpp | |||
---|---|---|---|---|
skipping to change at line 416 | skipping to change at line 416 | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
arma_ignore(junk); | 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 Row<out_eT>::iterator out_begin = out.begin(); | |||
typename Col<out_eT>::iterator out_end = out.end(); | typename Row<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 Row<out_eT>::iterator out_it; | |||
for(in_it = in_begin, out_it = out_begin; (in_it != in_end) && (out_it != out_end); ++in_it, ++out_it) | for(in_it = in_begin, out_it = out_begin; (in_it != in_end) && (out_it != out_end); ++in_it, ++out_it) | |||
{ | { | |||
(*out_it) = out_eT(*in_it); | (*out_it) = out_eT(*in_it); | |||
} | } | |||
return out; | return out; | |||
} | } | |||
template<typename out_eT> | template<typename out_eT> | |||
skipping to change at line 445 | skipping to change at line 445 | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
arma_ignore(junk); | 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 Row<out_eT>::iterator out_begin = out.begin(); | |||
typename Col<out_eT>::iterator out_end = out.end(); | typename Row<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 Row<out_eT>::iterator out_it; | |||
for(in_it = in_begin, out_it = out_begin; (in_it != in_end) && (out_it != out_end); ++in_it, ++out_it) | for(in_it = in_begin, out_it = out_begin; (in_it != in_end) && (out_it != out_end); ++in_it, ++out_it) | |||
{ | { | |||
out_eT& out_elem = (*out_it); | out_eT& out_elem = (*out_it); | |||
const in_eT& in_elem = (*in_it); | const in_eT& in_elem = (*in_it); | |||
arrayops::convert_cx_scalar(out_elem, in_elem); | arrayops::convert_cx_scalar(out_elem, in_elem); | |||
} | } | |||
return out; | return out; | |||
End of changes. 4 change blocks. | ||||
6 lines changed or deleted | 6 lines changed or added | |||
fn_qr.hpp | fn_qr.hpp | |||
---|---|---|---|---|
// Copyright (C) 2009-2011 NICTA (www.nicta.com.au) | // Copyright (C) 2009-2012 NICTA (www.nicta.com.au) | |||
// Copyright (C) 2009-2011 Conrad Sanderson | // Copyright (C) 2009-2012 Conrad Sanderson | |||
// | // | |||
// 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 42 | skipping to change at line 42 | |||
const bool status = auxlib::qr(Q, R, X); | const bool status = auxlib::qr(Q, R, X); | |||
if(status == false) | if(status == false) | |||
{ | { | |||
Q.reset(); | Q.reset(); | |||
R.reset(); | R.reset(); | |||
arma_bad("qr(): failed to converge", false); | arma_bad("qr(): failed to converge", false); | |||
} | } | |||
return false; | return status; | |||
} | } | |||
//! @} | //! @} | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
fn_syl_lyap.hpp | fn_syl_lyap.hpp | |||
---|---|---|---|---|
// Copyright (C) 2011 NICTA (www.nicta.com.au) | // Copyright (C) 2011-2012 NICTA (www.nicta.com.au) | |||
// Copyright (C) 2011 Conrad Sanderson | // Copyright (C) 2011-2012 Conrad Sanderson | |||
// | // | |||
// 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 50 | skipping to change at line 50 | |||
const Mat<eT>& C = tmp_C.M; | const Mat<eT>& C = tmp_C.M; | |||
const bool status = auxlib::syl(out, A, B, C); | const bool status = auxlib::syl(out, A, B, C); | |||
if(status == false) | if(status == false) | |||
{ | { | |||
out.reset(); | out.reset(); | |||
arma_bad("syl(): equation appears to be singular", false); | arma_bad("syl(): equation appears to be singular", false); | |||
} | } | |||
return false; | return status; | |||
} | } | |||
template<typename T1, typename T2, typename T3> | template<typename T1, typename T2, typename T3> | |||
inline | inline | |||
Mat<typename T1::elem_type> | Mat<typename T1::elem_type> | |||
syl | syl | |||
( | ( | |||
const Base<typename T1::elem_type,T1>& in_A, | const Base<typename T1::elem_type,T1>& in_A, | |||
const Base<typename T1::elem_type,T2>& in_B, | const Base<typename T1::elem_type,T2>& in_B, | |||
const Base<typename T1::elem_type,T3>& in_C, | const Base<typename T1::elem_type,T3>& in_C, | |||
const typename arma_blas_type_only<typename T1::elem_type>::result* junk = 0 | const typename arma_blas_type_only<typename T1::elem_type>::result* junk = 0 | |||
) | ) | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
arma_ignore(junk); | arma_ignore(junk); | |||
typedef typename T1::elem_type eT; | typedef typename T1::elem_type eT; | |||
const unwrap<T1> tmp_A( in_A.get_ref() ); | ||||
const unwrap<T2> tmp_B( in_B.get_ref() ); | ||||
const unwrap<T3> tmp_C( in_C.get_ref() ); | ||||
const Mat<eT>& A = tmp_A.M; | ||||
const Mat<eT>& B = tmp_B.M; | ||||
const Mat<eT>& C = tmp_C.M; | ||||
Mat<eT> out; | Mat<eT> out; | |||
const bool status = syl(out, in_A, in_B, in_C); | ||||
const bool status = auxlib::syl(out, A, B, C); | ||||
if(status == false) | if(status == false) | |||
{ | { | |||
out.reset(); | out.reset(); | |||
arma_bad("syl(): equation appears to be singular"); | arma_bad("syl(): equation appears to be singular"); | |||
} | } | |||
return out; | return out; | |||
} | } | |||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 13 lines changed or added | |||
subview_elem1_meat.hpp | subview_elem1_meat.hpp | |||
---|---|---|---|---|
skipping to change at line 216 | skipping to change at line 216 | |||
"Mat::elem(): given object is not a vector" | "Mat::elem(): given object is not a vector" | |||
); | ); | |||
const uword* aa_mem = aa.memptr(); | const uword* aa_mem = aa.memptr(); | |||
const uword aa_n_elem = aa.n_elem; | const uword aa_n_elem = aa.n_elem; | |||
const Proxy<T2> P(x.get_ref()); | const Proxy<T2> P(x.get_ref()); | |||
arma_debug_check( (aa_n_elem != P.get_n_elem()), "Mat::elem(): size misma tch" ); | arma_debug_check( (aa_n_elem != P.get_n_elem()), "Mat::elem(): size misma tch" ); | |||
if(P.is_alias(m) == false) | if( (P.is_alias(m) == false) && (Proxy<T2>::prefer_at_accessor == false) ) | |||
{ | { | |||
typename Proxy<T2>::ea_type X = P.get_ea(); | typename Proxy<T2>::ea_type X = P.get_ea(); | |||
uword i,j; | uword i,j; | |||
for(i=0, j=1; j<aa_n_elem; i+=2, j+=2) | for(i=0, j=1; j<aa_n_elem; i+=2, j+=2) | |||
{ | { | |||
const uword ii = aa_mem[i]; | const uword ii = aa_mem[i]; | |||
const uword jj = aa_mem[j]; | const uword jj = aa_mem[j]; | |||
arma_debug_check( ( (ii >= m_n_elem) || (jj >= m_n_elem) ), "Mat::ele m(): index out of bounds" ); | arma_debug_check( ( (ii >= m_n_elem) || (jj >= m_n_elem) ), "Mat::ele m(): index out of bounds" ); | |||
skipping to change at line 250 | skipping to change at line 250 | |||
if(is_same_type<op_type, op_subview_elem_equ >::value = = true) { m_mem[ii] = X[i]; } | if(is_same_type<op_type, op_subview_elem_equ >::value = = true) { m_mem[ii] = X[i]; } | |||
else if(is_same_type<op_type, op_subview_elem_inplace_plus >::value = = true) { m_mem[ii] += X[i]; } | else if(is_same_type<op_type, op_subview_elem_inplace_plus >::value = = true) { m_mem[ii] += X[i]; } | |||
else if(is_same_type<op_type, op_subview_elem_inplace_minus>::value = = true) { m_mem[ii] -= X[i]; } | else if(is_same_type<op_type, op_subview_elem_inplace_minus>::value = = true) { m_mem[ii] -= X[i]; } | |||
else if(is_same_type<op_type, op_subview_elem_inplace_schur>::value = = true) { m_mem[ii] *= X[i]; } | else if(is_same_type<op_type, op_subview_elem_inplace_schur>::value = = true) { m_mem[ii] *= X[i]; } | |||
else if(is_same_type<op_type, op_subview_elem_inplace_div >::value = = true) { m_mem[ii] /= X[i]; } | else if(is_same_type<op_type, op_subview_elem_inplace_div >::value = = true) { m_mem[ii] /= X[i]; } | |||
} | } | |||
} | } | |||
else | else | |||
{ | { | |||
arma_extra_debug_print("subview_elem1::inplace_op(): aliasing detected" ); | arma_extra_debug_print("subview_elem1::inplace_op(): aliasing or prefer _at_accessor detected"); | |||
const unwrap_check<typename Proxy<T2>::stored_type> tmp(P.Q, m_local); | const unwrap_check<typename Proxy<T2>::stored_type> tmp(P.Q, m_local); | |||
const Mat<eT>& M = tmp.M; | const Mat<eT>& M = tmp.M; | |||
const eT* X = M.memptr(); | const eT* X = M.memptr(); | |||
uword i,j; | uword i,j; | |||
for(i=0, j=1; j<aa_n_elem; i+=2, j+=2) | for(i=0, j=1; j<aa_n_elem; i+=2, j+=2) | |||
{ | { | |||
const uword ii = aa_mem[i]; | const uword ii = aa_mem[i]; | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
wall_clock_bones.hpp | wall_clock_bones.hpp | |||
---|---|---|---|---|
// Copyright (C) 2008-2010 NICTA (www.nicta.com.au) | // Copyright (C) 2008-2012 NICTA (www.nicta.com.au) | |||
// Copyright (C) 2008-2010 Conrad Sanderson | // Copyright (C) 2008-2012 Conrad Sanderson | |||
// | // | |||
// 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 34 | |||
inline void tic(); //!< start the timer | inline void tic(); //!< start the timer | |||
inline double toc(); //!< return the number of seconds since the last ca ll to tic() | inline double toc(); //!< return the number of seconds since the last ca ll to tic() | |||
private: | private: | |||
bool valid; | bool valid; | |||
#if defined(ARMA_USE_BOOST_DATE) | #if defined(ARMA_USE_BOOST_DATE) | |||
boost::posix_time::ptime boost_time1; | boost::posix_time::ptime boost_time1; | |||
boost::posix_time::time_duration boost_duration; | boost::posix_time::time_duration boost_duration; | |||
#elif defined(ARMA_HAVE_GETTIMEOFDAY) | ||||
struct timeval posix_time1; | ||||
struct timeval posix_time2; | ||||
#else | #else | |||
#if defined(ARMA_HAVE_GETTIMEOFDAY) | clock_t time1; | |||
struct timeval posix_time1; | ||||
struct timeval posix_time2; | ||||
#endif | ||||
#endif | #endif | |||
}; | }; | |||
//! @} | //! @} | |||
End of changes. 3 change blocks. | ||||
6 lines changed or deleted | 6 lines changed or added | |||
wall_clock_meat.hpp | wall_clock_meat.hpp | |||
---|---|---|---|---|
// Copyright (C) 2008-2010 NICTA (www.nicta.com.au) | // Copyright (C) 2008-2012 NICTA (www.nicta.com.au) | |||
// Copyright (C) 2008-2010 Conrad Sanderson | // Copyright (C) 2008-2012 Conrad Sanderson | |||
// | // | |||
// 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 40 | skipping to change at line 40 | |||
void | void | |||
wall_clock::tic() | wall_clock::tic() | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
#if defined(ARMA_USE_BOOST_DATE) | #if defined(ARMA_USE_BOOST_DATE) | |||
{ | { | |||
boost_time1 = boost::posix_time::microsec_clock::local_time(); | boost_time1 = boost::posix_time::microsec_clock::local_time(); | |||
valid = true; | valid = true; | |||
} | } | |||
#elif defined(ARMA_HAVE_GETTIMEOFDAY) | ||||
{ | ||||
gettimeofday(&posix_time1, 0); | ||||
valid = true; | ||||
} | ||||
#else | #else | |||
#if defined(ARMA_HAVE_GETTIMEOFDAY) | { | |||
{ | time1 = clock(); | |||
gettimeofday(&posix_time1, 0); | valid = true; | |||
valid = true; | } | |||
} | ||||
#else | ||||
{ | ||||
arma_stop("wall_clock::tic(): need Boost libraries or POSIX gettimeof | ||||
day()"); | ||||
} | ||||
#endif | ||||
#endif | #endif | |||
} | } | |||
inline | inline | |||
double | double | |||
wall_clock::toc() | wall_clock::toc() | |||
{ | { | |||
arma_extra_debug_sigprint(); | arma_extra_debug_sigprint(); | |||
if(valid) | if(valid) | |||
{ | { | |||
#if defined(ARMA_USE_BOOST_DATE) | #if defined(ARMA_USE_BOOST_DATE) | |||
{ | { | |||
boost_duration = boost::posix_time::microsec_clock::local_time() - bo ost_time1; | boost_duration = boost::posix_time::microsec_clock::local_time() - bo ost_time1; | |||
return boost_duration.total_microseconds() * 1e-6; | return boost_duration.total_microseconds() * 1e-6; | |||
} | } | |||
#elif defined(ARMA_HAVE_GETTIMEOFDAY) | ||||
{ | ||||
gettimeofday(&posix_time2, 0); | ||||
const double tmp_time1 = posix_time1.tv_sec + posix_time1.tv_usec * 1 | ||||
.0e-6; | ||||
const double tmp_time2 = posix_time2.tv_sec + posix_time2.tv_usec * 1 | ||||
.0e-6; | ||||
return tmp_time2 - tmp_time1; | ||||
} | ||||
#else | #else | |||
#if defined(ARMA_HAVE_GETTIMEOFDAY) | { | |||
{ | clock_t time2 = clock(); | |||
gettimeofday(&posix_time2, 0); | ||||
clock_t diff = time2 - time1; | ||||
const double tmp_time1 = posix_time1.tv_sec + posix_time1.tv_usec * | ||||
1.0e-6; | return double(diff) / double(CLOCKS_PER_SEC); | |||
const double tmp_time2 = posix_time2.tv_sec + posix_time2.tv_usec * | } | |||
1.0e-6; | ||||
return tmp_time2 - tmp_time1; | ||||
} | ||||
#else | ||||
{ | ||||
arma_stop("wall_clock::toc(): need Boost libraries or POSIX gettime | ||||
ofday()"); | ||||
return 0.0; | ||||
} | ||||
#endif | ||||
#endif | #endif | |||
} | } | |||
else | else | |||
{ | { | |||
return 0.0; | return 0.0; | |||
} | } | |||
} | } | |||
//! @} | //! @} | |||
End of changes. 5 change blocks. | ||||
31 lines changed or deleted | 29 lines changed or added | |||