annotate armadillo-2.4.4/include/armadillo_bits/lapack_wrapper.hpp @ 5:79b343f3e4b8

In thi version the problem of letters assigned to each segment has been solved.
author maxzanoni76 <max.zanoni@eecs.qmul.ac.uk>
date Wed, 11 Apr 2012 13:48:13 +0100
parents 8b6102e2a9b0
children
rev   line source
max@0 1 // Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
max@0 2 // Copyright (C) 2008-2011 Conrad Sanderson
max@0 3 // Copyright (C) 2009 Edmund Highcock
max@0 4 // Copyright (C) 2011 James Sanders
max@0 5 //
max@0 6 // This file is part of the Armadillo C++ library.
max@0 7 // It is provided without any warranty of fitness
max@0 8 // for any purpose. You can redistribute this file
max@0 9 // and/or modify it under the terms of the GNU
max@0 10 // Lesser General Public License (LGPL) as published
max@0 11 // by the Free Software Foundation, either version 3
max@0 12 // of the License or (at your option) any later version.
max@0 13 // (see http://www.opensource.org/licenses for more info)
max@0 14
max@0 15
max@0 16
max@0 17 #ifdef ARMA_USE_LAPACK
max@0 18
max@0 19
max@0 20 //! \namespace lapack namespace for LAPACK functions
max@0 21 namespace lapack
max@0 22 {
max@0 23
max@0 24
max@0 25 template<typename eT>
max@0 26 inline
max@0 27 void
max@0 28 getrf(blas_int* m, blas_int* n, eT* a, blas_int* lda, blas_int* ipiv, blas_int* info)
max@0 29 {
max@0 30 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 31
max@0 32 if(is_float<eT>::value == true)
max@0 33 {
max@0 34 typedef float T;
max@0 35 arma_fortran(arma_sgetrf)(m, n, (T*)a, lda, ipiv, info);
max@0 36 }
max@0 37 else
max@0 38 if(is_double<eT>::value == true)
max@0 39 {
max@0 40 typedef double T;
max@0 41 arma_fortran(arma_dgetrf)(m, n, (T*)a, lda, ipiv, info);
max@0 42 }
max@0 43 else
max@0 44 if(is_supported_complex_float<eT>::value == true)
max@0 45 {
max@0 46 typedef std::complex<float> T;
max@0 47 arma_fortran(arma_cgetrf)(m, n, (T*)a, lda, ipiv, info);
max@0 48 }
max@0 49 else
max@0 50 if(is_supported_complex_double<eT>::value == true)
max@0 51 {
max@0 52 typedef std::complex<double> T;
max@0 53 arma_fortran(arma_zgetrf)(m, n, (T*)a, lda, ipiv, info);
max@0 54 }
max@0 55 }
max@0 56
max@0 57
max@0 58
max@0 59 template<typename eT>
max@0 60 inline
max@0 61 void
max@0 62 getri(blas_int* n, eT* a, blas_int* lda, blas_int* ipiv, eT* work, blas_int* lwork, blas_int* info)
max@0 63 {
max@0 64 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 65
max@0 66 if(is_float<eT>::value == true)
max@0 67 {
max@0 68 typedef float T;
max@0 69 arma_fortran(arma_sgetri)(n, (T*)a, lda, ipiv, (T*)work, lwork, info);
max@0 70 }
max@0 71 else
max@0 72 if(is_double<eT>::value == true)
max@0 73 {
max@0 74 typedef double T;
max@0 75 arma_fortran(arma_dgetri)(n, (T*)a, lda, ipiv, (T*)work, lwork, info);
max@0 76 }
max@0 77 else
max@0 78 if(is_supported_complex_float<eT>::value == true)
max@0 79 {
max@0 80 typedef std::complex<float> T;
max@0 81 arma_fortran(arma_cgetri)(n, (T*)a, lda, ipiv, (T*)work, lwork, info);
max@0 82 }
max@0 83 else
max@0 84 if(is_supported_complex_double<eT>::value == true)
max@0 85 {
max@0 86 typedef std::complex<double> T;
max@0 87 arma_fortran(arma_zgetri)(n, (T*)a, lda, ipiv, (T*)work, lwork, info);
max@0 88 }
max@0 89 }
max@0 90
max@0 91
max@0 92
max@0 93 template<typename eT>
max@0 94 inline
max@0 95 void
max@0 96 trtri(char* uplo, char* diag, blas_int* n, eT* a, blas_int* lda, blas_int* info)
max@0 97 {
max@0 98 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 99
max@0 100 if(is_float<eT>::value == true)
max@0 101 {
max@0 102 typedef float T;
max@0 103 arma_fortran(arma_strtri)(uplo, diag, n, (T*)a, lda, info);
max@0 104 }
max@0 105 else
max@0 106 if(is_double<eT>::value == true)
max@0 107 {
max@0 108 typedef double T;
max@0 109 arma_fortran(arma_dtrtri)(uplo, diag, n, (T*)a, lda, info);
max@0 110 }
max@0 111 else
max@0 112 if(is_supported_complex_float<eT>::value == true)
max@0 113 {
max@0 114 typedef std::complex<float> T;
max@0 115 arma_fortran(arma_ctrtri)(uplo, diag, n, (T*)a, lda, info);
max@0 116 }
max@0 117 else
max@0 118 if(is_supported_complex_double<eT>::value == true)
max@0 119 {
max@0 120 typedef std::complex<double> T;
max@0 121 arma_fortran(arma_ztrtri)(uplo, diag, n, (T*)a, lda, info);
max@0 122 }
max@0 123 }
max@0 124
max@0 125
max@0 126
max@0 127 template<typename eT>
max@0 128 inline
max@0 129 void
max@0 130 syev(char* jobz, char* uplo, blas_int* n, eT* a, blas_int* lda, eT* w, eT* work, blas_int* lwork, blas_int* info)
max@0 131 {
max@0 132 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 133
max@0 134 if(is_float<eT>::value == true)
max@0 135 {
max@0 136 typedef float T;
max@0 137 arma_fortran(arma_ssyev)(jobz, uplo, n, (T*)a, lda, (T*)w, (T*)work, lwork, info);
max@0 138 }
max@0 139 else
max@0 140 if(is_double<eT>::value == true)
max@0 141 {
max@0 142 typedef double T;
max@0 143 arma_fortran(arma_dsyev)(jobz, uplo, n, (T*)a, lda, (T*)w, (T*)work, lwork, info);
max@0 144 }
max@0 145 }
max@0 146
max@0 147
max@0 148
max@0 149 template<typename eT>
max@0 150 inline
max@0 151 void
max@0 152 heev
max@0 153 (
max@0 154 char* jobz, char* uplo, blas_int* n,
max@0 155 eT* a, blas_int* lda, typename eT::value_type* w,
max@0 156 eT* work, blas_int* lwork, typename eT::value_type* rwork,
max@0 157 blas_int* info
max@0 158 )
max@0 159 {
max@0 160 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 161
max@0 162 if(is_supported_complex_float<eT>::value == true)
max@0 163 {
max@0 164 typedef float T;
max@0 165 typedef typename std::complex<T> cx_T;
max@0 166 arma_fortran(arma_cheev)(jobz, uplo, n, (cx_T*)a, lda, (T*)w, (cx_T*)work, lwork, (T*)rwork, info);
max@0 167 }
max@0 168 else
max@0 169 if(is_supported_complex_double<eT>::value == true)
max@0 170 {
max@0 171 typedef double T;
max@0 172 typedef typename std::complex<T> cx_T;
max@0 173 arma_fortran(arma_zheev)(jobz, uplo, n, (cx_T*)a, lda, (T*)w, (cx_T*)work, lwork, (T*)rwork, info);
max@0 174 }
max@0 175 }
max@0 176
max@0 177
max@0 178 template<typename eT>
max@0 179 inline
max@0 180 void
max@0 181 geev
max@0 182 (
max@0 183 char* jobvl, char* jobvr, blas_int* n,
max@0 184 eT* a, blas_int* lda, eT* wr, eT* wi, eT* vl,
max@0 185 blas_int* ldvl, eT* vr, blas_int* ldvr,
max@0 186 eT* work, blas_int* lwork,
max@0 187 blas_int* info
max@0 188 )
max@0 189 {
max@0 190 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 191
max@0 192 if(is_float<eT>::value == true)
max@0 193 {
max@0 194 typedef float T;
max@0 195 arma_fortran(arma_sgeev)(jobvl, jobvr, n, (T*)a, lda, (T*)wr, (T*)wi, (T*)vl, ldvl, (T*)vr, ldvr, (T*)work, lwork, info);
max@0 196 }
max@0 197 else
max@0 198 if(is_double<eT>::value == true)
max@0 199 {
max@0 200 typedef double T;
max@0 201 arma_fortran(arma_dgeev)(jobvl, jobvr, n, (T*)a, lda, (T*)wr, (T*)wi, (T*)vl, ldvl, (T*)vr, ldvr, (T*)work, lwork, info);
max@0 202 }
max@0 203 }
max@0 204
max@0 205
max@0 206 template<typename eT>
max@0 207 inline
max@0 208 void
max@0 209 cx_geev
max@0 210 (
max@0 211 char* jobvl, char* jobvr, blas_int* n,
max@0 212 eT* a, blas_int* lda, eT* w,
max@0 213 eT* vl, blas_int* ldvl,
max@0 214 eT* vr, blas_int* ldvr,
max@0 215 eT* work, blas_int* lwork, typename eT::value_type* rwork,
max@0 216 blas_int* info
max@0 217 )
max@0 218 {
max@0 219 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 220
max@0 221 if(is_supported_complex_float<eT>::value == true)
max@0 222 {
max@0 223 typedef float T;
max@0 224 typedef typename std::complex<T> cx_T;
max@0 225 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);
max@0 226 }
max@0 227 else
max@0 228 if(is_supported_complex_double<eT>::value == true)
max@0 229 {
max@0 230 typedef double T;
max@0 231 typedef typename std::complex<T> cx_T;
max@0 232 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);
max@0 233 }
max@0 234 }
max@0 235
max@0 236
max@0 237
max@0 238
max@0 239 template<typename eT>
max@0 240 inline
max@0 241 void
max@0 242 potrf(char* uplo, blas_int* n, eT* a, blas_int* lda, blas_int* info)
max@0 243 {
max@0 244 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 245
max@0 246 if(is_float<eT>::value == true)
max@0 247 {
max@0 248 typedef float T;
max@0 249 arma_fortran(arma_spotrf)(uplo, n, (T*)a, lda, info);
max@0 250 }
max@0 251 else
max@0 252 if(is_double<eT>::value == true)
max@0 253 {
max@0 254 typedef double T;
max@0 255 arma_fortran(arma_dpotrf)(uplo, n, (T*)a, lda, info);
max@0 256 }
max@0 257 else
max@0 258 if(is_supported_complex_float<eT>::value == true)
max@0 259 {
max@0 260 typedef std::complex<float> T;
max@0 261 arma_fortran(arma_cpotrf)(uplo, n, (T*)a, lda, info);
max@0 262 }
max@0 263 else
max@0 264 if(is_supported_complex_double<eT>::value == true)
max@0 265 {
max@0 266 typedef std::complex<double> T;
max@0 267 arma_fortran(arma_zpotrf)(uplo, n, (T*)a, lda, info);
max@0 268 }
max@0 269
max@0 270 }
max@0 271
max@0 272
max@0 273
max@0 274 template<typename eT>
max@0 275 inline
max@0 276 void
max@0 277 potri(char* uplo, blas_int* n, eT* a, blas_int* lda, blas_int* info)
max@0 278 {
max@0 279 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 280
max@0 281 if(is_float<eT>::value == true)
max@0 282 {
max@0 283 typedef float T;
max@0 284 arma_fortran(arma_spotri)(uplo, n, (T*)a, lda, info);
max@0 285 }
max@0 286 else
max@0 287 if(is_double<eT>::value == true)
max@0 288 {
max@0 289 typedef double T;
max@0 290 arma_fortran(arma_dpotri)(uplo, n, (T*)a, lda, info);
max@0 291 }
max@0 292 else
max@0 293 if(is_supported_complex_float<eT>::value == true)
max@0 294 {
max@0 295 typedef std::complex<float> T;
max@0 296 arma_fortran(arma_cpotri)(uplo, n, (T*)a, lda, info);
max@0 297 }
max@0 298 else
max@0 299 if(is_supported_complex_double<eT>::value == true)
max@0 300 {
max@0 301 typedef std::complex<double> T;
max@0 302 arma_fortran(arma_zpotri)(uplo, n, (T*)a, lda, info);
max@0 303 }
max@0 304
max@0 305 }
max@0 306
max@0 307
max@0 308
max@0 309 template<typename eT>
max@0 310 inline
max@0 311 void
max@0 312 geqrf(blas_int* m, blas_int* n, eT* a, blas_int* lda, eT* tau, eT* work, blas_int* lwork, blas_int* info)
max@0 313 {
max@0 314 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 315
max@0 316 if(is_float<eT>::value == true)
max@0 317 {
max@0 318 typedef float T;
max@0 319 arma_fortran(arma_sgeqrf)(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork, info);
max@0 320 }
max@0 321 else
max@0 322 if(is_double<eT>::value == true)
max@0 323 {
max@0 324 typedef double T;
max@0 325 arma_fortran(arma_dgeqrf)(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork, info);
max@0 326 }
max@0 327 else
max@0 328 if(is_supported_complex_float<eT>::value == true)
max@0 329 {
max@0 330 typedef std::complex<float> T;
max@0 331 arma_fortran(arma_cgeqrf)(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork, info);
max@0 332 }
max@0 333 else
max@0 334 if(is_supported_complex_double<eT>::value == true)
max@0 335 {
max@0 336 typedef std::complex<double> T;
max@0 337 arma_fortran(arma_zgeqrf)(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork, info);
max@0 338 }
max@0 339
max@0 340 }
max@0 341
max@0 342
max@0 343
max@0 344 template<typename eT>
max@0 345 inline
max@0 346 void
max@0 347 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)
max@0 348 {
max@0 349 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 350
max@0 351 if(is_float<eT>::value == true)
max@0 352 {
max@0 353 typedef float T;
max@0 354 arma_fortran(arma_sorgqr)(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwork, info);
max@0 355 }
max@0 356 else
max@0 357 if(is_double<eT>::value == true)
max@0 358 {
max@0 359 typedef double T;
max@0 360 arma_fortran(arma_dorgqr)(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwork, info);
max@0 361 }
max@0 362 }
max@0 363
max@0 364
max@0 365
max@0 366 template<typename eT>
max@0 367 inline
max@0 368 void
max@0 369 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)
max@0 370 {
max@0 371 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 372
max@0 373 if(is_supported_complex_float<eT>::value == true)
max@0 374 {
max@0 375 typedef float T;
max@0 376 arma_fortran(arma_cungqr)(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwork, info);
max@0 377 }
max@0 378 else
max@0 379 if(is_supported_complex_double<eT>::value == true)
max@0 380 {
max@0 381 typedef double T;
max@0 382 arma_fortran(arma_zungqr)(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwork, info);
max@0 383 }
max@0 384 }
max@0 385
max@0 386
max@0 387 template<typename eT>
max@0 388 inline
max@0 389 void
max@0 390 gesvd
max@0 391 (
max@0 392 char* jobu, char* jobvt, blas_int* m, blas_int* n, eT* a, blas_int* lda,
max@0 393 eT* s, eT* u, blas_int* ldu, eT* vt, blas_int* ldvt,
max@0 394 eT* work, blas_int* lwork, blas_int* info
max@0 395 )
max@0 396 {
max@0 397 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 398
max@0 399 if(is_float<eT>::value == true)
max@0 400 {
max@0 401 typedef float T;
max@0 402 arma_fortran(arma_sgesvd)(jobu, jobvt, m, n, (T*)a, lda, (T*)s, (T*)u, ldu, (T*)vt, ldvt, (T*)work, lwork, info);
max@0 403 }
max@0 404 else
max@0 405 if(is_double<eT>::value == true)
max@0 406 {
max@0 407 typedef double T;
max@0 408 arma_fortran(arma_dgesvd)(jobu, jobvt, m, n, (T*)a, lda, (T*)s, (T*)u, ldu, (T*)vt, ldvt, (T*)work, lwork, info);
max@0 409 }
max@0 410 }
max@0 411
max@0 412
max@0 413
max@0 414 template<typename T>
max@0 415 inline
max@0 416 void
max@0 417 cx_gesvd
max@0 418 (
max@0 419 char* jobu, char* jobvt, blas_int* m, blas_int* n, std::complex<T>* a, blas_int* lda,
max@0 420 T* s, std::complex<T>* u, blas_int* ldu, std::complex<T>* vt, blas_int* ldvt,
max@0 421 std::complex<T>* work, blas_int* lwork, T* rwork, blas_int* info
max@0 422 )
max@0 423 {
max@0 424 arma_type_check(( is_supported_blas_type<T>::value == false ));
max@0 425 arma_type_check(( is_supported_blas_type< std::complex<T> >::value == false ));
max@0 426
max@0 427 if(is_float<T>::value == true)
max@0 428 {
max@0 429 typedef float bT;
max@0 430 arma_fortran(arma_cgesvd)
max@0 431 (
max@0 432 jobu, jobvt, m, n, (std::complex<bT>*)a, lda,
max@0 433 (bT*)s, (std::complex<bT>*)u, ldu, (std::complex<bT>*)vt, ldvt,
max@0 434 (std::complex<bT>*)work, lwork, (bT*)rwork, info
max@0 435 );
max@0 436 }
max@0 437 else
max@0 438 if(is_double<T>::value == true)
max@0 439 {
max@0 440 typedef double bT;
max@0 441 arma_fortran(arma_zgesvd)
max@0 442 (
max@0 443 jobu, jobvt, m, n, (std::complex<bT>*)a, lda,
max@0 444 (bT*)s, (std::complex<bT>*)u, ldu, (std::complex<bT>*)vt, ldvt,
max@0 445 (std::complex<bT>*)work, lwork, (bT*)rwork, info
max@0 446 );
max@0 447 }
max@0 448 }
max@0 449
max@0 450
max@0 451
max@0 452 template<typename eT>
max@0 453 inline
max@0 454 void
max@0 455 gesv(blas_int* n, blas_int* nrhs, eT* a, blas_int* lda, blas_int* ipiv, eT* b, blas_int* ldb, blas_int* info)
max@0 456 {
max@0 457 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 458
max@0 459 if(is_float<eT>::value == true)
max@0 460 {
max@0 461 typedef float T;
max@0 462 arma_fortran(arma_sgesv)(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info);
max@0 463 }
max@0 464 else
max@0 465 if(is_double<eT>::value == true)
max@0 466 {
max@0 467 typedef double T;
max@0 468 arma_fortran(arma_dgesv)(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info);
max@0 469 }
max@0 470 else
max@0 471 if(is_supported_complex_float<eT>::value == true)
max@0 472 {
max@0 473 typedef std::complex<float> T;
max@0 474 arma_fortran(arma_cgesv)(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info);
max@0 475 }
max@0 476 else
max@0 477 if(is_supported_complex_double<eT>::value == true)
max@0 478 {
max@0 479 typedef std::complex<double> T;
max@0 480 arma_fortran(arma_zgesv)(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info);
max@0 481 }
max@0 482 }
max@0 483
max@0 484
max@0 485
max@0 486 template<typename eT>
max@0 487 inline
max@0 488 void
max@0 489 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)
max@0 490 {
max@0 491 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 492
max@0 493 if(is_float<eT>::value == true)
max@0 494 {
max@0 495 typedef float T;
max@0 496 arma_fortran(arma_sgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)work, lwork, info);
max@0 497 }
max@0 498 else
max@0 499 if(is_double<eT>::value == true)
max@0 500 {
max@0 501 typedef double T;
max@0 502 arma_fortran(arma_dgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)work, lwork, info);
max@0 503 }
max@0 504 else
max@0 505 if(is_supported_complex_float<eT>::value == true)
max@0 506 {
max@0 507 typedef std::complex<float> T;
max@0 508 arma_fortran(arma_cgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)work, lwork, info);
max@0 509 }
max@0 510 else
max@0 511 if(is_supported_complex_double<eT>::value == true)
max@0 512 {
max@0 513 typedef std::complex<double> T;
max@0 514 arma_fortran(arma_zgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (T*)work, lwork, info);
max@0 515 }
max@0 516 }
max@0 517
max@0 518
max@0 519
max@0 520 template<typename eT>
max@0 521 inline
max@0 522 void
max@0 523 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)
max@0 524 {
max@0 525 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 526
max@0 527 if(is_float<eT>::value == true)
max@0 528 {
max@0 529 typedef float T;
max@0 530 arma_fortran(arma_strtrs)(uplo, trans, diag, n, nrhs, (T*)a, lda, (T*)b, ldb, info);
max@0 531 }
max@0 532 else
max@0 533 if(is_double<eT>::value == true)
max@0 534 {
max@0 535 typedef double T;
max@0 536 arma_fortran(arma_dtrtrs)(uplo, trans, diag, n, nrhs, (T*)a, lda, (T*)b, ldb, info);
max@0 537 }
max@0 538 else
max@0 539 if(is_supported_complex_float<eT>::value == true)
max@0 540 {
max@0 541 typedef std::complex<float> T;
max@0 542 arma_fortran(arma_ctrtrs)(uplo, trans, diag, n, nrhs, (T*)a, lda, (T*)b, ldb, info);
max@0 543 }
max@0 544 else
max@0 545 if(is_supported_complex_double<eT>::value == true)
max@0 546 {
max@0 547 typedef std::complex<double> T;
max@0 548 arma_fortran(arma_ztrtrs)(uplo, trans, diag, n, nrhs, (T*)a, lda, (T*)b, ldb, info);
max@0 549 }
max@0 550 }
max@0 551
max@0 552
max@0 553
max@0 554 template<typename eT>
max@0 555 inline
max@0 556 void
max@0 557 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)
max@0 558 {
max@0 559 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 560
max@0 561 if(is_float<eT>::value == true)
max@0 562 {
max@0 563 typedef float T;
max@0 564 arma_fortran(arma_sgees)(jobvs, sort, select, n, (T*)a, lda, sdim, (T*)wr, (T*)wi, (T*)vs, ldvs, (T*)work, lwork, bwork, info);
max@0 565 }
max@0 566 else
max@0 567 if(is_double<eT>::value == true)
max@0 568 {
max@0 569 typedef double T;
max@0 570 arma_fortran(arma_dgees)(jobvs, sort, select, n, (T*)a, lda, sdim, (T*)wr, (T*)wi, (T*)vs, ldvs, (T*)work, lwork, bwork, info);
max@0 571 }
max@0 572 }
max@0 573
max@0 574
max@0 575
max@0 576 template<typename T>
max@0 577 inline
max@0 578 void
max@0 579 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)
max@0 580 {
max@0 581 arma_type_check(( is_supported_blas_type<T>::value == false ));
max@0 582 arma_type_check(( is_supported_blas_type< std::complex<T> >::value == false ));
max@0 583
max@0 584 if(is_float<T>::value == true)
max@0 585 {
max@0 586 typedef float bT;
max@0 587 typedef std::complex<bT> cT;
max@0 588 arma_fortran(arma_cgees)(jobvs, sort, select, n, (cT*)a, lda, sdim, (cT*)w, (cT*)vs, ldvs, (cT*)work, lwork, (bT*)rwork, bwork, info);
max@0 589 }
max@0 590 else
max@0 591 if(is_double<T>::value == true)
max@0 592 {
max@0 593 typedef double bT;
max@0 594 typedef std::complex<bT> cT;
max@0 595 arma_fortran(arma_zgees)(jobvs, sort, select, n, (cT*)a, lda, sdim, (cT*)w, (cT*)vs, ldvs, (cT*)work, lwork, (bT*)rwork, bwork, info);
max@0 596 }
max@0 597 }
max@0 598
max@0 599
max@0 600
max@0 601 template<typename eT>
max@0 602 inline
max@0 603 void
max@0 604 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)
max@0 605 {
max@0 606 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 607
max@0 608 if(is_float<eT>::value == true)
max@0 609 {
max@0 610 typedef float T;
max@0 611 arma_fortran(arma_strsyl)(transa, transb, isgn, m, n, (T*)a, lda, (T*)b, ldb, (T*)c, ldc, (T*)scale, info);
max@0 612 }
max@0 613 else
max@0 614 if(is_double<eT>::value == true)
max@0 615 {
max@0 616 typedef double T;
max@0 617 arma_fortran(arma_dtrsyl)(transa, transb, isgn, m, n, (T*)a, lda, (T*)b, ldb, (T*)c, ldc, (T*)scale, info);
max@0 618 }
max@0 619 else
max@0 620 if(is_supported_complex_float<eT>::value == true)
max@0 621 {
max@0 622 typedef std::complex<float> T;
max@0 623 arma_fortran(arma_ctrsyl)(transa, transb, isgn, m, n, (T*)a, lda, (T*)b, ldb, (T*)c, ldc, (float*)scale, info);
max@0 624 }
max@0 625 else
max@0 626 if(is_supported_complex_double<eT>::value == true)
max@0 627 {
max@0 628 typedef std::complex<double> T;
max@0 629 arma_fortran(arma_ztrsyl)(transa, transb, isgn, m, n, (T*)a, lda, (T*)b, ldb, (T*)c, ldc, (double*)scale, info);
max@0 630 }
max@0 631 }
max@0 632
max@0 633
max@0 634 template<typename eT>
max@0 635 inline
max@0 636 void
max@0 637 sytrf(char* uplo, blas_int* n, eT* a, blas_int* lda, blas_int* ipiv, eT* work, blas_int* lwork, blas_int* info)
max@0 638 {
max@0 639 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 640
max@0 641 if(is_float<eT>::value == true)
max@0 642 {
max@0 643 typedef float T;
max@0 644 arma_fortran(arma_ssytrf)(uplo, n, (T*)a, lda, ipiv, (T*)work, lwork, info);
max@0 645 }
max@0 646 else
max@0 647 if(is_double<eT>::value == true)
max@0 648 {
max@0 649 typedef double T;
max@0 650 arma_fortran(arma_dsytrf)(uplo, n, (T*)a, lda, ipiv, (T*)work, lwork, info);
max@0 651 }
max@0 652 else
max@0 653 if(is_supported_complex_float<eT>::value == true)
max@0 654 {
max@0 655 typedef std::complex<float> T;
max@0 656 arma_fortran(arma_csytrf)(uplo, n, (T*)a, lda, ipiv, (T*)work, lwork, info);
max@0 657 }
max@0 658 else
max@0 659 if(is_supported_complex_double<eT>::value == true)
max@0 660 {
max@0 661 typedef std::complex<double> T;
max@0 662 arma_fortran(arma_zsytrf)(uplo, n, (T*)a, lda, ipiv, (T*)work, lwork, info);
max@0 663 }
max@0 664 }
max@0 665
max@0 666
max@0 667 template<typename eT>
max@0 668 inline
max@0 669 void
max@0 670 sytri(char* uplo, blas_int* n, eT* a, blas_int* lda, blas_int* ipiv, eT* work, blas_int* info)
max@0 671 {
max@0 672 arma_type_check(( is_supported_blas_type<eT>::value == false ));
max@0 673
max@0 674 if(is_float<eT>::value == true)
max@0 675 {
max@0 676 typedef float T;
max@0 677 arma_fortran(arma_ssytri)(uplo, n, (T*)a, lda, ipiv, (T*)work, info);
max@0 678 }
max@0 679 else
max@0 680 if(is_double<eT>::value == true)
max@0 681 {
max@0 682 typedef double T;
max@0 683 arma_fortran(arma_dsytri)(uplo, n, (T*)a, lda, ipiv, (T*)work, info);
max@0 684 }
max@0 685 else
max@0 686 if(is_supported_complex_float<eT>::value == true)
max@0 687 {
max@0 688 typedef std::complex<float> T;
max@0 689 arma_fortran(arma_csytri)(uplo, n, (T*)a, lda, ipiv, (T*)work, info);
max@0 690 }
max@0 691 else
max@0 692 if(is_supported_complex_double<eT>::value == true)
max@0 693 {
max@0 694 typedef std::complex<double> T;
max@0 695 arma_fortran(arma_zsytri)(uplo, n, (T*)a, lda, ipiv, (T*)work, info);
max@0 696 }
max@0 697 }
max@0 698
max@0 699
max@0 700 }
max@0 701
max@0 702
max@0 703 #endif