// Copyright (C) 2009-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_chol //! @{ template inline typename enable_if2< is_supported_blas_type::value, const Op >::result chol ( const Base& X, const char* layout = "upper" ) { arma_extra_debug_sigprint(); const char sig = (layout != NULL) ? layout[0] : char(0); arma_debug_check( ((sig != 'u') && (sig != 'l')), "chol(): layout must be \"upper\" or \"lower\"" ); return Op(X.get_ref(), ((sig == 'u') ? 0 : 1), 0 ); } template inline typename enable_if2< is_supported_blas_type::value, bool >::result chol ( Mat& out, const Base& X, const char* layout = "upper" ) { arma_extra_debug_sigprint(); const char sig = (layout != NULL) ? layout[0] : char(0); arma_debug_check( ((sig != 'u') && (sig != 'l')), "chol(): layout must be \"upper\" or \"lower\"" ); const bool status = auxlib::chol(out, X.get_ref(), ((sig == 'u') ? 0 : 1)); if(status == false) { out.reset(); arma_debug_warn("chol(): decomposition failed"); } return status; } //! @}