BOOST_FORCEINLINE result_type operator()( A0& a, A1& b, A2& alpha, A3& beta, A4& vr, A5& vl) const { result_type info = 0; char jobvr = 'V'; char jobvl = 'V'; details::workspace<typename A0::value_type> wk; nt2_la_int n = nt2::width(a); BOOST_ASSERT_MSG( (n == nt2_la_int(nt2::height(a))) &&(n == nt2_la_int(nt2::height(b))) , "inputs must be square"); nt2_la_int lda = nt2::max(a.leading_size(), One<size_t>()); nt2_la_int ldb = nt2::max(b.leading_size(), One<size_t>()); nt2_la_int ldvl = n; nt2_la_int ldvr = n; NT2_F77NAME(zggev) ( &jobvl, &jobvr , &n , 0 /*a*/, &lda , 0 /*b*/, &ldb , 0/*alpha*/ , 0/*beta*/ , 0/*vl*/, &ldvl , 0/*vr*/, &ldvr , wk.main(), details::query() , wk.reals() , &info); info = nt2::ggev_wvrvl(a, b, alpha, beta, vr, vl, wk); return info; }
BOOST_FORCEINLINE void inverse(T1& ip) const { T1 inv(of_size(1, numel(ip))); inv(ip) = nt2::_(nt2_la_int(1), nt2_la_int(numel(ip))); assign_swap(ip, inv); }
BOOST_FORCEINLINE void construct_ip(T1& ls, T2& ips, size_t h) const { std::size_t d = nt2::numel(ls); ips = nt2::_(nt2_la_int(1), nt2_la_int(h)); for(std::size_t i = d; i >= 1; --i) { std::swap(ips(i), ips(ls(i))); } }
BOOST_FORCEINLINE result_type operator()( A0& a, A1& scale , A2& ilo, A3& ihi, C0 job) const { result_type info; nt2_la_int n = nt2::width(a); BOOST_ASSERT_MSG(n == nt2_la_int(nt2::height(a)), "input must be square"); nt2_la_int lda = nt2::max(a.leading_size(), One<size_t>()); NT2_F77NAME(cgebal) (&job, &n , a.raw(), &lda , &ilo, &ihi , scale.raw(), &info); return info; }
BOOST_FORCEINLINE result_type operator()( A0& a, A1& w) const { char jobvl = 'N'; char jobvr = 'N'; result_type info = 0; details::workspace<typename A0::value_type> wk; nt2_la_int n = nt2::width(a); BOOST_ASSERT_MSG(n == nt2_la_int(nt2::height(a)), "input must be square"); nt2_la_int lda = nt2::max(a.leading_size(), One<size_t>()); nt2_la_int ldvl = 1; nt2_la_int ldvr = 1; NT2_F77NAME(cgeev) ( &jobvl, &jobvr , &n , 0 /*a*/, &lda , 0 /*w*/ , 0 /*vl*/, &ldvl , 0 /*vr*/, &ldvr , wk.main(), details::query() , wk.reals() , &info); info = nt2::geev_w(a, w, wk); return info; }