"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "include/armadillo_bits/newarp_TridiagEigen_meat.hpp" between
armadillo-10.8.2.tar.xz and armadillo-11.0.0.tar.xz

About: Armadillo is a C++ linear algebra library (matrix maths) aiming towards a good balance between speed and ease of use.

newarp_TridiagEigen_meat.hpp  (armadillo-10.8.2.tar.xz):newarp_TridiagEigen_meat.hpp  (armadillo-11.0.0.tar.xz)
skipping to change at line 58 skipping to change at line 58
arma_debug_check( (mat_obj.is_square() == false), "newarp::TridiagEigen::compu te(): matrix must be square" ); arma_debug_check( (mat_obj.is_square() == false), "newarp::TridiagEigen::compu te(): matrix must be square" );
n = blas_int(mat_obj.n_rows); n = blas_int(mat_obj.n_rows);
main_diag = mat_obj.diag(); main_diag = mat_obj.diag();
sub_diag = mat_obj.diag(-1); sub_diag = mat_obj.diag(-1);
evecs.set_size(n, n); evecs.set_size(n, n);
char compz = 'I'; char compz = 'I';
blas_int lwork = blas_int(-1); blas_int lwork_min = 1 + 4*n + n*n;
eT lwork_opt = eT(0); blas_int liwork_min = 3 + 5*n;
blas_int liwork = blas_int(-1);
blas_int liwork_opt = blas_int(0);
blas_int info = blas_int(0); blas_int info = blas_int(0);
// query for lwork and liwork blas_int lwork_proposed = 0;
lapack::stedc(&compz, &n, main_diag.memptr(), sub_diag.memptr(), evecs.memptr( blas_int liwork_proposed = 0;
), &n, &lwork_opt, &lwork, &liwork_opt, &liwork, &info);
if(info == 0) if(n >= 32)
{
lwork = blas_int(lwork_opt);
liwork = liwork_opt;
}
else
{ {
lwork = 1 + 4 * n + n * n; eT work_query[2] = {};
liwork = 3 + 5 * n; blas_int lwork_query = blas_int(-1);
blas_int iwork_query[2] = {};
blas_int liwork_query = blas_int(-1);
arma_extra_debug_print("lapack::stedc()");
lapack::stedc(&compz, &n, main_diag.memptr(), sub_diag.memptr(), evecs.mempt
r(), &n, &work_query[0], &lwork_query, &iwork_query[0], &liwork_query, &info);
if(info != 0) { arma_stop_runtime_error("lapack::stedc(): couldn't get size
of work arrays"); return; }
lwork_proposed = static_cast<blas_int>( work_query[0] );
liwork_proposed = iwork_query[0];
} }
info = blas_int(0); blas_int lwork = (std::max)( lwork_min, lwork_proposed);
blas_int liwork = (std::max)(liwork_min, liwork_proposed);
podarray<eT> work(static_cast<uword>(lwork) ); podarray<eT> work( static_cast<uword>( lwork) );
podarray<blas_int> iwork(static_cast<uword>(liwork)); podarray<blas_int> iwork( static_cast<uword>(liwork) );
arma_extra_debug_print("lapack::stedc()");
lapack::stedc(&compz, &n, main_diag.memptr(), sub_diag.memptr(), evecs.memptr( ), &n, work.memptr(), &lwork, iwork.memptr(), &liwork, &info); lapack::stedc(&compz, &n, main_diag.memptr(), sub_diag.memptr(), evecs.memptr( ), &n, work.memptr(), &lwork, iwork.memptr(), &liwork, &info);
if(info < 0) { arma_stop_logic_error("lapack::stedc(): illegal value"); retur if(info != 0) { arma_stop_runtime_error("lapack::stedc(): failed to compute a
n; } ll eigenvalues"); return; }
if(info > 0) { arma_stop_runtime_error("lapack::stedc(): failed to compute al
l eigenvalues"); return; }
computed = true; computed = true;
} }
template<typename eT> template<typename eT>
inline inline
Col<eT> Col<eT>
TridiagEigen<eT>::eigenvalues() TridiagEigen<eT>::eigenvalues()
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
 End of changes. 8 change blocks. 
24 lines changed or deleted 27 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)