// // ZQUATEV: Diagonalization of quaternionic matrices // File : f77.h // Copyright (c) 2013, Toru Shiozaki (shiozaki@northwestern.edu) // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // The views and conclusions contained in the software and documentation are those // of the authors and should not be interpreted as representing official policies, // either expressed or implied, of the FreeBSD Project. // #ifndef __TS_ZQUATEV_F77_H #define __TS_ZQUATEV_F77_H #include #include // blas extern "C" { void zscal_(const int*, const std::complex*, std::complex*, const int*); void zdotc_(std::complex*, const int*, const std::complex*, const int*, const std::complex*, const int*); void zaxpy_(const int*, const std::complex*, const std::complex*, const int*, std::complex*, const int*); void zgemv_(const char*, const int*, const int*, const std::complex*, const std::complex*, const int*, const std::complex*, const int*, const std::complex*, std::complex*, const int*); void ztrmv_(const char*, const char*, const char*, const int*, const std::complex*, const int*, std::complex*, const int*); #ifdef HAVE_ZGEMM3M void zgemm3m_(const char* transa, const char* transb, const int* m, const int* n, const int* k, const std::complex* alpha, const std::complex* a, const int* lda, const std::complex* b, const int* ldb, const std::complex* beta, std::complex* c, const int* ldc); #else void zgemm_(const char* transa, const char* transb, const int* m, const int* n, const int* k, const std::complex* alpha, const std::complex* a, const int* lda, const std::complex* b, const int* ldb, const std::complex* beta, std::complex* c, const int* ldc); #endif void zrot_(const int*, std::complex*, const int*, std::complex*, const int*, const double*, const std::complex*); void zgerc_(const int*, const int*, const std::complex*, const std::complex*, const int*, const std::complex*, const int*, std::complex*, const int*); void zgeru_(const int*, const int*, const std::complex*, const std::complex*, const int*, const std::complex*, const int*, std::complex*, const int*); // lapack void zheev_(const char*, const char*, const int*, std::complex*, const int*, double*, std::complex*, const int*, double*, int*); void zhbev_(const char*, const char*, const int*, const int*, std::complex*, const int*, double*, std::complex*, const int*, std::complex*, double*, int*); void zlartg_(const std::complex*, const std::complex*, double*, std::complex*, std::complex*); void zlarfg_(const int*, const std::complex*, std::complex*, const int*, std::complex*); } namespace { void zgemv_(const char* a, const int b, const int c, const std::complex& d, const std::complex* e, const int f, const std::complex* g, const int h, const std::complex& i, std::complex* j, const int k) { ::zgemv_(a,&b,&c,&d,e,&f,g,&h,&i,j,&k); } void ztrmv_(const char* a, const char* b, const char* c, const int d, const std::complex* e, const int f, std::complex* g, const int h) { ::ztrmv_(a,b,c,&d,e,&f,g,&h); } #ifdef HAVE_ZGEMM3M void zgemm3m_(const char* transa, const char* transb, const int m, const int n, const int k, const std::complex& alpha, const std::complex* a, const int lda, const std::complex* b, const int ldb, const std::complex& beta, std::complex* c, const int ldc) { ::zgemm3m_(transa,transb,&m,&n,&k,&alpha,a,&lda,b,&ldb,&beta,c,&ldc); } #else void zgemm3m_(const char* transa, const char* transb, const int m, const int n, const int k, const std::complex alpha, const std::complex* a, const int lda, const std::complex* b, const int ldb, const std::complex beta, std::complex* c, const int ldc) { ::zgemm_(transa,transb,&m,&n,&k,&alpha,a,&lda,b,&ldb,&beta,c,&ldc); } #endif void zaxpy_(const int a, const std::complex& b, const std::complex* c, const int d, std::complex* e, const int f) { ::zaxpy_(&a,&b,c,&d,e,&f); } void zscal_(const int a, const std::complex& b, std::complex* c, const int d) { ::zscal_(&a, &b, c, &d); } std::complex zdotc_(const int b, const std::complex* c, const int d, const std::complex* e, const int f) { std::complex a; ::zdotc_(&a,&b,c,&d,e,&f); return a; } void zheev_(const char* a, const char* b, const int c, std::complex* d, const int e, double* f, std::complex* g, const int h, double* i, int& j) { ::zheev_(a,b,&c,d,&e,f,g,&h,i,&j); } void zhbev_(const char* a, const char* b, const int c, const int d, std::complex* e, const int f, double* g, std::complex* h, const int i, std::complex* j, double* k, int& l) { ::zhbev_(a, b, &c, &d, e, &f, g, h, &i, j, k, &l); } void zrot_(const int a, std::complex* b, const int c, std::complex* d, const int e, const double f, const std::complex& g) { ::zrot_(&a, b, &c, d, &e, &f, &g); } void zgerc_(const int a, const int b, const std::complex& c, const std::complex* d, const int e, const std::complex* f, const int g, std::complex* h, const int i) { ::zgerc_(&a, &b, &c, d, &e, f, &g, h, &i); } void zgeru_(const int a, const int b, const std::complex& c, const std::complex* d, const int e, const std::complex* f, const int g, std::complex* h, const int i) { ::zgeru_(&a, &b, &c, d, &e, f, &g, h, &i); } void zlartg_(const std::complex& a, const std::complex& b, double& c, std::complex& d, std::complex& e) { ::zlartg_(&a, &b, &c, &d, &e); } void zlarfg_(const int a, std::complex& b, std::complex* c, const int d, std::complex& e) { ::zlarfg_(&a, &b, c, &d, &e); } } #endif