59#ifndef _TEUCHOS_BLAS_HPP_
60#define _TEUCHOS_BLAS_HPP_
73#include "Teuchos_Assert.hpp"
109 extern TEUCHOSNUMERICS_LIB_DLL_EXPORT
const char ESideChar[];
110 extern TEUCHOSNUMERICS_LIB_DLL_EXPORT
const char ETranspChar[];
111 extern TEUCHOSNUMERICS_LIB_DLL_EXPORT
const char EUploChar[];
112 extern TEUCHOSNUMERICS_LIB_DLL_EXPORT
const char EDiagChar[];
113 extern TEUCHOSNUMERICS_LIB_DLL_EXPORT
const char ETypeChar[];
117 template<
typename ScalarType,
128 template<
typename OrdinalType,
typename ScalarType>
154 typedef typename details::GivensRotator<ScalarType>::c_type
rotg_c_type;
169 template <
typename alpha_type,
typename x_type>
176 template <
typename x_type,
typename y_type>
190 template <
typename alpha_type,
typename A_type,
typename x_type,
typename beta_type>
195 template <
typename A_type>
201 template <
typename alpha_type,
typename x_type,
typename y_type>
215 template <
typename alpha_type,
typename A_type,
typename B_type,
typename beta_type>
216 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;
224 template <
typename alpha_type,
typename A_type,
typename B_type,
typename beta_type>
225 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;
228 template <
typename alpha_type,
typename A_type,
typename beta_type>
232 template <
typename alpha_type,
typename A_type>
237 template <
typename alpha_type,
typename A_type>
243 template<
typename OrdinalType,
typename ScalarType>
278 template<
typename ScalarType,
bool isComplex>
282 blas_dabs1(
const ScalarType* a,
typename ScalarTraits<ScalarType>::magnitudeType* ret)
const;
286 template<
typename ScalarType>
287 class MagValue<ScalarType, true> {
290 blas_dabs1(
const ScalarType* a,
typename ScalarTraits<ScalarType>::magnitudeType* ret)
const;
294 template<
typename ScalarType>
295 class MagValue<ScalarType, false> {
298 blas_dabs1(
const ScalarType* a, ScalarType* ret)
const;
301 template<
typename ScalarType,
bool isComplex>
302 class GivensRotator {};
305 template<
typename ScalarType>
306 class GivensRotator<ScalarType, true> {
308 typedef typename ScalarTraits<ScalarType>::magnitudeType c_type;
310 ROTG (ScalarType* ca,
312 typename ScalarTraits<ScalarType>::magnitudeType* c,
313 ScalarType* s)
const;
317 template<
typename ScalarType>
318 class GivensRotator<ScalarType, false> {
320 typedef ScalarType c_type;
322 ROTG (ScalarType* da,
325 ScalarType* s)
const;
339 ScalarType SIGN (
const ScalarType& x,
const ScalarType& y)
const {
340 typedef ScalarTraits<ScalarType> STS;
342 if (y > STS::zero()) {
343 return STS::magnitude (x);
344 }
else if (y < STS::zero()) {
345 return -STS::magnitude (x);
358 ScalarType signedInfinity = STS::one() / y;
359 if (signedInfinity > STS::zero()) {
360 return STS::magnitude (x);
365 return -STS::magnitude (x);
372 template<
typename ScalarType>
374 GivensRotator<ScalarType, true>::
375 ROTG (ScalarType* ca,
377 typename ScalarTraits<ScalarType>::magnitudeType* c,
380 typedef ScalarTraits<ScalarType> STS;
381 typedef typename STS::magnitudeType MagnitudeType;
382 typedef ScalarTraits<MagnitudeType> STM;
401 MagnitudeType norm, scale;
403 if (STS::magnitude (*ca) == STM::zero()) {
408 scale = STS::magnitude (*ca) + STS::magnitude (*cb);
412 const MagnitudeType ca_scaled =
413 STS::magnitude (*ca / ScalarType(scale, STM::zero()));
414 const MagnitudeType cb_scaled =
415 STS::magnitude (*cb / ScalarType(scale, STM::zero()));
417 STM::squareroot (ca_scaled*ca_scaled + cb_scaled*cb_scaled);
419 alpha = *ca / STS::magnitude (*ca);
420 *c = STS::magnitude (*ca) / norm;
421 *s = alpha * STS::conjugate (*cb) / norm;
427 template<
typename ScalarType>
429 GivensRotator<ScalarType, false>::
430 ROTG (ScalarType* da,
435 typedef ScalarTraits<ScalarType> STS;
458 ScalarType r, roe, scale, z;
461 if (STS::magnitude (*da) > STS::magnitude (*db)) {
464 scale = STS::magnitude (*da) + STS::magnitude (*db);
465 if (scale == STS::zero()) {
474 const ScalarType da_scaled = *da / scale;
475 const ScalarType db_scaled = *db / scale;
476 r = scale * STS::squareroot (da_scaled*da_scaled + db_scaled*db_scaled);
477 r = SIGN (STS::one(), roe) * r;
481 if (STS::magnitude (*da) > STS::magnitude (*db)) {
484 if (STS::magnitude (*db) >= STS::magnitude (*da) && *c != STS::zero()) {
494 template<
typename ScalarType>
496 MagValue<ScalarType, false>::
497 blas_dabs1(
const ScalarType* a, ScalarType* ret)
const
503 template<
typename ScalarType>
505 MagValue<ScalarType, true>::
506 blas_dabs1(
const ScalarType* a,
typename ScalarTraits<ScalarType>::magnitudeType* ret)
const
508 *ret = ScalarTraits<typename ScalarTraits<ScalarType>::magnitudeType>::magnitude(a->real());
509 *ret += ScalarTraits<typename ScalarTraits<ScalarType>::magnitudeType>::magnitude(a->imag());
514 template<
typename OrdinalType,
typename ScalarType>
522 details::GivensRotator<ScalarType>
rotator;
526 template<
typename OrdinalType,
typename ScalarType>
553 template<
typename OrdinalType,
typename ScalarType>
571 template<
typename OrdinalType,
typename ScalarType>
591 template<
typename OrdinalType,
typename ScalarType>
592 template <
typename alpha_type,
typename x_type>
613 template<
typename OrdinalType,
typename ScalarType>
625 details::MagValue<ScalarType, ScalarTraits<ScalarType>::isComplex>
mval;
636 template<
typename OrdinalType,
typename ScalarType>
637 template <
typename x_type,
typename y_type>
660 template<
typename OrdinalType,
typename ScalarType>
681 template<
typename OrdinalType,
typename ScalarType>
695 details::MagValue<ScalarType, ScalarTraits<ScalarType>::isComplex>
mval;
716 template<
typename OrdinalType,
typename ScalarType>
717 template <
typename alpha_type,
typename A_type,
typename x_type,
typename beta_type>
718 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
735 std::cout <<
"BLAS::GEMV Error: M == " <<
m << std::endl;
739 std::cout <<
"BLAS::GEMV Error: N == " << n << std::endl;
743 std::cout <<
"BLAS::GEMV Error: LDA < MAX(1,M)"<< std::endl;
747 std::cout <<
"BLAS::GEMV Error: INCX == 0"<< std::endl;
751 std::cout <<
"BLAS::GEMV Error: INCY == 0"<< std::endl;
761 if(ETranspChar[
trans] ==
'N') {
803 if( ETranspChar[
trans] ==
'N' ) {
869 template<
typename OrdinalType,
typename ScalarType>
870 template <
typename A_type>
880 if( n ==
izero ){
return; }
884 std::cout <<
"BLAS::TRMV Error: N == " << n << std::endl;
888 std::cout <<
"BLAS::TRMV Error: LDA < MAX(1,N)"<< std::endl;
892 std::cout <<
"BLAS::TRMV Error: INCX == 0"<< std::endl;
908 if (ETranspChar[
trans] ==
'N') {
910 if (EUploChar[
uplo] ==
'U') {
971 if (EUploChar[
uplo]==
'U') {
1064 template<
typename OrdinalType,
typename ScalarType>
1065 template <
typename alpha_type,
typename x_type,
typename y_type>
1079 std::cout <<
"BLAS::GER Error: M == " <<
m << std::endl;
1083 std::cout <<
"BLAS::GER Error: N == " << n << std::endl;
1087 std::cout <<
"BLAS::GER Error: LDA < MAX(1,M)"<< std::endl;
1091 std::cout <<
"BLAS::GER Error: INCX == 0"<< std::endl;
1095 std::cout <<
"BLAS::GER Error: INCY == 0"<< std::endl;
1139 template<
typename OrdinalType,
typename ScalarType>
1140 template <
typename alpha_type,
typename A_type,
typename B_type,
typename beta_type>
1141 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
1157 if( !(ETranspChar[
transa]==
'N') ) {
1160 if( !(ETranspChar[
transb]==
'N') ) {
1167 std::cout <<
"BLAS::GEMM Error: M == " <<
m << std::endl;
1171 std::cout <<
"BLAS::GEMM Error: N == " << n << std::endl;
1175 std::cout <<
"BLAS::GEMM Error: K == " <<
k << std::endl;
1179 std::cout <<
"BLAS::GEMM Error: LDA < "<<
NRowA<<std::endl;
1183 std::cout <<
"BLAS::GEMM Error: LDB < "<<
NRowB<<std::endl;
1187 std::cout <<
"BLAS::GEMM Error: LDC < MAX(1,M)"<< std::endl;
1217 if ( ETranspChar[
transb]==
'N' ) {
1218 if ( ETranspChar[
transa]==
'N' ) {
1239 }
else if (
conjA ) {
1270 }
else if ( ETranspChar[
transa]==
'N' ) {
1314 }
else if (
conjA ) {
1386 template<
typename OrdinalType,
typename ScalarType>
1396 for (
int i = 0;
i < n; ++
i) {
1413 for (
int i = 1;
i <= n; ++
i) {
1415 x[
ix - 1] =
y[
iy - 1];
1423 template<
typename OrdinalType,
typename ScalarType>
1424 template <
typename alpha_type,
typename A_type,
typename B_type,
typename beta_type>
1425 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
1437 if (ESideChar[
side] ==
'R') {
NRowA = n; }
1442 std::cout <<
"BLAS::SYMM Error: M == "<<
m << std::endl;
1445 std::cout <<
"BLAS::SYMM Error: N == "<< n << std::endl;
1448 std::cout <<
"BLAS::SYMM Error: LDA < "<<
NRowA<<std::endl;
1451 std::cout <<
"BLAS::SYMM Error: LDB < MAX(1,M)"<<std::endl;
1454 std::cout <<
"BLAS::SYMM Error: LDC < MAX(1,M)"<<std::endl;
1477 if ( ESideChar[
side] ==
'L') {
1553 template<
typename OrdinalType,
typename ScalarType>
1554 template <
typename alpha_type,
typename A_type,
typename beta_type>
1555 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
1574 "Teuchos::BLAS<"<<OTNT::name()<<
","<<STNT::name()<<
">::SYRK()"
1575 " does not support CONJ_TRANS for complex data types."
1579 if( !(ETranspChar[
trans]==
'N') ) {
1584 if ( n==
izero ) {
return; }
1587 std::cout <<
"BLAS::SYRK Error: N == "<< n <<std::endl;
1590 std::cout <<
"BLAS::SYRK Error: K == "<<
k <<std::endl;
1593 std::cout <<
"BLAS::SYRK Error: LDA < "<<
NRowA<<std::endl;
1596 std::cout <<
"BLAS::SYRK Error: LDC < MAX(1,N)"<<std::endl;
1622 for (
i=
j;
i<n;
i++) {
1629 for (
i=
j;
i<n;
i++) {
1640 if ( ETranspChar[
trans]==
'N' ) {
1668 for (
i=
j;
i<n;
i++) {
1673 for (
i=
j;
i<n;
i++) {
1680 for (
i=
j;
i<n;
i++) {
1709 for (
i=
j;
i<n;
i++) {
1727 template<
typename OrdinalType,
typename ScalarType>
1728 template <
typename alpha_type,
typename A_type>
1729 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
1750 std::cout <<
"BLAS::TRMM Error: M == "<<
m <<std::endl;
1753 std::cout <<
"BLAS::TRMM Error: N == "<< n <<std::endl;
1756 std::cout <<
"BLAS::TRMM Error: LDA < "<<
NRowA<<std::endl;
1759 std::cout <<
"BLAS::TRMM Error: LDB < MAX(1,M)"<<std::endl;
1778 if ( ETranspChar[
transa]==
'N' ) {
1859 if( ETranspChar[
transa] ==
'N' ) {
1960 template<
typename OrdinalType,
typename ScalarType>
1961 template <
typename alpha_type,
typename A_type>
1962 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
1977 if (!(ESideChar[
side] ==
'L')) {
NRowA = n; }
1982 std::cout <<
"BLAS::TRSM Error: M == "<<
m<<std::endl;
1985 std::cout <<
"BLAS::TRSM Error: N == "<<n<<std::endl;
1988 std::cout <<
"BLAS::TRSM Error: LDA < "<<
NRowA<<std::endl;
1991 std::cout <<
"BLAS::TRSM Error: LDB < MAX(1,M)"<<std::endl;
2007 if(ESideChar[
side] ==
'L') {
2011 if(ETranspChar[
transa] ==
'N') {
2015 if(EUploChar[
uplo] ==
'U') {
2067 if(EUploChar[
uplo] ==
'U') {
2124 if (ETranspChar[
transa] ==
'N') {
2128 if(EUploChar[
uplo] ==
'U') {
2186 if(EUploChar[
uplo] ==
'U') {
2258 inline BLAS(
void) {}
2259 inline BLAS(
const BLAS<int, float>& ) {}
2260 inline virtual ~BLAS(
void) {}
2261 void ROTG(
float* da,
float* db,
float* c,
float* s)
const;
2262 void ROT(
const int& n,
float* dx,
const int& incx,
float* dy,
const int& incy,
float* c,
float* s)
const;
2263 float ASUM(
const int& n,
const float* x,
const int& incx)
const;
2264 void AXPY(
const int& n,
const float& alpha,
const float* x,
const int& incx,
float* y,
const int& incy)
const;
2265 void COPY(
const int& n,
const float* x,
const int& incx,
float* y,
const int& incy)
const;
2266 float DOT(
const int& n,
const float* x,
const int& incx,
const float* y,
const int& incy)
const;
2267 float NRM2(
const int& n,
const float* x,
const int& incx)
const;
2268 void SCAL(
const int& n,
const float& alpha,
float* x,
const int& incx)
const;
2269 int IAMAX(
const int& n,
const float* x,
const int& incx)
const;
2270 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;
2271 void TRMV(EUplo uplo, ETransp trans, EDiag diag,
const int& n,
const float* A,
const int& lda,
float* x,
const int& incx)
const;
2272 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;
2273 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;
2274 void SWAP(
const int& n,
float*
const x,
const int& incx,
float*
const y,
const int& incy)
const;
2275 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;
2276 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;
2277 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;
2278 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;
2279 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;
2285 class TEUCHOSNUMERICS_LIB_DLL_EXPORT BLAS<int, double>
2288 inline BLAS(
void) {}
2289 inline BLAS(
const BLAS<int, double>& ) {}
2290 inline virtual ~BLAS(
void) {}
2291 void ROTG(
double* da,
double* db,
double* c,
double* s)
const;
2292 void ROT(
const int& n,
double* dx,
const int& incx,
double* dy,
const int& incy,
double* c,
double* s)
const;
2293 double ASUM(
const int& n,
const double* x,
const int& incx)
const;
2294 void AXPY(
const int& n,
const double& alpha,
const double* x,
const int& incx,
double* y,
const int& incy)
const;
2295 void COPY(
const int& n,
const double* x,
const int& incx,
double* y,
const int& incy)
const;
2296 double DOT(
const int& n,
const double* x,
const int& incx,
const double* y,
const int& incy)
const;
2297 double NRM2(
const int& n,
const double* x,
const int& incx)
const;
2298 void SCAL(
const int& n,
const double& alpha,
double* x,
const int& incx)
const;
2299 int IAMAX(
const int& n,
const double* x,
const int& incx)
const;
2300 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;
2301 void TRMV(EUplo uplo, ETransp trans, EDiag diag,
const int& n,
const double* A,
const int& lda,
double* x,
const int& incx)
const;
2302 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;
2303 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;
2304 void SWAP(
const int& n,
double*
const x,
const int& incx,
double*
const y,
const int& incy)
const;
2305 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;
2306 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;
2307 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;
2308 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;
2309 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;
2315 class TEUCHOSNUMERICS_LIB_DLL_EXPORT BLAS<int, std::complex<float> >
2318 inline BLAS(
void) {}
2319 inline BLAS(
const BLAS<
int, std::complex<float> >& ) {}
2320 inline virtual ~BLAS(
void) {}
2321 void ROTG(std::complex<float>* da, std::complex<float>* db,
float* c, std::complex<float>* s)
const;
2322 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;
2323 float ASUM(
const int& n,
const std::complex<float>* x,
const int& incx)
const;
2324 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;
2325 void COPY(
const int& n,
const std::complex<float>* x,
const int& incx, std::complex<float>* y,
const int& incy)
const;
2326 std::complex<float> DOT(
const int& n,
const std::complex<float>* x,
const int& incx,
const std::complex<float>* y,
const int& incy)
const;
2327 float NRM2(
const int& n,
const std::complex<float>* x,
const int& incx)
const;
2328 void SCAL(
const int& n,
const std::complex<float> alpha, std::complex<float>* x,
const int& incx)
const;
2329 int IAMAX(
const int& n,
const std::complex<float>* x,
const int& incx)
const;
2330 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;
2331 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;
2332 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;
2333 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;
2334 void SWAP(
const int& n, std::complex<float>*
const x,
const int& incx, std::complex<float>*
const y,
const int& incy)
const;
2335 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;
2336 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;
2337 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;
2338 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;
2339 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;
2345 class TEUCHOSNUMERICS_LIB_DLL_EXPORT BLAS<int, std::complex<double> >
2348 inline BLAS(
void) {}
2349 inline BLAS(
const BLAS<
int, std::complex<double> >& ) {}
2350 inline virtual ~BLAS(
void) {}
2351 void ROTG(std::complex<double>* da, std::complex<double>* db,
double* c, std::complex<double>* s)
const;
2352 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;
2353 double ASUM(
const int& n,
const std::complex<double>* x,
const int& incx)
const;
2354 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;
2355 void COPY(
const int& n,
const std::complex<double>* x,
const int& incx, std::complex<double>* y,
const int& incy)
const;
2356 std::complex<double> DOT(
const int& n,
const std::complex<double>* x,
const int& incx,
const std::complex<double>* y,
const int& incy)
const;
2357 double NRM2(
const int& n,
const std::complex<double>* x,
const int& incx)
const;
2358 void SCAL(
const int& n,
const std::complex<double> alpha, std::complex<double>* x,
const int& incx)
const;
2359 int IAMAX(
const int& n,
const std::complex<double>* x,
const int& incx)
const;
2360 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;
2361 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;
2362 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;
2363 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;
2364 void SWAP(
const int& n, std::complex<double>*
const x,
const int& incx, std::complex<double>*
const y,
const int& incy)
const;
2365 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;
2366 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;
2367 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;
2368 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;
2369 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.
RCP(ENull null_arg=null)
Initialize RCP<T> to NULL.
#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.