lapack_wrapper.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 // Copyright (C)      2009 Edmund Highcock
00004 // Copyright (C)      2011 James Sanders
00005 // 
00006 // This file is part of the Armadillo C++ library.
00007 // It is provided without any warranty of fitness
00008 // for any purpose. You can redistribute this file
00009 // and/or modify it under the terms of the GNU
00010 // Lesser General Public License (LGPL) as published
00011 // by the Free Software Foundation, either version 3
00012 // of the License or (at your option) any later version.
00013 // (see http://www.opensource.org/licenses for more info)
00014 
00015 
00016 
00017 #ifdef ARMA_USE_LAPACK
00018 
00019 
00021 namespace lapack
00022   {
00023   
00024   
00025   template<typename eT>
00026   inline
00027   void
00028   getrf(blas_int* m, blas_int* n, eT* a, blas_int* lda, blas_int* ipiv, blas_int* info)
00029     {
00030     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00031     
00032     if(is_float<eT>::value == true)
00033       {
00034       typedef float T;
00035       arma_fortran(arma_sgetrf)(m, n, (T*)a, lda, ipiv, info);
00036       }
00037     else
00038     if(is_double<eT>::value == true)
00039       {
00040       typedef double T;
00041       arma_fortran(arma_dgetrf)(m, n, (T*)a, lda, ipiv, info);
00042       }
00043     else
00044     if(is_supported_complex_float<eT>::value == true)
00045       {
00046       typedef std::complex<float> T;
00047       arma_fortran(arma_cgetrf)(m, n, (T*)a, lda, ipiv, info);
00048       }
00049     else
00050     if(is_supported_complex_double<eT>::value == true)
00051       {
00052       typedef std::complex<double> T;
00053       arma_fortran(arma_zgetrf)(m, n, (T*)a, lda, ipiv, info);
00054       }
00055     }
00056     
00057     
00058     
00059   template<typename eT>
00060   inline
00061   void
00062   getri(blas_int* n,  eT* a, blas_int* lda, blas_int* ipiv, eT* work, blas_int* lwork, blas_int* info)
00063     {
00064     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00065     
00066     if(is_float<eT>::value == true)
00067       {
00068       typedef float T;
00069       arma_fortran(arma_sgetri)(n, (T*)a, lda, ipiv, (T*)work, lwork, info);
00070       }
00071     else
00072     if(is_double<eT>::value == true)
00073       {
00074       typedef double T;
00075       arma_fortran(arma_dgetri)(n, (T*)a, lda, ipiv, (T*)work, lwork, info);
00076       }
00077     else
00078     if(is_supported_complex_float<eT>::value == true)
00079       {
00080       typedef std::complex<float> T;
00081       arma_fortran(arma_cgetri)(n, (T*)a, lda, ipiv, (T*)work, lwork, info);
00082       }
00083     else
00084     if(is_supported_complex_double<eT>::value == true)
00085       {
00086       typedef std::complex<double> T;
00087       arma_fortran(arma_zgetri)(n, (T*)a, lda, ipiv, (T*)work, lwork, info);
00088       }
00089     }
00090   
00091   
00092   
00093   template<typename eT>
00094   inline
00095   void
00096   trtri(char* uplo, char* diag, blas_int* n, eT* a, blas_int* lda, blas_int* info)
00097     {
00098     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00099     
00100     if(is_float<eT>::value == true)
00101       {
00102       typedef float T;
00103       arma_fortran(arma_strtri)(uplo, diag, n, (T*)a, lda, info);
00104       }
00105     else
00106     if(is_double<eT>::value == true)
00107       {
00108       typedef double T;
00109       arma_fortran(arma_dtrtri)(uplo, diag, n, (T*)a, lda, info);
00110       }
00111     else
00112     if(is_supported_complex_float<eT>::value == true)
00113       {
00114       typedef std::complex<float> T;
00115       arma_fortran(arma_ctrtri)(uplo, diag, n, (T*)a, lda, info);
00116       }
00117     else
00118     if(is_supported_complex_double<eT>::value == true)
00119       {
00120       typedef std::complex<double> T;
00121       arma_fortran(arma_ztrtri)(uplo, diag, n, (T*)a, lda, info);
00122       }
00123     }
00124   
00125   
00126   
00127   template<typename eT>
00128   inline
00129   void
00130   syev(char* jobz, char* uplo, blas_int* n, eT* a, blas_int* lda, eT* w,  eT* work, blas_int* lwork, blas_int* info)
00131     {
00132     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00133     
00134     if(is_float<eT>::value == true)
00135       {
00136       typedef float T;
00137       arma_fortran(arma_ssyev)(jobz, uplo, n, (T*)a, lda, (T*)w, (T*)work, lwork, info);
00138       }
00139     else
00140     if(is_double<eT>::value == true)
00141       {
00142       typedef double T;
00143       arma_fortran(arma_dsyev)(jobz, uplo, n, (T*)a, lda, (T*)w, (T*)work, lwork, info);
00144       }
00145     }
00146   
00147   
00148   
00149   template<typename eT>
00150   inline
00151   void
00152   heev
00153     (
00154     char* jobz, char* uplo, blas_int* n,
00155     eT* a, blas_int* lda, typename eT::value_type* w,
00156     eT* work, blas_int* lwork, typename eT::value_type* rwork,
00157     blas_int* info
00158     )
00159     {
00160     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00161     
00162     if(is_supported_complex_float<eT>::value == true)
00163       {
00164       typedef float T;
00165       typedef typename std::complex<T> cx_T;
00166       arma_fortran(arma_cheev)(jobz, uplo, n, (cx_T*)a, lda, (T*)w, (cx_T*)work, lwork, (T*)rwork, info);
00167       }
00168     else
00169     if(is_supported_complex_double<eT>::value == true)
00170       {
00171       typedef double T;
00172       typedef typename std::complex<T> cx_T;
00173       arma_fortran(arma_zheev)(jobz, uplo, n, (cx_T*)a, lda, (T*)w, (cx_T*)work, lwork, (T*)rwork, info);
00174       }
00175     }
00176   
00177          
00178   template<typename eT>
00179   inline
00180   void
00181   geev
00182     (
00183     char* jobvl, char* jobvr, blas_int* n, 
00184     eT* a, blas_int* lda, eT* wr, eT* wi, eT* vl, 
00185     blas_int* ldvl, eT* vr, blas_int* ldvr, 
00186     eT* work, blas_int* lwork,
00187     blas_int* info
00188     )
00189     {
00190     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00191 
00192     if(is_float<eT>::value == true)
00193       {
00194       typedef float T;
00195       arma_fortran(arma_sgeev)(jobvl, jobvr, n,  (T*)a, lda, (T*)wr, (T*)wi, (T*)vl, ldvl, (T*)vr, ldvr, (T*)work, lwork, info);
00196       }
00197     else
00198     if(is_double<eT>::value == true)
00199       {
00200       typedef double T;
00201       arma_fortran(arma_dgeev)(jobvl, jobvr, n,  (T*)a, lda, (T*)wr, (T*)wi, (T*)vl, ldvl, (T*)vr, ldvr, (T*)work, lwork, info);
00202       }
00203     }
00204 
00205 
00206   template<typename eT>
00207   inline
00208   void
00209   cx_geev
00210     (
00211     char* jobvl, char* jobvr, blas_int* n, 
00212     eT* a, blas_int* lda, eT* w, 
00213     eT* vl, blas_int* ldvl, 
00214     eT* vr, blas_int* ldvr, 
00215     eT* work, blas_int* lwork, typename eT::value_type* rwork, 
00216     blas_int* info
00217     )
00218     {
00219     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00220     
00221     if(is_supported_complex_float<eT>::value == true)
00222       {
00223       typedef float T;
00224       typedef typename std::complex<T> cx_T;
00225       arma_fortran(arma_cgeev)(jobvl, jobvr, n, (cx_T*)a, lda, (cx_T*)w, (cx_T*)vl, ldvl, (cx_T*)vr, ldvr, (cx_T*)work, lwork, (T*)rwork, info);
00226       }
00227     else
00228     if(is_supported_complex_double<eT>::value == true)
00229       {
00230       typedef double T;
00231       typedef typename std::complex<T> cx_T;
00232       arma_fortran(arma_zgeev)(jobvl, jobvr, n, (cx_T*)a, lda, (cx_T*)w, (cx_T*)vl, ldvl, (cx_T*)vr, ldvr, (cx_T*)work, lwork, (T*)rwork, info);
00233       }
00234     }
00235   
00236 
00237 
00238   
00239   template<typename eT>
00240   inline
00241   void
00242   potrf(char* uplo, blas_int* n, eT* a, blas_int* lda, blas_int* info)
00243     {
00244     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00245     
00246     if(is_float<eT>::value == true)
00247       {
00248       typedef float T;
00249       arma_fortran(arma_spotrf)(uplo, n, (T*)a, lda, info);
00250       }
00251     else
00252     if(is_double<eT>::value == true)
00253       {
00254       typedef double T;
00255       arma_fortran(arma_dpotrf)(uplo, n, (T*)a, lda, info);
00256       }
00257     else
00258     if(is_supported_complex_float<eT>::value == true)
00259       {
00260       typedef std::complex<float> T;
00261       arma_fortran(arma_cpotrf)(uplo, n, (T*)a, lda, info);
00262       }
00263     else
00264     if(is_supported_complex_double<eT>::value == true)
00265       {
00266       typedef std::complex<double> T;
00267       arma_fortran(arma_zpotrf)(uplo, n, (T*)a, lda, info);
00268       }
00269     
00270     }
00271   
00272   
00273   
00274   template<typename eT>
00275   inline
00276   void
00277   potri(char* uplo, blas_int* n, eT* a, blas_int* lda, blas_int* info)
00278     {
00279     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00280     
00281     if(is_float<eT>::value == true)
00282       {
00283       typedef float T;
00284       arma_fortran(arma_spotri)(uplo, n, (T*)a, lda, info);
00285       }
00286     else
00287     if(is_double<eT>::value == true)
00288       {
00289       typedef double T;
00290       arma_fortran(arma_dpotri)(uplo, n, (T*)a, lda, info);
00291       }
00292     else
00293     if(is_supported_complex_float<eT>::value == true)
00294       {
00295       typedef std::complex<float> T;
00296       arma_fortran(arma_cpotri)(uplo, n, (T*)a, lda, info);
00297       }
00298     else
00299     if(is_supported_complex_double<eT>::value == true)
00300       {
00301       typedef std::complex<double> T;
00302       arma_fortran(arma_zpotri)(uplo, n, (T*)a, lda, info);
00303       }
00304     
00305     }
00306   
00307   
00308   
00309   template<typename eT>
00310   inline
00311   void
00312   geqrf(blas_int* m, blas_int* n, eT* a, blas_int* lda, eT* tau, eT* work, blas_int* lwork, blas_int* info)
00313     {
00314     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00315     
00316     if(is_float<eT>::value == true)
00317       {
00318       typedef float T;
00319       arma_fortran(arma_sgeqrf)(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork, info);
00320       }
00321     else
00322     if(is_double<eT>::value == true)
00323       {
00324       typedef double T;
00325       arma_fortran(arma_dgeqrf)(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork, info);
00326       }
00327     else
00328     if(is_supported_complex_float<eT>::value == true)
00329       {
00330       typedef std::complex<float> T;
00331       arma_fortran(arma_cgeqrf)(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork, info);
00332       }
00333     else
00334     if(is_supported_complex_double<eT>::value == true)
00335       {
00336       typedef std::complex<double> T;
00337       arma_fortran(arma_zgeqrf)(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork, info);
00338       }
00339     
00340     }
00341   
00342   
00343   
00344   template<typename eT>
00345   inline
00346   void
00347   orgqr(blas_int* m, blas_int* n, blas_int* k, eT* a, blas_int* lda, eT* tau, eT* work, blas_int* lwork, blas_int* info)
00348     {
00349     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00350     
00351     if(is_float<eT>::value == true)
00352       {
00353       typedef float T;
00354       arma_fortran(arma_sorgqr)(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwork, info);
00355       }
00356     else
00357     if(is_double<eT>::value == true)
00358       {
00359       typedef double T;
00360       arma_fortran(arma_dorgqr)(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwork, info);
00361       }
00362     }
00363 
00364 
00365   
00366   template<typename eT>
00367   inline
00368   void
00369   ungqr(blas_int* m, blas_int* n, blas_int* k, eT* a, blas_int* lda, eT* tau, eT* work, blas_int* lwork, blas_int* info)
00370     {
00371     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00372     
00373     if(is_supported_complex_float<eT>::value == true)
00374       {
00375       typedef float T;
00376       arma_fortran(arma_cungqr)(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwork, info);
00377       }
00378     else
00379     if(is_supported_complex_double<eT>::value == true)
00380       {
00381       typedef double T;
00382       arma_fortran(arma_zungqr)(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwork, info);
00383       }
00384     }
00385   
00386   
00387   template<typename eT>
00388   inline
00389   void
00390   gesvd
00391     (
00392     char* jobu, char* jobvt, blas_int* m, blas_int* n, eT* a, blas_int* lda,
00393     eT* s, eT* u, blas_int* ldu, eT* vt, blas_int* ldvt,
00394     eT* work, blas_int* lwork, blas_int* info
00395     )
00396     {
00397     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00398     
00399     if(is_float<eT>::value == true)
00400       {
00401       typedef float T;
00402       arma_fortran(arma_sgesvd)(jobu, jobvt, m, n, (T*)a, lda, (T*)s, (T*)u, ldu, (T*)vt, ldvt, (T*)work, lwork, info);
00403       }
00404     else
00405     if(is_double<eT>::value == true)
00406       {
00407       typedef double T;
00408       arma_fortran(arma_dgesvd)(jobu, jobvt, m, n, (T*)a, lda, (T*)s, (T*)u, ldu, (T*)vt, ldvt, (T*)work, lwork, info);
00409       }
00410     }
00411   
00412   
00413   
00414   template<typename T>
00415   inline
00416   void
00417   cx_gesvd
00418     (
00419     char* jobu, char* jobvt, blas_int* m, blas_int* n, std::complex<T>* a, blas_int* lda,
00420     T* s, std::complex<T>* u, blas_int* ldu, std::complex<T>* vt, blas_int* ldvt, 
00421     std::complex<T>* work, blas_int* lwork, T* rwork, blas_int* info
00422     )
00423     {
00424     arma_type_check(( is_supported_blas_type<T>::value == false ));
00425     arma_type_check(( is_supported_blas_type< std::complex<T> >::value == false ));
00426     
00427     if(is_float<T>::value == true)
00428       {
00429       typedef float bT;
00430       arma_fortran(arma_cgesvd)
00431         (
00432         jobu, jobvt, m, n, (std::complex<bT>*)a, lda,
00433         (bT*)s, (std::complex<bT>*)u, ldu, (std::complex<bT>*)vt, ldvt,
00434         (std::complex<bT>*)work, lwork, (bT*)rwork, info
00435         );
00436       }
00437     else
00438     if(is_double<T>::value == true)
00439       {
00440       typedef double bT;
00441       arma_fortran(arma_zgesvd)
00442         (
00443         jobu, jobvt, m, n, (std::complex<bT>*)a, lda,
00444         (bT*)s, (std::complex<bT>*)u, ldu, (std::complex<bT>*)vt, ldvt,
00445         (std::complex<bT>*)work, lwork, (bT*)rwork, info
00446         );
00447       }
00448     }
00449   
00450   
00451   
00452   template<typename eT>
00453   inline
00454   void
00455   gesv(blas_int* n, blas_int* nrhs, eT* a, blas_int* lda, blas_int* ipiv, eT* b, blas_int* ldb, blas_int* info)
00456     {
00457     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00458     
00459     if(is_float<eT>::value == true)
00460       {
00461       typedef float T;
00462       arma_fortran(arma_sgesv)(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info);
00463       }
00464     else
00465     if(is_double<eT>::value == true)
00466       {
00467       typedef double T;
00468       arma_fortran(arma_dgesv)(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info);
00469       }
00470     else
00471     if(is_supported_complex_float<eT>::value == true)
00472       {
00473       typedef std::complex<float> T;
00474       arma_fortran(arma_cgesv)(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info);
00475       }
00476     else
00477     if(is_supported_complex_double<eT>::value == true)
00478       {
00479       typedef std::complex<double> T;
00480       arma_fortran(arma_zgesv)(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info);
00481       }
00482     }
00483   
00484   
00485   
00486   template<typename eT>
00487   inline
00488   void
00489   gels(char* trans, blas_int* m, blas_int* n, blas_int* nrhs, eT* a, blas_int* lda, eT* b, blas_int* ldb, eT* work, blas_int* lwork, blas_int* info)
00490     {
00491     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00492     
00493     if(is_float<eT>::value == true)
00494       {
00495       typedef float T;
00496       arma_fortran(arma_sgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)work, lwork, info);
00497       }
00498     else
00499     if(is_double<eT>::value == true)
00500       {
00501       typedef double T;
00502       arma_fortran(arma_dgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)work, lwork, info);
00503       }
00504     else
00505     if(is_supported_complex_float<eT>::value == true)
00506       {
00507       typedef std::complex<float> T;
00508       arma_fortran(arma_cgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)work, lwork, info);
00509       }
00510     else
00511     if(is_supported_complex_double<eT>::value == true)
00512       {
00513       typedef std::complex<double> T;
00514       arma_fortran(arma_zgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)work, lwork, info);
00515       }
00516     }
00517   
00518   
00519   
00520   template<typename eT>
00521   inline
00522   void
00523   trtrs(char* uplo, char* trans, char* diag, blas_int* n, blas_int* nrhs, const eT* a, blas_int* lda, eT* b, blas_int* ldb, blas_int* info)
00524     {
00525     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00526     
00527     if(is_float<eT>::value == true)
00528       {
00529       typedef float T;
00530       arma_fortran(arma_strtrs)(uplo, trans, diag, n, nrhs, (T*)a, lda, (T*)b, ldb, info);
00531       }
00532     else
00533     if(is_double<eT>::value == true)
00534       {
00535       typedef double T;
00536       arma_fortran(arma_dtrtrs)(uplo, trans, diag, n, nrhs, (T*)a, lda, (T*)b, ldb, info);
00537       }
00538     else
00539     if(is_supported_complex_float<eT>::value == true)
00540       {
00541       typedef std::complex<float> T;
00542       arma_fortran(arma_ctrtrs)(uplo, trans, diag, n, nrhs, (T*)a, lda, (T*)b, ldb, info);
00543       }
00544     else
00545     if(is_supported_complex_double<eT>::value == true)
00546       {
00547       typedef std::complex<double> T;
00548       arma_fortran(arma_ztrtrs)(uplo, trans, diag, n, nrhs, (T*)a, lda, (T*)b, ldb, info);
00549       }
00550     }
00551   
00552   
00553   
00554   template<typename eT>
00555   inline
00556   void
00557   gees(char* jobvs, char* sort, blas_int* select, blas_int* n, eT* a, blas_int* lda, blas_int* sdim, eT* wr, eT* wi, eT* vs, blas_int* ldvs, eT* work, blas_int* lwork, blas_int* bwork, blas_int* info)
00558     {
00559     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00560     
00561     if(is_float<eT>::value == true)
00562       {
00563       typedef float T;
00564       arma_fortran(arma_sgees)(jobvs, sort, select, n, (T*)a, lda, sdim, (T*)wr, (T*)wi, (T*)vs, ldvs, (T*)work, lwork, bwork, info);
00565       }
00566     else
00567     if(is_double<eT>::value == true)
00568       {
00569       typedef double T;
00570       arma_fortran(arma_dgees)(jobvs, sort, select, n, (T*)a, lda, sdim, (T*)wr, (T*)wi, (T*)vs, ldvs, (T*)work, lwork, bwork, info);
00571       }
00572     }
00573   
00574   
00575   
00576   template<typename T>
00577   inline
00578   void
00579   cx_gees(char* jobvs, char* sort, blas_int* select, blas_int* n, std::complex<T>* a, blas_int* lda, blas_int* sdim, std::complex<T>* w, std::complex<T>* vs, blas_int* ldvs, std::complex<T>* work, blas_int* lwork, T* rwork, blas_int* bwork, blas_int* info)
00580     {
00581     arma_type_check(( is_supported_blas_type<T>::value == false ));
00582     arma_type_check(( is_supported_blas_type< std::complex<T> >::value == false ));
00583     
00584     if(is_float<T>::value == true)
00585       {
00586       typedef float bT;
00587       typedef std::complex<bT> cT;
00588       arma_fortran(arma_cgees)(jobvs, sort, select, n, (cT*)a, lda, sdim, (cT*)w, (cT*)vs, ldvs, (cT*)work, lwork, (bT*)rwork, bwork, info);
00589       }
00590     else
00591     if(is_double<T>::value == true)
00592       {
00593       typedef double bT;
00594       typedef std::complex<bT> cT;
00595       arma_fortran(arma_zgees)(jobvs, sort, select, n, (cT*)a, lda, sdim, (cT*)w, (cT*)vs, ldvs, (cT*)work, lwork, (bT*)rwork, bwork, info);
00596       }
00597     }
00598   
00599   
00600   
00601   template<typename eT>
00602   inline
00603   void
00604   trsyl(char* transa, char* transb, blas_int* isgn, blas_int* m, blas_int* n, const eT* a, blas_int* lda, const eT* b, blas_int* ldb, eT* c, blas_int* ldc, eT* scale, blas_int* info)
00605     {
00606     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00607     
00608     if(is_float<eT>::value == true)
00609       {
00610       typedef float T;
00611       arma_fortran(arma_strsyl)(transa, transb, isgn, m, n, (T*)a, lda, (T*)b, ldb, (T*)c, ldc, (T*)scale, info);
00612       }
00613     else
00614     if(is_double<eT>::value == true)
00615       {
00616       typedef double T;
00617       arma_fortran(arma_dtrsyl)(transa, transb, isgn, m, n, (T*)a, lda, (T*)b, ldb, (T*)c, ldc, (T*)scale, info);
00618       }
00619     else
00620     if(is_supported_complex_float<eT>::value == true)
00621       {
00622       typedef std::complex<float> T;
00623       arma_fortran(arma_ctrsyl)(transa, transb, isgn, m, n, (T*)a, lda, (T*)b, ldb, (T*)c, ldc, (float*)scale, info);
00624       }
00625     else
00626     if(is_supported_complex_double<eT>::value == true)
00627       {
00628       typedef std::complex<double> T;
00629       arma_fortran(arma_ztrsyl)(transa, transb, isgn, m, n, (T*)a, lda, (T*)b, ldb, (T*)c, ldc, (double*)scale, info);
00630       }
00631     }
00632   
00633   
00634   template<typename eT>
00635   inline
00636   void
00637   sytrf(char* uplo, blas_int* n, eT* a, blas_int* lda, blas_int* ipiv, eT* work, blas_int* lwork, blas_int* info)
00638     {
00639     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00640     
00641     if(is_float<eT>::value == true)
00642       {
00643       typedef float T;
00644       arma_fortran(arma_ssytrf)(uplo, n, (T*)a, lda, ipiv, (T*)work, lwork, info);
00645       }
00646     else
00647     if(is_double<eT>::value == true)
00648       {
00649       typedef double T;
00650       arma_fortran(arma_dsytrf)(uplo, n, (T*)a, lda, ipiv, (T*)work, lwork, info);
00651       }
00652     else
00653     if(is_supported_complex_float<eT>::value == true)
00654       {
00655       typedef std::complex<float> T;
00656       arma_fortran(arma_csytrf)(uplo, n, (T*)a, lda, ipiv, (T*)work, lwork, info);
00657       }
00658     else
00659     if(is_supported_complex_double<eT>::value == true)
00660       {
00661       typedef std::complex<double> T;
00662       arma_fortran(arma_zsytrf)(uplo, n, (T*)a, lda, ipiv, (T*)work, lwork, info);
00663       }
00664     }
00665   
00666   
00667   template<typename eT>
00668   inline
00669   void
00670   sytri(char* uplo, blas_int* n, eT* a, blas_int* lda, blas_int* ipiv, eT* work, blas_int* info)
00671     {
00672     arma_type_check(( is_supported_blas_type<eT>::value == false ));
00673     
00674     if(is_float<eT>::value == true)
00675       {
00676       typedef float T;
00677       arma_fortran(arma_ssytri)(uplo, n, (T*)a, lda, ipiv, (T*)work, info);
00678       }
00679     else
00680     if(is_double<eT>::value == true)
00681       {
00682       typedef double T;
00683       arma_fortran(arma_dsytri)(uplo, n, (T*)a, lda, ipiv, (T*)work, info);
00684       }
00685     else
00686     if(is_supported_complex_float<eT>::value == true)
00687       {
00688       typedef std::complex<float> T;
00689       arma_fortran(arma_csytri)(uplo, n, (T*)a, lda, ipiv, (T*)work, info);
00690       }
00691     else
00692     if(is_supported_complex_double<eT>::value == true)
00693       {
00694       typedef std::complex<double> T;
00695       arma_fortran(arma_zsytri)(uplo, n, (T*)a, lda, ipiv, (T*)work, info);
00696       }
00697     }
00698   
00699   
00700   }
00701 
00702 
00703 #endif


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