fn_lu.hpp
Go to the documentation of this file.
00001 // Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
00002 // Copyright (C) 2008-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 lu
00024   (
00025          Mat<typename T1::elem_type>&    L,
00026          Mat<typename T1::elem_type>&    U,
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( (&L == &U), "lu(): L and U are the same object");
00035   
00036   const bool status = auxlib::lu(L, U, X);
00037   
00038   if(status == false)
00039     {
00040     L.reset();
00041     U.reset();
00042     arma_bad("lu(): failed to converge", false);
00043     }
00044   
00045   return status;
00046   }
00047 
00048 
00049 
00051 template<typename T1>
00052 inline
00053 bool
00054 lu
00055   (
00056          Mat<typename T1::elem_type>&    L,
00057          Mat<typename T1::elem_type>&    U, 
00058          Mat<typename T1::elem_type>&    P,
00059   const Base<typename T1::elem_type,T1>& X,
00060   const typename arma_blas_type_only<typename T1::elem_type>::result* junk = 0
00061   )
00062   {
00063   arma_extra_debug_sigprint();
00064   arma_ignore(junk);
00065   
00066   arma_debug_check( ( (&L == &U) || (&L == &P) || (&U == &P) ), "lu(): two or more output objects are the same object");
00067   
00068   const bool status = auxlib::lu(L, U, P, X);
00069   
00070   if(status == false)
00071     {
00072     L.reset();
00073     U.reset();
00074     P.reset();
00075     arma_bad("lu(): failed to converge", false);
00076     }
00077   
00078   return status;
00079   }
00080 
00081 
00082 


armadillo_matrix
Author(s): Conrad Sanderson - NICTA (www.nicta.com.au), (Wrapper by Sjoerd van den Dries)
autogenerated on Tue Jan 7 2014 11:42:04