// Copyright (C) 2015 National ICT Australia (NICTA) // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // ------------------------------------------------------------------- // // Written by Conrad Sanderson - http://conradsanderson.id.au //! \addtogroup fn_schur //! @{ template inline bool schur ( Mat& S, const Base& X, const typename arma_blas_type_only::result* junk = 0 ) { arma_extra_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; Mat U; const bool status = auxlib::schur(U, S, X.get_ref(), false); if(status == false) { S.reset(); arma_debug_warn("schur(): decomposition failed"); } return status; } template inline Mat schur ( const Base& X, const typename arma_blas_type_only::result* junk = 0 ) { arma_extra_debug_sigprint(); arma_ignore(junk); typedef typename T1::elem_type eT; Mat S; Mat U; const bool status = auxlib::schur(U, S, X.get_ref(), false); if(status == false) { S.reset(); arma_bad("schur(): decomposition failed"); } return S; } template inline bool schur ( Mat& U, Mat& S, const Base& X, const typename arma_blas_type_only::result* junk = 0 ) { arma_extra_debug_sigprint(); arma_ignore(junk); arma_debug_check( void_ptr(&U) == void_ptr(&S), "schur(): 'U' is an alias of 'S'" ); const bool status = auxlib::schur(U, S, X.get_ref(), true); if(status == false) { U.reset(); S.reset(); arma_debug_warn("schur(): decomposition failed"); } return status; } //! @}