27#ifndef _TEUCHOS_BLAS_HPP_
28#define _TEUCHOS_BLAS_HPP_
41#include "Teuchos_Assert.hpp"
77 extern TEUCHOSNUMERICS_LIB_DLL_EXPORT
const char ESideChar[];
78 extern TEUCHOSNUMERICS_LIB_DLL_EXPORT
const char ETranspChar[];
79 extern TEUCHOSNUMERICS_LIB_DLL_EXPORT
const char EUploChar[];
80 extern TEUCHOSNUMERICS_LIB_DLL_EXPORT
const char EDiagChar[];
81 extern TEUCHOSNUMERICS_LIB_DLL_EXPORT
const char ETypeChar[];
85 template<
typename ScalarType,
96 template<
typename OrdinalType,
typename ScalarType>
122 typedef typename details::GivensRotator<ScalarType>::c_type
rotg_c_type;
137 template <
typename alpha_type,
typename x_type>
144 template <
typename x_type,
typename y_type>
158 template <
typename alpha_type,
typename A_type,
typename x_type,
typename beta_type>
163 template <
typename A_type>
169 template <
typename alpha_type,
typename x_type,
typename y_type>
183 template <
typename alpha_type,
typename A_type,
typename B_type,
typename beta_type>
184 void GEMM(
ETransp transa,
ETransp transb,
const OrdinalType&
m,
const OrdinalType& n,
const OrdinalType&
k,
const alpha_type alpha,
const A_type*
A,
const OrdinalType&
lda,
const B_type*
B,
const OrdinalType&
ldb,
const beta_type beta,
ScalarType* C,
const OrdinalType&
ldc)
const;
192 template <
typename alpha_type,
typename A_type,
typename B_type,
typename beta_type>
193 void SYMM(
ESide side,
EUplo uplo,
const OrdinalType&
m,
const OrdinalType& n,
const alpha_type alpha,
const A_type*
A,
const OrdinalType&
lda,
const B_type*
B,
const OrdinalType&
ldb,
const beta_type beta,
ScalarType* C,
const OrdinalType&
ldc)
const;
196 template <
typename alpha_type,
typename A_type,
typename beta_type>
200 template <
typename alpha_type,
typename A_type>
205 template <
typename alpha_type,
typename A_type>
211 template<
typename OrdinalType,
typename ScalarType>
246 template<
typename ScalarType,
bool isComplex>
250 blas_dabs1(
const ScalarType* a,
typename ScalarTraits<ScalarType>::magnitudeType* ret)
const;
254 template<
typename ScalarType>
255 class MagValue<ScalarType, true> {
258 blas_dabs1(
const ScalarType* a,
typename ScalarTraits<ScalarType>::magnitudeType* ret)
const;
262 template<
typename ScalarType>
263 class MagValue<ScalarType, false> {
266 blas_dabs1(
const ScalarType* a, ScalarType* ret)
const;
269 template<
typename ScalarType,
bool isComplex>
270 class GivensRotator {};
273 template<
typename ScalarType>
274 class GivensRotator<ScalarType, true> {
276 typedef typename ScalarTraits<ScalarType>::magnitudeType c_type;
278 ROTG (ScalarType* ca,
280 typename ScalarTraits<ScalarType>::magnitudeType* c,
281 ScalarType* s)
const;
285 template<
typename ScalarType>
286 class GivensRotator<ScalarType, false> {
288 typedef ScalarType c_type;
290 ROTG (ScalarType* da,
293 ScalarType* s)
const;
307 ScalarType SIGN (
const ScalarType& x,
const ScalarType& y)
const {
308 typedef ScalarTraits<ScalarType> STS;
310 if (y > STS::zero()) {
311 return STS::magnitude (x);
312 }
else if (y < STS::zero()) {
313 return -STS::magnitude (x);
326 ScalarType signedInfinity = STS::one() / y;
327 if (signedInfinity > STS::zero()) {
328 return STS::magnitude (x);
333 return -STS::magnitude (x);
340 template<
typename ScalarType>
342 GivensRotator<ScalarType, true>::
343 ROTG (ScalarType* ca,
345 typename ScalarTraits<ScalarType>::magnitudeType* c,
348 typedef ScalarTraits<ScalarType> STS;
349 typedef typename STS::magnitudeType MagnitudeType;
350 typedef ScalarTraits<MagnitudeType> STM;
369 MagnitudeType norm, scale;
371 if (STS::magnitude (*ca) == STM::zero()) {
376 scale = STS::magnitude (*ca) + STS::magnitude (*cb);
380 const MagnitudeType ca_scaled =
381 STS::magnitude (*ca / ScalarType(scale, STM::zero()));
382 const MagnitudeType cb_scaled =
383 STS::magnitude (*cb / ScalarType(scale, STM::zero()));
385 STM::squareroot (ca_scaled*ca_scaled + cb_scaled*cb_scaled);
387 alpha = *ca / STS::magnitude (*ca);
388 *c = STS::magnitude (*ca) / norm;
389 *s = alpha * STS::conjugate (*cb) / norm;
395 template<
typename ScalarType>
397 GivensRotator<ScalarType, false>::
398 ROTG (ScalarType* da,
403 typedef ScalarTraits<ScalarType> STS;
426 ScalarType r, roe, scale, z;
429 if (STS::magnitude (*da) > STS::magnitude (*db)) {
432 scale = STS::magnitude (*da) + STS::magnitude (*db);
433 if (scale == STS::zero()) {
442 const ScalarType da_scaled = *da / scale;
443 const ScalarType db_scaled = *db / scale;
444 r = scale * STS::squareroot (da_scaled*da_scaled + db_scaled*db_scaled);
445 r = SIGN (STS::one(), roe) * r;
449 if (STS::magnitude (*da) > STS::magnitude (*db)) {
452 if (STS::magnitude (*db) >= STS::magnitude (*da) && *c != STS::zero()) {
462 template<
typename ScalarType>
464 MagValue<ScalarType, false>::
465 blas_dabs1(
const ScalarType* a, ScalarType* ret)
const
471 template<
typename ScalarType>
473 MagValue<ScalarType, true>::
474 blas_dabs1(
const ScalarType* a,
typename ScalarTraits<ScalarType>::magnitudeType* ret)
const
476 *ret = ScalarTraits<typename ScalarTraits<ScalarType>::magnitudeType>::magnitude(a->real());
477 *ret += ScalarTraits<typename ScalarTraits<ScalarType>::magnitudeType>::magnitude(a->imag());
482 template<
typename OrdinalType,
typename ScalarType>
490 details::GivensRotator<ScalarType>
rotator;
494 template<
typename OrdinalType,
typename ScalarType>
521 template<
typename OrdinalType,
typename ScalarType>
539 template<
typename OrdinalType,
typename ScalarType>
559 template<
typename OrdinalType,
typename ScalarType>
560 template <
typename alpha_type,
typename x_type>
581 template<
typename OrdinalType,
typename ScalarType>
593 details::MagValue<ScalarType, ScalarTraits<ScalarType>::isComplex>
mval;
604 template<
typename OrdinalType,
typename ScalarType>
605 template <
typename x_type,
typename y_type>
628 template<
typename OrdinalType,
typename ScalarType>
649 template<
typename OrdinalType,
typename ScalarType>
663 details::MagValue<ScalarType, ScalarTraits<ScalarType>::isComplex>
mval;
684 template<
typename OrdinalType,
typename ScalarType>
685 template <
typename alpha_type,
typename A_type,
typename x_type,
typename beta_type>
686 void DefaultBLASImpl<OrdinalType, ScalarType>::GEMV(
ETransp trans,
const OrdinalType&
m,
const OrdinalType& n,
const alpha_type alpha,
const A_type*
A,
const OrdinalType&
lda,
const x_type* x,
const OrdinalType&
incx,
const beta_type beta,
ScalarType*
y,
const OrdinalType&
incy)
const
703 std::cout <<
"BLAS::GEMV Error: M == " <<
m << std::endl;
707 std::cout <<
"BLAS::GEMV Error: N == " << n << std::endl;
711 std::cout <<
"BLAS::GEMV Error: LDA < MAX(1,M)"<< std::endl;
715 std::cout <<
"BLAS::GEMV Error: INCX == 0"<< std::endl;
719 std::cout <<
"BLAS::GEMV Error: INCY == 0"<< std::endl;
729 if(ETranspChar[
trans] ==
'N') {
771 if( ETranspChar[
trans] ==
'N' ) {
837 template<
typename OrdinalType,
typename ScalarType>
838 template <
typename A_type>
848 if( n ==
izero ){
return; }
852 std::cout <<
"BLAS::TRMV Error: N == " << n << std::endl;
856 std::cout <<
"BLAS::TRMV Error: LDA < MAX(1,N)"<< std::endl;
860 std::cout <<
"BLAS::TRMV Error: INCX == 0"<< std::endl;
876 if (ETranspChar[
trans] ==
'N') {
878 if (EUploChar[
uplo] ==
'U') {
939 if (EUploChar[
uplo]==
'U') {
1032 template<
typename OrdinalType,
typename ScalarType>
1033 template <
typename alpha_type,
typename x_type,
typename y_type>
1047 std::cout <<
"BLAS::GER Error: M == " <<
m << std::endl;
1051 std::cout <<
"BLAS::GER Error: N == " << n << std::endl;
1055 std::cout <<
"BLAS::GER Error: LDA < MAX(1,M)"<< std::endl;
1059 std::cout <<
"BLAS::GER Error: INCX == 0"<< std::endl;
1063 std::cout <<
"BLAS::GER Error: INCY == 0"<< std::endl;
1107 template<
typename OrdinalType,
typename ScalarType>
1108 template <
typename alpha_type,
typename A_type,
typename B_type,
typename beta_type>
1109 void DefaultBLASImpl<OrdinalType, ScalarType>::GEMM(
ETransp transa,
ETransp transb,
const OrdinalType&
m,
const OrdinalType& n,
const OrdinalType&
k,
const alpha_type alpha,
const A_type*
A,
const OrdinalType&
lda,
const B_type*
B,
const OrdinalType&
ldb,
const beta_type beta,
ScalarType* C,
const OrdinalType&
ldc)
const
1125 if( !(ETranspChar[
transa]==
'N') ) {
1128 if( !(ETranspChar[
transb]==
'N') ) {
1135 std::cout <<
"BLAS::GEMM Error: M == " <<
m << std::endl;
1139 std::cout <<
"BLAS::GEMM Error: N == " << n << std::endl;
1143 std::cout <<
"BLAS::GEMM Error: K == " <<
k << std::endl;
1147 std::cout <<
"BLAS::GEMM Error: LDA < "<<
NRowA<<std::endl;
1151 std::cout <<
"BLAS::GEMM Error: LDB < "<<
NRowB<<std::endl;
1155 std::cout <<
"BLAS::GEMM Error: LDC < MAX(1,M)"<< std::endl;
1185 if ( ETranspChar[
transb]==
'N' ) {
1186 if ( ETranspChar[
transa]==
'N' ) {
1207 }
else if (
conjA ) {
1238 }
else if ( ETranspChar[
transa]==
'N' ) {
1282 }
else if (
conjA ) {
1354 template<
typename OrdinalType,
typename ScalarType>
1364 for (
int i = 0;
i < n; ++
i) {
1381 for (
int i = 1;
i <= n; ++
i) {
1383 x[
ix - 1] =
y[
iy - 1];
1391 template<
typename OrdinalType,
typename ScalarType>
1392 template <
typename alpha_type,
typename A_type,
typename B_type,
typename beta_type>
1393 void DefaultBLASImpl<OrdinalType, ScalarType>::SYMM(
ESide side,
EUplo uplo,
const OrdinalType&
m,
const OrdinalType& n,
const alpha_type alpha,
const A_type*
A,
const OrdinalType&
lda,
const B_type*
B,
const OrdinalType&
ldb,
const beta_type beta,
ScalarType* C,
const OrdinalType&
ldc)
const
1405 if (ESideChar[
side] ==
'R') {
NRowA = n; }
1410 std::cout <<
"BLAS::SYMM Error: M == "<<
m << std::endl;
1413 std::cout <<
"BLAS::SYMM Error: N == "<< n << std::endl;
1416 std::cout <<
"BLAS::SYMM Error: LDA < "<<
NRowA<<std::endl;
1419 std::cout <<
"BLAS::SYMM Error: LDB < MAX(1,M)"<<std::endl;
1422 std::cout <<
"BLAS::SYMM Error: LDC < MAX(1,M)"<<std::endl;
1445 if ( ESideChar[
side] ==
'L') {
1521 template<
typename OrdinalType,
typename ScalarType>
1522 template <
typename alpha_type,
typename A_type,
typename beta_type>
1523 void DefaultBLASImpl<OrdinalType, ScalarType>::SYRK(
EUplo uplo,
ETransp trans,
const OrdinalType& n,
const OrdinalType&
k,
const alpha_type alpha,
const A_type*
A,
const OrdinalType&
lda,
const beta_type beta,
ScalarType* C,
const OrdinalType&
ldc)
const
1542 "Teuchos::BLAS<"<<OTNT::name()<<
","<<STNT::name()<<
">::SYRK()"
1543 " does not support CONJ_TRANS for complex data types."
1547 if( !(ETranspChar[
trans]==
'N') ) {
1552 if ( n==
izero ) {
return; }
1555 std::cout <<
"BLAS::SYRK Error: N == "<< n <<std::endl;
1558 std::cout <<
"BLAS::SYRK Error: K == "<<
k <<std::endl;
1561 std::cout <<
"BLAS::SYRK Error: LDA < "<<
NRowA<<std::endl;
1564 std::cout <<
"BLAS::SYRK Error: LDC < MAX(1,N)"<<std::endl;
1590 for (
i=
j;
i<n;
i++) {
1597 for (
i=
j;
i<n;
i++) {
1608 if ( ETranspChar[
trans]==
'N' ) {
1636 for (
i=
j;
i<n;
i++) {
1641 for (
i=
j;
i<n;
i++) {
1648 for (
i=
j;
i<n;
i++) {
1677 for (
i=
j;
i<n;
i++) {
1695 template<
typename OrdinalType,
typename ScalarType>
1696 template <
typename alpha_type,
typename A_type>
1697 void DefaultBLASImpl<OrdinalType, ScalarType>::TRMM(
ESide side,
EUplo uplo,
ETransp transa,
EDiag diag,
const OrdinalType&
m,
const OrdinalType& n,
const alpha_type alpha,
const A_type*
A,
const OrdinalType&
lda,
ScalarType*
B,
const OrdinalType&
ldb)
const
1718 std::cout <<
"BLAS::TRMM Error: M == "<<
m <<std::endl;
1721 std::cout <<
"BLAS::TRMM Error: N == "<< n <<std::endl;
1724 std::cout <<
"BLAS::TRMM Error: LDA < "<<
NRowA<<std::endl;
1727 std::cout <<
"BLAS::TRMM Error: LDB < MAX(1,M)"<<std::endl;
1746 if ( ETranspChar[
transa]==
'N' ) {
1827 if( ETranspChar[
transa] ==
'N' ) {
1928 template<
typename OrdinalType,
typename ScalarType>
1929 template <
typename alpha_type,
typename A_type>
1930 void DefaultBLASImpl<OrdinalType, ScalarType>::TRSM(
ESide side,
EUplo uplo,
ETransp transa,
EDiag diag,
const OrdinalType&
m,
const OrdinalType& n,
const alpha_type alpha,
const A_type*
A,
const OrdinalType&
lda,
ScalarType*
B,
const OrdinalType&
ldb)
const
1945 if (!(ESideChar[
side] ==
'L')) {
NRowA = n; }
1950 std::cout <<
"BLAS::TRSM Error: M == "<<
m<<std::endl;
1953 std::cout <<
"BLAS::TRSM Error: N == "<<n<<std::endl;
1956 std::cout <<
"BLAS::TRSM Error: LDA < "<<
NRowA<<std::endl;
1959 std::cout <<
"BLAS::TRSM Error: LDB < MAX(1,M)"<<std::endl;
1975 if(ESideChar[
side] ==
'L') {
1979 if(ETranspChar[
transa] ==
'N') {
1983 if(EUploChar[
uplo] ==
'U') {
2035 if(EUploChar[
uplo] ==
'U') {
2092 if (ETranspChar[
transa] ==
'N') {
2096 if(EUploChar[
uplo] ==
'U') {
2154 if(EUploChar[
uplo] ==
'U') {
2226 inline BLAS(
void) {}
2227 inline BLAS(
const BLAS<int, float>& ) {}
2228 inline virtual ~BLAS(
void) {}
2229 void ROTG(
float* da,
float* db,
float* c,
float* s)
const;
2230 void ROT(
const int& n,
float* dx,
const int& incx,
float* dy,
const int& incy,
float* c,
float* s)
const;
2231 float ASUM(
const int& n,
const float* x,
const int& incx)
const;
2232 void AXPY(
const int& n,
const float& alpha,
const float* x,
const int& incx,
float* y,
const int& incy)
const;
2233 void COPY(
const int& n,
const float* x,
const int& incx,
float* y,
const int& incy)
const;
2234 float DOT(
const int& n,
const float* x,
const int& incx,
const float* y,
const int& incy)
const;
2235 float NRM2(
const int& n,
const float* x,
const int& incx)
const;
2236 void SCAL(
const int& n,
const float& alpha,
float* x,
const int& incx)
const;
2237 int IAMAX(
const int& n,
const float* x,
const int& incx)
const;
2238 void GEMV(ETransp trans,
const int& m,
const int& n,
const float& alpha,
const float* A,
const int& lda,
const float* x,
const int& incx,
const float& beta,
float* y,
const int& incy)
const;
2239 void TRMV(EUplo uplo, ETransp trans, EDiag diag,
const int& n,
const float* A,
const int& lda,
float* x,
const int& incx)
const;
2240 void GER(
const int& m,
const int& n,
const float& alpha,
const float* x,
const int& incx,
const float* y,
const int& incy,
float* A,
const int& lda)
const;
2241 void GEMM(ETransp transa, ETransp transb,
const int& m,
const int& n,
const int& k,
const float& alpha,
const float* A,
const int& lda,
const float* B,
const int& ldb,
const float& beta,
float* C,
const int& ldc)
const;
2242 void SWAP(
const int& n,
float*
const x,
const int& incx,
float*
const y,
const int& incy)
const;
2243 void SYMM(ESide side, EUplo uplo,
const int& m,
const int& n,
const float& alpha,
const float* A,
const int& lda,
const float* B,
const int& ldb,
const float& beta,
float* C,
const int& ldc)
const;
2244 void SYRK(EUplo uplo, ETransp trans,
const int& n,
const int& k,
const float& alpha,
const float* A,
const int& lda,
const float& beta,
float* C,
const int& ldc)
const;
2245 void HERK(EUplo uplo, ETransp trans,
const int& n,
const int& k,
const float& alpha,
const float* A,
const int& lda,
const float& beta,
float* C,
const int& ldc)
const;
2246 void TRMM(ESide side, EUplo uplo, ETransp transa, EDiag diag,
const int& m,
const int& n,
const float& alpha,
const float* A,
const int& lda,
float* B,
const int& ldb)
const;
2247 void TRSM(ESide side, EUplo uplo, ETransp transa, EDiag diag,
const int& m,
const int& n,
const float& alpha,
const float* A,
const int& lda,
float* B,
const int& ldb)
const;
2253 class TEUCHOSNUMERICS_LIB_DLL_EXPORT BLAS<int, double>
2256 inline BLAS(
void) {}
2257 inline BLAS(
const BLAS<int, double>& ) {}
2258 inline virtual ~BLAS(
void) {}
2259 void ROTG(
double* da,
double* db,
double* c,
double* s)
const;
2260 void ROT(
const int& n,
double* dx,
const int& incx,
double* dy,
const int& incy,
double* c,
double* s)
const;
2261 double ASUM(
const int& n,
const double* x,
const int& incx)
const;
2262 void AXPY(
const int& n,
const double& alpha,
const double* x,
const int& incx,
double* y,
const int& incy)
const;
2263 void COPY(
const int& n,
const double* x,
const int& incx,
double* y,
const int& incy)
const;
2264 double DOT(
const int& n,
const double* x,
const int& incx,
const double* y,
const int& incy)
const;
2265 double NRM2(
const int& n,
const double* x,
const int& incx)
const;
2266 void SCAL(
const int& n,
const double& alpha,
double* x,
const int& incx)
const;
2267 int IAMAX(
const int& n,
const double* x,
const int& incx)
const;
2268 void GEMV(ETransp trans,
const int& m,
const int& n,
const double& alpha,
const double* A,
const int& lda,
const double* x,
const int& incx,
const double& beta,
double* y,
const int& incy)
const;
2269 void TRMV(EUplo uplo, ETransp trans, EDiag diag,
const int& n,
const double* A,
const int& lda,
double* x,
const int& incx)
const;
2270 void GER(
const int& m,
const int& n,
const double& alpha,
const double* x,
const int& incx,
const double* y,
const int& incy,
double* A,
const int& lda)
const;
2271 void GEMM(ETransp transa, ETransp transb,
const int& m,
const int& n,
const int& k,
const double& alpha,
const double* A,
const int& lda,
const double* B,
const int& ldb,
const double& beta,
double* C,
const int& ldc)
const;
2272 void SWAP(
const int& n,
double*
const x,
const int& incx,
double*
const y,
const int& incy)
const;
2273 void SYMM(ESide side, EUplo uplo,
const int& m,
const int& n,
const double& alpha,
const double* A,
const int& lda,
const double* B,
const int& ldb,
const double& beta,
double* C,
const int& ldc)
const;
2274 void SYRK(EUplo uplo, ETransp trans,
const int& n,
const int& k,
const double& alpha,
const double* A,
const int& lda,
const double& beta,
double* C,
const int& ldc)
const;
2275 void HERK(EUplo uplo, ETransp trans,
const int& n,
const int& k,
const double& alpha,
const double* A,
const int& lda,
const double& beta,
double* C,
const int& ldc)
const;
2276 void TRMM(ESide side, EUplo uplo, ETransp transa, EDiag diag,
const int& m,
const int& n,
const double& alpha,
const double* A,
const int& lda,
double* B,
const int& ldb)
const;
2277 void TRSM(ESide side, EUplo uplo, ETransp transa, EDiag diag,
const int& m,
const int& n,
const double& alpha,
const double* A,
const int& lda,
double* B,
const int& ldb)
const;
2283 class TEUCHOSNUMERICS_LIB_DLL_EXPORT BLAS<int, std::complex<float> >
2286 inline BLAS(
void) {}
2287 inline BLAS(
const BLAS<
int, std::complex<float> >& ) {}
2288 inline virtual ~BLAS(
void) {}
2289 void ROTG(std::complex<float>* da, std::complex<float>* db,
float* c, std::complex<float>* s)
const;
2290 void ROT(
const int& n, std::complex<float>* dx,
const int& incx, std::complex<float>* dy,
const int& incy,
float* c, std::complex<float>* s)
const;
2291 float ASUM(
const int& n,
const std::complex<float>* x,
const int& incx)
const;
2292 void AXPY(
const int& n,
const std::complex<float> alpha,
const std::complex<float>* x,
const int& incx, std::complex<float>* y,
const int& incy)
const;
2293 void COPY(
const int& n,
const std::complex<float>* x,
const int& incx, std::complex<float>* y,
const int& incy)
const;
2294 std::complex<float> DOT(
const int& n,
const std::complex<float>* x,
const int& incx,
const std::complex<float>* y,
const int& incy)
const;
2295 float NRM2(
const int& n,
const std::complex<float>* x,
const int& incx)
const;
2296 void SCAL(
const int& n,
const std::complex<float> alpha, std::complex<float>* x,
const int& incx)
const;
2297 int IAMAX(
const int& n,
const std::complex<float>* x,
const int& incx)
const;
2298 void GEMV(ETransp trans,
const int& m,
const int& n,
const std::complex<float> alpha,
const std::complex<float>* A,
const int& lda,
const std::complex<float>* x,
const int& incx,
const std::complex<float> beta, std::complex<float>* y,
const int& incy)
const;
2299 void TRMV(EUplo uplo, ETransp trans, EDiag diag,
const int& n,
const std::complex<float>* A,
const int& lda, std::complex<float>* x,
const int& incx)
const;
2300 void GER(
const int& m,
const int& n,
const std::complex<float> alpha,
const std::complex<float>* x,
const int& incx,
const std::complex<float>* y,
const int& incy, std::complex<float>* A,
const int& lda)
const;
2301 void GEMM(ETransp transa, ETransp transb,
const int& m,
const int& n,
const int& k,
const std::complex<float> alpha,
const std::complex<float>* A,
const int& lda,
const std::complex<float>* B,
const int& ldb,
const std::complex<float> beta, std::complex<float>* C,
const int& ldc)
const;
2302 void SWAP(
const int& n, std::complex<float>*
const x,
const int& incx, std::complex<float>*
const y,
const int& incy)
const;
2303 void SYMM(ESide side, EUplo uplo,
const int& m,
const int& n,
const std::complex<float> alpha,
const std::complex<float>* A,
const int& lda,
const std::complex<float> *B,
const int& ldb,
const std::complex<float> beta, std::complex<float> *C,
const int& ldc)
const;
2304 void SYRK(EUplo uplo, ETransp trans,
const int& n,
const int& k,
const std::complex<float> alpha,
const std::complex<float>* A,
const int& lda,
const std::complex<float> beta, std::complex<float>* C,
const int& ldc)
const;
2305 void HERK(EUplo uplo, ETransp trans,
const int& n,
const int& k,
const std::complex<float> alpha,
const std::complex<float>* A,
const int& lda,
const std::complex<float> beta, std::complex<float>* C,
const int& ldc)
const;
2306 void TRMM(ESide side, EUplo uplo, ETransp transa, EDiag diag,
const int& m,
const int& n,
const std::complex<float> alpha,
const std::complex<float>* A,
const int& lda, std::complex<float>* B,
const int& ldb)
const;
2307 void TRSM(ESide side, EUplo uplo, ETransp transa, EDiag diag,
const int& m,
const int& n,
const std::complex<float> alpha,
const std::complex<float>* A,
const int& lda, std::complex<float>* B,
const int& ldb)
const;
2313 class TEUCHOSNUMERICS_LIB_DLL_EXPORT BLAS<int, std::complex<double> >
2316 inline BLAS(
void) {}
2317 inline BLAS(
const BLAS<
int, std::complex<double> >& ) {}
2318 inline virtual ~BLAS(
void) {}
2319 void ROTG(std::complex<double>* da, std::complex<double>* db,
double* c, std::complex<double>* s)
const;
2320 void ROT(
const int& n, std::complex<double>* dx,
const int& incx, std::complex<double>* dy,
const int& incy,
double* c, std::complex<double>* s)
const;
2321 double ASUM(
const int& n,
const std::complex<double>* x,
const int& incx)
const;
2322 void AXPY(
const int& n,
const std::complex<double> alpha,
const std::complex<double>* x,
const int& incx, std::complex<double>* y,
const int& incy)
const;
2323 void COPY(
const int& n,
const std::complex<double>* x,
const int& incx, std::complex<double>* y,
const int& incy)
const;
2324 std::complex<double> DOT(
const int& n,
const std::complex<double>* x,
const int& incx,
const std::complex<double>* y,
const int& incy)
const;
2325 double NRM2(
const int& n,
const std::complex<double>* x,
const int& incx)
const;
2326 void SCAL(
const int& n,
const std::complex<double> alpha, std::complex<double>* x,
const int& incx)
const;
2327 int IAMAX(
const int& n,
const std::complex<double>* x,
const int& incx)
const;
2328 void GEMV(ETransp trans,
const int& m,
const int& n,
const std::complex<double> alpha,
const std::complex<double>* A,
const int& lda,
const std::complex<double>* x,
const int& incx,
const std::complex<double> beta, std::complex<double>* y,
const int& incy)
const;
2329 void TRMV(EUplo uplo, ETransp trans, EDiag diag,
const int& n,
const std::complex<double>* A,
const int& lda, std::complex<double>* x,
const int& incx)
const;
2330 void GER(
const int& m,
const int& n,
const std::complex<double> alpha,
const std::complex<double>* x,
const int& incx,
const std::complex<double>* y,
const int& incy, std::complex<double>* A,
const int& lda)
const;
2331 void GEMM(ETransp transa, ETransp transb,
const int& m,
const int& n,
const int& k,
const std::complex<double> alpha,
const std::complex<double>* A,
const int& lda,
const std::complex<double>* B,
const int& ldb,
const std::complex<double> beta, std::complex<double>* C,
const int& ldc)
const;
2332 void SWAP(
const int& n, std::complex<double>*
const x,
const int& incx, std::complex<double>*
const y,
const int& incy)
const;
2333 void SYMM(ESide side, EUplo uplo,
const int& m,
const int& n,
const std::complex<double> alpha,
const std::complex<double>* A,
const int& lda,
const std::complex<double> *B,
const int& ldb,
const std::complex<double> beta, std::complex<double> *C,
const int& ldc)
const;
2334 void SYRK(EUplo uplo, ETransp trans,
const int& n,
const int& k,
const std::complex<double> alpha,
const std::complex<double>* A,
const int& lda,
const std::complex<double> beta, std::complex<double>* C,
const int& ldc)
const;
2335 void HERK(EUplo uplo, ETransp trans,
const int& n,
const int& k,
const std::complex<double> alpha,
const std::complex<double>* A,
const int& lda,
const std::complex<double> beta, std::complex<double>* C,
const int& ldc)
const;
2336 void TRMM(ESide side, EUplo uplo, ETransp transa, EDiag diag,
const int& m,
const int& n,
const std::complex<double> alpha,
const std::complex<double>* A,
const int& lda, std::complex<double>* B,
const int& ldb)
const;
2337 void TRSM(ESide side, EUplo uplo, ETransp transa, EDiag diag,
const int& m,
const int& n,
const std::complex<double> alpha,
const std::complex<double>* A,
const int& lda, std::complex<double>* B,
const int& ldb)
const;
Enumerated types for BLAS input characters.
Teuchos header file which uses auto-configuration information to include necessary C++ headers.
Defines basic traits for the ordinal field type.
Defines basic traits for the scalar field type.
virtual ~BLAS(void)
Destructor.
BLAS(const BLAS< OrdinalType, ScalarType > &)
Copy constructor.
BLAS(void)
Default constructor.
Default implementation for BLAS routines.
DefaultBLASImpl(const DefaultBLASImpl< OrdinalType, ScalarType > &)
Copy constructor.
OrdinalType IAMAX(const OrdinalType &n, const ScalarType *x, const OrdinalType &incx) const
Return the index of the element of x with the maximum magnitude.
void ROTG(ScalarType *da, ScalarType *db, rotg_c_type *c, ScalarType *s) const
Computes a Givens plane rotation.
ScalarType DOT(const OrdinalType &n, const x_type *x, const OrdinalType &incx, const y_type *y, const OrdinalType &incy) const
Form the dot product of the vectors x and y.
void SYMM(ESide side, EUplo uplo, const OrdinalType &m, const OrdinalType &n, const alpha_type alpha, const A_type *A, const OrdinalType &lda, const B_type *B, const OrdinalType &ldb, const beta_type beta, ScalarType *C, const OrdinalType &ldc) const
Performs the matrix-matrix operation: C <- alpha*A*B+beta*C or C <- alpha*B*A+beta*C where A is an m ...
void AXPY(const OrdinalType &n, const alpha_type alpha, const x_type *x, const OrdinalType &incx, ScalarType *y, const OrdinalType &incy) const
Perform the operation: y <- y+alpha*x.
void TRSM(ESide side, EUplo uplo, ETransp transa, EDiag diag, const OrdinalType &m, const OrdinalType &n, const alpha_type alpha, const A_type *A, const OrdinalType &lda, ScalarType *B, const OrdinalType &ldb) const
Solves the matrix equations: op(A)*X=alpha*B or X*op(A)=alpha*B where X and B are m by n matrices,...
virtual ~DefaultBLASImpl(void)
Destructor.
void SYRK(EUplo uplo, ETransp trans, const OrdinalType &n, const OrdinalType &k, const alpha_type alpha, const A_type *A, const OrdinalType &lda, const beta_type beta, ScalarType *C, const OrdinalType &ldc) const
Performs the symmetric rank k operation: C <- alpha*A*A'+beta*C or C <- alpha*A'*A+beta*C,...
void GEMM(ETransp transa, ETransp transb, const OrdinalType &m, const OrdinalType &n, const OrdinalType &k, const alpha_type alpha, const A_type *A, const OrdinalType &lda, const B_type *B, const OrdinalType &ldb, const beta_type beta, ScalarType *C, const OrdinalType &ldc) const
General matrix-matrix multiply.
ScalarTraits< ScalarType >::magnitudeType NRM2(const OrdinalType &n, const ScalarType *x, const OrdinalType &incx) const
Compute the 2-norm of the vector x.
DefaultBLASImpl(void)
Default constructor.
ScalarTraits< ScalarType >::magnitudeType ASUM(const OrdinalType &n, const ScalarType *x, const OrdinalType &incx) const
Sum the absolute values of the entries of x.
void COPY(const OrdinalType &n, const ScalarType *x, const OrdinalType &incx, ScalarType *y, const OrdinalType &incy) const
Copy the vector x to the vector y.
void ROT(const OrdinalType &n, ScalarType *dx, const OrdinalType &incx, ScalarType *dy, const OrdinalType &incy, MagnitudeType *c, ScalarType *s) const
Applies a Givens plane rotation.
void GER(const OrdinalType &m, const OrdinalType &n, const alpha_type alpha, const x_type *x, const OrdinalType &incx, const y_type *y, const OrdinalType &incy, ScalarType *A, const OrdinalType &lda) const
Performs the rank 1 operation: A <- alpha*x*y'+A.
void SCAL(const OrdinalType &n, const ScalarType &alpha, ScalarType *x, const OrdinalType &incx) const
Scale the vector x by the constant alpha.
void SWAP(const OrdinalType &n, ScalarType *const x, const OrdinalType &incx, ScalarType *const y, const OrdinalType &incy) const
Swap the entries of x and y.
details::GivensRotator< ScalarType >::c_type rotg_c_type
The type used for c in ROTG.
void GEMV(ETransp trans, const OrdinalType &m, const OrdinalType &n, const alpha_type alpha, const A_type *A, const OrdinalType &lda, const x_type *x, const OrdinalType &incx, const beta_type beta, ScalarType *y, const OrdinalType &incy) const
Performs the matrix-vector operation: y <- alpha*A*x+beta*y or y <- alpha*A'*x+beta*y where A is a ge...
void TRMV(EUplo uplo, ETransp trans, EDiag diag, const OrdinalType &n, const A_type *A, const OrdinalType &lda, ScalarType *x, const OrdinalType &incx) const
Performs the matrix-vector operation: x <- A*x or x <- A'*x where A is a unit/non-unit n by n upper/l...
void TRMM(ESide side, EUplo uplo, ETransp transa, EDiag diag, const OrdinalType &m, const OrdinalType &n, const alpha_type alpha, const A_type *A, const OrdinalType &lda, ScalarType *B, const OrdinalType &ldb) const
Performs the matrix-matrix operation: B <- alpha*op(A)*B or B <- alpha*B*op(A) where op(A) is an unit...
Smart reference counting pointer class for automatic garbage collection.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Teuchos implementation details.
static T one()
Returns representation of one for this ordinal type.
static T zero()
Returns representation of zero for this ordinal type.
This structure defines some basic traits for a scalar field type.
static magnitudeType magnitude(T a)
Returns the magnitudeType of the scalar type a.
static T one()
Returns representation of one for this scalar type.
T magnitudeType
Mandatory typedef for result of magnitude.
static T zero()
Returns representation of zero for this scalar type.
static T conjugate(T a)
Returns the conjugate of the scalar type a.