59#ifndef _TEUCHOS_BLAS_HPP_
60#define _TEUCHOS_BLAS_HPP_
128 template<
typename OrdinalType,
typename ScalarType>
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>
286 template<
typename ScalarType>
294 template<
typename ScalarType>
301 template<
typename ScalarType,
bool isComplex>
305 template<
typename ScalarType>
317 template<
typename ScalarType>
342 if (
y > STS::zero()) {
343 return STS::magnitude (x);
344 }
else if (
y < STS::zero()) {
345 return -STS::magnitude (x);
360 return STS::magnitude (x);
365 return -STS::magnitude (x);
372 template<
typename ScalarType>
381 typedef typename STS::magnitudeType MagnitudeType;
401 MagnitudeType
norm, scale;
403 if (STS::magnitude (*
ca) == STM::zero()) {
408 scale = STS::magnitude (*
ca) + STS::magnitude (*
cb);
420 *
c = STS::magnitude (*
ca) /
norm;
427 template<
typename ScalarType>
461 if (STS::magnitude (*
da) > STS::magnitude (*
db)) {
464 scale = STS::magnitude (*
da) + STS::magnitude (*
db);
465 if (scale == STS::zero()) {
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>
503 template<
typename ScalarType>
514 template<
typename OrdinalType,
typename ScalarType>
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>
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>
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;
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;
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
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;
1239 }
else if (
conjA ) {
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
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;
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."
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++) {
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;
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
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;
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;
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;
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;
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;
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;
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;
2319 inline BLAS(
const BLAS<
int, std::complex<float> >& ) {}
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;
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;
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;
2349 inline BLAS(
const BLAS<
int, std::complex<double> >& ) {}
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;
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;
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.
#define TEUCHOSNUMERICS_LIB_DLL_EXPORT
Defines basic traits for the ordinal field type.
Defines basic traits for the scalar field type.
BLAS(const BLAS< int, double > &)
BLAS(const BLAS< int, float > &)
void SWAP(const int &n, std::complex< double > *const x, const int &incx, std::complex< double > *const y, const int &incy) const
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
void ROTG(std::complex< double > *da, std::complex< double > *db, double *c, std::complex< double > *s) const
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
double ASUM(const int &n, const std::complex< double > *x, const int &incx) const
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
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
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
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
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
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
int IAMAX(const int &n, const std::complex< double > *x, const int &incx) const
BLAS(const BLAS< int, std::complex< double > > &)
std::complex< double > DOT(const int &n, const std::complex< double > *x, const int &incx, const std::complex< double > *y, const int &incy) const
void SCAL(const int &n, const std::complex< double > alpha, std::complex< double > *x, const int &incx) const
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
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
double NRM2(const int &n, const std::complex< double > *x, const int &incx) const
void COPY(const int &n, const std::complex< double > *x, const int &incx, std::complex< double > *y, const int &incy) const
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
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
void ROTG(std::complex< float > *da, std::complex< float > *db, float *c, std::complex< float > *s) const
void SCAL(const int &n, const std::complex< float > alpha, std::complex< float > *x, const int &incx) const
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
void COPY(const int &n, const std::complex< float > *x, const int &incx, std::complex< float > *y, const int &incy) const
void SWAP(const int &n, std::complex< float > *const x, const int &incx, std::complex< float > *const y, const int &incy) const
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
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
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
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
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
std::complex< float > DOT(const int &n, const std::complex< float > *x, const int &incx, const std::complex< float > *y, const int &incy) const
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
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
BLAS(const BLAS< int, std::complex< float > > &)
float NRM2(const int &n, const std::complex< float > *x, const int &incx) const
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
float ASUM(const int &n, const std::complex< float > *x, const int &incx) const
int IAMAX(const int &n, const std::complex< float > *x, const int &incx) const
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
virtual ~BLAS(void)
Destructor.
BLAS(const BLAS< OrdinalType, ScalarType > &)
Copy constructor.
Teuchos::ScalarTraits< ScalarType >::magnitudeType MagnitudeType
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...
Teuchos::ScalarTraits< ScalarType >::magnitudeType MagnitudeType
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...
Concrete serial communicator subclass.
ScalarType SIGN(const ScalarType &x, const ScalarType &y) const
ScalarTraits< ScalarType >::magnitudeType c_type
void blas_dabs1(const ScalarType *a, typename ScalarTraits< ScalarType >::magnitudeType *ret) const
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
TEUCHOSNUMERICS_LIB_DLL_EXPORT const char ETranspChar[]
TEUCHOSNUMERICS_LIB_DLL_EXPORT const char EUploChar[]
TEUCHOSNUMERICS_LIB_DLL_EXPORT const char ETypeChar[]
TEUCHOSNUMERICS_LIB_DLL_EXPORT const char EDiagChar[]
TEUCHOSNUMERICS_LIB_DLL_EXPORT const char ESideChar[]
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.