00001 // Copyright (C) 2009-2011 NICTA (www.nicta.com.au) 00002 // Copyright (C) 2009-2011 Conrad Sanderson 00003 // 00004 // This file is part of the Armadillo C++ library. 00005 // It is provided without any warranty of fitness 00006 // for any purpose. You can redistribute this file 00007 // and/or modify it under the terms of the GNU 00008 // Lesser General Public License (LGPL) as published 00009 // by the Free Software Foundation, either version 3 00010 // of the License or (at your option) any later version. 00011 // (see http://www.opensource.org/licenses for more info) 00012 00013 00016 00017 00018 00020 template<typename T1> 00021 inline 00022 bool 00023 qr 00024 ( 00025 Mat<typename T1::elem_type>& Q, 00026 Mat<typename T1::elem_type>& R, 00027 const Base<typename T1::elem_type,T1>& X, 00028 const typename arma_blas_type_only<typename T1::elem_type>::result* junk = 0 00029 ) 00030 { 00031 arma_extra_debug_sigprint(); 00032 arma_ignore(junk); 00033 00034 arma_debug_check( (&Q == &R), "qr(): Q and R are the same object"); 00035 00036 const bool status = auxlib::qr(Q, R, X); 00037 00038 if(status == false) 00039 { 00040 Q.reset(); 00041 R.reset(); 00042 arma_bad("qr(): failed to converge", false); 00043 } 00044 00045 return false; 00046 } 00047 00048 00049