diff --git a/examples/kokkos/simple_example.cpp b/examples/kokkos/simple_example.cpp index 1d36183..33c7ca1 100644 --- a/examples/kokkos/simple_example.cpp +++ b/examples/kokkos/simple_example.cpp @@ -18,44 +18,40 @@ #include -// -// First reduction (parallel_reduce) example: -// 1. Start up Kokkos -// 2. Execute a parallel_reduce loop in the default execution space, -// using a C++11 lambda to define the loop body -// 3. Shut down Kokkos -// -// This example only builds if C++11 is enabled. Compare this example -// to 02_simple_reduce, which uses a functor to define the loop body -// of the parallel_reduce. -// +template +bool small_test(size_t n) { + ScalarType sum = 0; + Kokkos::parallel_reduce( + n, KOKKOS_LAMBDA(const int i, ScalarType& lsum) { auto val = ScalarType(i+1); lsum += Kokkos::log(val); }, sum); + + std::cout << + "Sum from 0 to " << n-1 << + ", computed in parallel, is " << sum << std::endl; + + // Compare to a sequential loop. + ScalarType seqSum = 0; + for (int i = 0; i < n; ++i) { + ScalarType val = i + 1; + seqSum += Kokkos::log(val); + } + std::cout << + "Sum from 0 to " << n-1 << + ", computed in sequential, is " << seqSum << std::endl; + return true; +} + int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); - const int n = 1<<24; + const int n = 1<<20; // Compute the sum of squares of integers from 0 to n-1, in // parallel, using Kokkos. This time, use a lambda instead of a // functor. The lambda takes the same arguments as the functor's // operator(). - Sdouble sum = 0; - - Kokkos::parallel_reduce( - n, KOKKOS_LAMBDA(const int i, Sdouble& lsum) { auto val = Sdouble(i+1); lsum += 1/val * 1/val; }, sum); - - std::cout << - "Sum from 0 to " << n-1 << - ", computed in parallel, is " << sum << std::endl; - // Compare to a sequential loop. - Sdouble seqSum = 0; - for (int i = 0; i < n; ++i) { - Sdouble val = i + 1; - seqSum += 1/val * 1/val; - } - std::cout << - "Sum from 0 to " << n-1 << - ", computed in sequential, is " << seqSum << std::endl; + small_test(n); + small_test(n); Kokkos::finalize(); diff --git a/src/shaman/helpers/shaman_trilinos.h b/src/shaman/helpers/shaman_trilinos.h deleted file mode 100644 index 864e378..0000000 --- a/src/shaman/helpers/shaman_trilinos.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include "trilinos/arithmeticTraits_kokkos.h" -#include "trilinos/reductionTraits_kokkos.h" -#include "trilinos/scalarTraits_teuchos.h" -#include "trilinos/serializationTraits_teuchos.h" -#include "trilinos/lapackTraits_belosTeuchos.h" - diff --git a/src/shaman/helpers/trilinos/arithmeticTraits_kokkos.h b/src/shaman/helpers/trilinos/arithmeticTraits_kokkos.h deleted file mode 100644 index 1babaf4..0000000 --- a/src/shaman/helpers/trilinos/arithmeticTraits_kokkos.h +++ /dev/null @@ -1,287 +0,0 @@ -#pragma once - -#include -#include - -/* - * defines arithmetic traits needed by Kokkos - * see Kokkos_ArithTraits.hpp for examples - */ -namespace Kokkos -{ - namespace Details - { - template<> class ArithTraits - { - public: - typedef Sfloat val_type; - typedef val_type mag_type; - - static const bool is_specialized = true; - static const bool is_signed = true; - static const bool is_integer = false; - static const bool is_exact = false; - static const bool is_complex = false; - static constexpr bool has_infinity = true; - - static KOKKOS_FORCEINLINE_FUNCTION Sfloat infinity() { return HUGE_VALF; } - static KOKKOS_FORCEINLINE_FUNCTION bool isInf (const Sfloat x) { return Sstd::isinf(x); } - static KOKKOS_FORCEINLINE_FUNCTION bool isNan (const Sfloat x) { return Sstd::isnan(x); } - static KOKKOS_FORCEINLINE_FUNCTION mag_type abs (const Sfloat x) { return Sstd::abs(x); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat zero () { return 0.0f; } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat one () { return 1.0f; } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat min () { return -FLT_MAX; } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat max () { return FLT_MAX; } - static KOKKOS_FORCEINLINE_FUNCTION mag_type real (const Sfloat x) { return x; } - static KOKKOS_FORCEINLINE_FUNCTION mag_type imag (const Sfloat) { return zero(); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat conj (const Sfloat x) { return x; } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat pow (const Sfloat x, const Sfloat y) { return Sstd::pow(x, y); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat sqrt (const Sfloat x) { return Sstd::sqrt(x); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat cbrt (const Sfloat x) { return Sstd::cbrt(x); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat exp (const Sfloat x) { return Sstd::exp(x); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat log (const Sfloat x) { return Sstd::log(x); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat log10 (const Sfloat x) { return Sstd::log10(x); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat sin (const Sfloat x) { return Sstd::sin(x); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat cos (const Sfloat x) { return Sstd::cos(x); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat tan (const Sfloat x) { return Sstd::tan(x); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat sinh (const Sfloat x) { return Sstd::sinh (x); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat cosh (const Sfloat x) { return Sstd::cosh (x); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat tanh (const Sfloat x) { return Sstd::tanh (x); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat asin (const Sfloat x) { return Sstd::asin (x); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat acos (const Sfloat x) { return Sstd::acos (x); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat atan (const Sfloat x) { return Sstd::atan (x); } - static KOKKOS_FORCEINLINE_FUNCTION mag_type epsilon () { return FLT_EPSILON; } - - typedef mag_type magnitudeType; - typedef Sfloat halfPrecision; // C++ doesn't have a standard "half-float" type. - typedef Sdouble doublePrecision; - static const bool isComplex = false; - static const bool isOrdinal = false; - static const bool isComparable = true; - static const bool hasMachineParameters = true; - - static KOKKOS_FORCEINLINE_FUNCTION bool isnaninf (const Sfloat x) { return isNan (x) || isInf (x); } - static KOKKOS_FORCEINLINE_FUNCTION magnitudeType magnitude (const Sfloat x) { return abs (x); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat conjugate (const Sfloat x) { return conj (x); } - static std::string name () { return "Sfloat"; } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat squareroot (const Sfloat x) { return sqrt (x); } - static KOKKOS_FORCEINLINE_FUNCTION Sfloat nan () { return std::numeric_limits::quiet_NaN(); } - static KOKKOS_FORCEINLINE_FUNCTION mag_type eps () { return epsilon (); } - static KOKKOS_FORCEINLINE_FUNCTION mag_type sfmin () { return FLT_MIN; } - static KOKKOS_FORCEINLINE_FUNCTION int base () { return FLT_RADIX; } - static KOKKOS_FORCEINLINE_FUNCTION mag_type prec () { return eps () * static_cast (base ()); } - static KOKKOS_FORCEINLINE_FUNCTION int t () { return FLT_MANT_DIG; } - static KOKKOS_FORCEINLINE_FUNCTION mag_type rnd () { return one(); } - static KOKKOS_FORCEINLINE_FUNCTION int emin () { return FLT_MIN_EXP; } - static KOKKOS_FORCEINLINE_FUNCTION mag_type rmin () { return FLT_MIN; } - static KOKKOS_FORCEINLINE_FUNCTION int emax () { return FLT_MAX_EXP; } - static KOKKOS_FORCEINLINE_FUNCTION mag_type rmax () { return FLT_MAX; } - }; - - template<> class ArithTraits - { - public: - typedef Sdouble val_type; - typedef val_type mag_type; - - static const bool is_specialized = true; - static const bool is_signed = true; - static const bool is_integer = false; - static const bool is_exact = false; - static const bool is_complex = false; - static constexpr bool has_infinity = true; - - static KOKKOS_FORCEINLINE_FUNCTION Sdouble infinity() { return HUGE_VAL; } - static KOKKOS_FORCEINLINE_FUNCTION bool isInf (const val_type x) { return Sstd::isinf(x); } - static KOKKOS_FORCEINLINE_FUNCTION bool isNan (const val_type x) { return Sstd::isnan(x); } - static KOKKOS_FORCEINLINE_FUNCTION mag_type abs (const val_type x) { return Sstd::abs(x); } - static KOKKOS_FORCEINLINE_FUNCTION val_type zero () { return 0.0; } - static KOKKOS_FORCEINLINE_FUNCTION val_type one () { return 1.0; } - static KOKKOS_FORCEINLINE_FUNCTION val_type min () { return -DBL_MAX; } - static KOKKOS_FORCEINLINE_FUNCTION val_type max () { return DBL_MAX; } - static KOKKOS_FORCEINLINE_FUNCTION mag_type real (const val_type x) { return x; } - static KOKKOS_FORCEINLINE_FUNCTION mag_type imag (const val_type) { return zero(); } - static KOKKOS_FORCEINLINE_FUNCTION val_type conj (const val_type x) { return x; } - static KOKKOS_FORCEINLINE_FUNCTION val_type pow (const val_type x, const val_type y) { return Sstd::pow(x, y); } - static KOKKOS_FORCEINLINE_FUNCTION val_type sqrt (const val_type x) { return Sstd::sqrt(x); } - static KOKKOS_FORCEINLINE_FUNCTION val_type cbrt (const val_type x) { return Sstd::cbrt(x); } - static KOKKOS_FORCEINLINE_FUNCTION val_type exp (const val_type x) { return Sstd::exp(x); } - static KOKKOS_FORCEINLINE_FUNCTION val_type log (const val_type x) { return Sstd::log (x); } - static KOKKOS_FORCEINLINE_FUNCTION val_type log10 (const val_type x) { return Sstd::log10 (x); } - static KOKKOS_FORCEINLINE_FUNCTION val_type sin (const val_type x) { return Sstd::sin (x); } - static KOKKOS_FORCEINLINE_FUNCTION val_type cos (const val_type x) { return Sstd::cos (x); } - static KOKKOS_FORCEINLINE_FUNCTION val_type tan (const val_type x) { return Sstd::tan (x); } - static KOKKOS_FORCEINLINE_FUNCTION val_type sinh (const val_type x) { return Sstd::sinh (x); } - static KOKKOS_FORCEINLINE_FUNCTION val_type cosh (const val_type x) { return Sstd::cosh (x); } - static KOKKOS_FORCEINLINE_FUNCTION val_type tanh (const val_type x) { return Sstd::tanh (x); } - static KOKKOS_FORCEINLINE_FUNCTION val_type asin (const val_type x) { return Sstd::asin (x); } - static KOKKOS_FORCEINLINE_FUNCTION val_type acos (const val_type x) { return Sstd::acos (x); } - static KOKKOS_FORCEINLINE_FUNCTION val_type atan (const val_type x) { return Sstd::atan (x); } - static KOKKOS_FORCEINLINE_FUNCTION val_type nan () { return std::numeric_limits::quiet_NaN(); } - static KOKKOS_FORCEINLINE_FUNCTION mag_type epsilon () { return DBL_EPSILON; } - - typedef mag_type magnitudeType; - typedef Sfloat halfPrecision; - typedef Slong_double doublePrecision; - static const bool isComplex = false; - static const bool isOrdinal = false; - static const bool isComparable = true; - static const bool hasMachineParameters = true; - - static bool isnaninf (const val_type& x) { return isNan (x) || isInf (x); } - static KOKKOS_FORCEINLINE_FUNCTION mag_type magnitude (const val_type x) { return abs (x); } - static KOKKOS_FORCEINLINE_FUNCTION val_type conjugate (const val_type x) { return conj (x); } - static std::string name () { return "Sdouble"; } - static KOKKOS_FORCEINLINE_FUNCTION val_type squareroot (const val_type x) { return sqrt (x); } - static KOKKOS_FORCEINLINE_FUNCTION mag_type eps () { return epsilon (); } - static KOKKOS_FORCEINLINE_FUNCTION mag_type sfmin () { return DBL_MIN; } - static KOKKOS_FORCEINLINE_FUNCTION int base () { return FLT_RADIX; } - static KOKKOS_FORCEINLINE_FUNCTION mag_type prec () { return eps () * static_cast (base ()); } - static KOKKOS_FORCEINLINE_FUNCTION int t () { return DBL_MANT_DIG; } - static KOKKOS_FORCEINLINE_FUNCTION mag_type rnd () { return one(); } - static KOKKOS_FORCEINLINE_FUNCTION int emin () { return DBL_MIN_EXP; } - static KOKKOS_FORCEINLINE_FUNCTION mag_type rmin () { return DBL_MIN; } - static KOKKOS_FORCEINLINE_FUNCTION int emax () { return DBL_MAX_EXP; } - static KOKKOS_FORCEINLINE_FUNCTION mag_type rmax () { return DBL_MAX; } - }; - - template<> - class ArithTraits - { - public: - typedef Slong_double val_type; - typedef Slong_double mag_type; - - static const bool is_specialized = true; - static const bool is_signed = true; - static const bool is_integer = false; - static const bool is_exact = false; - static const bool is_complex = false; - static constexpr bool has_infinity = true; - - static KOKKOS_FORCEINLINE_FUNCTION Slong_double infinity() { return HUGE_VALL; } - static bool isInf (const val_type& x) { return Sstd::isinf(x); } - static bool isNan (const val_type& x) { return Sstd::isnan(x); } - static mag_type abs (const val_type& x) { return Sstd::abs(x); } - static val_type zero () { return 0.0L; } - static val_type one () { return 1.0L; } - static val_type min () { return -LDBL_MAX; } - static val_type max () { return LDBL_MAX; } - static mag_type real (const val_type& x) { return x; } - static mag_type imag (const val_type&) { return zero (); } - static val_type conj (const val_type& x) { return x; } - static val_type pow (const val_type& x, const val_type& y) { return Sstd::pow(x, y); } - static val_type sqrt (const val_type& x) { return Sstd::sqrt(x); } - static val_type cbrt (const val_type& x) { return Sstd::cbrt(x); } - static val_type exp (const val_type& x) { return Sstd::exp(x); } - static val_type log (const val_type& x) { return Sstd::log(x); } - static val_type log10 (const val_type& x) { return Sstd::log10(x); } - static val_type sin (const val_type& x) { return Sstd::sin(x); } - static val_type cos (const val_type& x) { return Sstd::cos(x); } - static val_type tan (const val_type& x) { return Sstd::tan(x); } - static val_type sinh (const val_type& x) { return Sstd::sinh(x); } - static val_type cosh (const val_type& x) { return Sstd::cosh(x); } - static val_type tanh (const val_type& x) { return Sstd::tanh(x); } - static val_type asin (const val_type& x) { return Sstd::asin(x); } - static val_type acos (const val_type& x) { return Sstd::acos(x); } - static val_type atan (const val_type& x) { return Sstd::atan(x); } - static val_type nan () { return std::numeric_limits::quiet_NaN(); } - static mag_type epsilon () { return LDBL_EPSILON; } - - typedef mag_type magnitudeType; - typedef Sdouble halfPrecision; - typedef Slong_double doublePrecision; // no long long double - static const bool isComplex = false; - static const bool isOrdinal = false; - static const bool isComparable = true; - static const bool hasMachineParameters = true; - - static bool isnaninf (const val_type& x) { return isNan (x) || isInf (x); } - static mag_type magnitude (const val_type& x) { return abs (x); } - static val_type conjugate (const val_type& x) { return conj (x); } - static std::string name () { return "Slong_double"; } - static val_type squareroot (const val_type& x) { return sqrt (x); } - static mag_type eps () { return epsilon (); } - static mag_type sfmin () { return LDBL_MIN; } - static int base () { return FLT_RADIX; } - static mag_type prec () { return eps () * static_cast (base ()); } - static int t () { return LDBL_MANT_DIG; } - static mag_type rnd () { return one (); } - static int emin () { return LDBL_MIN_EXP; } - static mag_type rmin () { return LDBL_MIN; } - static int emax () { return LDBL_MAX_EXP; } - static mag_type rmax () { return LDBL_MAX; } - }; - - } - - template struct rand - { - KOKKOS_INLINE_FUNCTION static Sfloat max(){return 1.0f;} - KOKKOS_INLINE_FUNCTION static Sfloat draw(Generator& gen) {return gen.frand();} - KOKKOS_INLINE_FUNCTION static Sfloat draw(Generator& gen, const Sfloat& range) {return gen.frand(range.number);} - KOKKOS_INLINE_FUNCTION static Sfloat draw(Generator& gen, const Sfloat& start, const Sfloat& end) {return gen.frand(start.number,end.number);} - }; - - template struct rand - { - KOKKOS_INLINE_FUNCTION static Sdouble max(){return 1.0;} - KOKKOS_INLINE_FUNCTION static Sdouble draw(Generator& gen) {return gen.drand();} - KOKKOS_INLINE_FUNCTION static Sdouble draw(Generator& gen, const Sdouble& range) {return gen.drand(range.number);} - KOKKOS_INLINE_FUNCTION static Sdouble draw(Generator& gen, const Sdouble& start, const Sdouble& end) {return gen.drand(start.number,end.number);} - }; - - template struct rand > - { - KOKKOS_INLINE_FUNCTION static Kokkos::complex max () - { - return Kokkos::complex (1.0f, 1.0f); - } - KOKKOS_INLINE_FUNCTION static Kokkos::complex draw (Generator& gen) - { - const Sfloat re = gen.frand (); - const Sfloat im = gen.frand (); - return Kokkos::complex (re, im); - } - KOKKOS_INLINE_FUNCTION static Kokkos::complex draw (Generator& gen, const Kokkos::complex& range) - { - const Sfloat re = gen.frand (real(range).number); - const Sfloat im = gen.frand (imag(range).number); - return Kokkos::complex (re, im); - } - KOKKOS_INLINE_FUNCTION static Kokkos::complex draw (Generator& gen, const Kokkos::complex& start, const Kokkos::complex& end) - { - const Sfloat re = gen.frand (real(start).number, real(end).number); - const Sfloat im = gen.frand (imag(start).number, imag(end).number); - return Kokkos::complex (re, im); - } - }; - - template struct rand > - { - KOKKOS_INLINE_FUNCTION static Kokkos::complex max () - { - return Kokkos::complex (1.0, 1.0); - } - KOKKOS_INLINE_FUNCTION static Kokkos::complex draw (Generator& gen) - { - const Sdouble re = gen.drand (); - const Sdouble im = gen.drand (); - return Kokkos::complex (re, im); - } - KOKKOS_INLINE_FUNCTION static Kokkos::complex draw (Generator& gen, const Kokkos::complex& range) - { - const Sdouble re = gen.drand (real(range)).number; - const Sdouble im = gen.drand (imag(range).number); - return Kokkos::complex (re, im); - } - KOKKOS_INLINE_FUNCTION static Kokkos::complex draw (Generator& gen, const Kokkos::complex& start, const Kokkos::complex& end) - { - const Sdouble re = gen.drand (real(start).number, real(end).number); - const Sdouble im = gen.drand (imag(start).number, imag(end).number); - return Kokkos::complex (re, im); - } - }; - -}; - diff --git a/src/shaman/helpers/trilinos/lapackTraits_belosTeuchos.h b/src/shaman/helpers/trilinos/lapackTraits_belosTeuchos.h deleted file mode 100644 index 3600b5a..0000000 --- a/src/shaman/helpers/trilinos/lapackTraits_belosTeuchos.h +++ /dev/null @@ -1,326 +0,0 @@ -#pragma once - -#include -#include "Teuchos_LAPACK.hpp" - -/* - * if LapackSupportsScalar is set to true then we need an implementation of lapack for our type - */ -namespace Belos -{ - namespace Details - { - template<> - class LapackSupportsScalar { - public: - const static bool value = true; - }; - - template<> - class LapackSupportsScalar { - public: - const static bool value = true; - }; - - template<> - class LapackSupportsScalar { - public: - const static bool value = true; - }; - } -} - -/* - * Shell implementation just so things that use LAPACK will compile. - * However each method throws a run-time error. - * inspired by : https://github.com/trilinos/Trilinos/blob/master/packages/stokhos/src/sacado/kokkos/vector/Teuchos_LAPACK_MP_Vector.hpp - * note that some fo these functions (as pointed out in the code) have actual generic implementations in Teuchoc_LAPACK.hpp - */ -namespace Teuchos -{ - template class LAPACK - { - using ScalarType = Sfloat; - using MagnitudeType = Sfloat; - - public: - inline LAPACK(void) {} - inline LAPACK(const LAPACK& lapack) {} - inline virtual ~LAPACK(void) {} - - void PTTRF(const OrdinalType n, ScalarType* d, ScalarType* e, OrdinalType* info) const { throw_error("PTTRF"); } - void PTTRS(const OrdinalType n, const OrdinalType nrhs, const ScalarType* d, const ScalarType* e, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("PTTRS"); } - void POTRF(const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* info) const { throw_error("POTRF"); } - void POTRS(const char UPLO, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("POTRS"); } - void POTRI(const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* info) const { throw_error("POTRI"); } - void POCON(const char UPLO, const OrdinalType n, const ScalarType* A, const OrdinalType lda, const ScalarType anorm, ScalarType* rcond, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("POCON"); } - void POSV(const char UPLO, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("POSV"); } - /*IMPLEMENTED*/void POEQU(const OrdinalType n, const ScalarType* A, const OrdinalType lda, MagnitudeType* S, MagnitudeType* scond, MagnitudeType* amax, OrdinalType* info) const { throw_error("POEQU"); } - void PORFS(const char UPLO, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const ScalarType* AF, const OrdinalType ldaf, const ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("PORFS"); } - void POSVX(const char FACT, const char UPLO, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* AF, const OrdinalType ldaf, char EQUED, ScalarType* S, ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* rcond, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("POSVX"); } - void GELS(const char TRANS, const OrdinalType m, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GELS"); } - void GELSS(const OrdinalType m, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, MagnitudeType* S, const MagnitudeType rcond, OrdinalType* rank, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info) const { throw_error("GELSS"); } - void GELSS(const OrdinalType m, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, ScalarType* S, const ScalarType rcond, OrdinalType* rank, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GELSS"); } - void GGLSE(const OrdinalType m, const OrdinalType n, const OrdinalType p, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, ScalarType* C, ScalarType* D, ScalarType* X, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GGLSE"); } - void GEQRF( const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GEQRF"); } - void GETRF(const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* IPIV, OrdinalType* info) const { throw_error("GETRF"); } - void GETRS(const char TRANS, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const OrdinalType* IPIV, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("GETRS"); } - /*IMPLEMENTED*/void LASCL(const char TYPE, const OrdinalType kl, const OrdinalType ku, const MagnitudeType cfrom, const MagnitudeType cto, const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* info) const { throw_error("LASCL"); } - void GEQP3(const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType *jpvt, ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info ) const { throw_error("GEQP3"); } - void LASWP (const OrdinalType N, ScalarType A[], const OrdinalType LDA, const OrdinalType K1, const OrdinalType K2, const OrdinalType IPIV[], const OrdinalType INCX) const { throw_error("LASWP"); } - void GBTRF(const OrdinalType m, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, ScalarType* A, const OrdinalType lda, OrdinalType* IPIV, OrdinalType* info) const { throw_error("GBTRF"); } - void GBTRS(const char TRANS, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const OrdinalType* IPIV, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("GBTRS"); } - void GTTRF(const OrdinalType n, ScalarType* dl, ScalarType* d, ScalarType* du, ScalarType* du2, OrdinalType* IPIV, OrdinalType* info) const { throw_error("GTTRF"); } - void GTTRS(const char TRANS, const OrdinalType n, const OrdinalType nrhs, const ScalarType* dl, const ScalarType* d, const ScalarType* du, const ScalarType* du2, const OrdinalType* IPIV, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("GTTRS"); } - void GETRI(const OrdinalType n, ScalarType* A, const OrdinalType lda, const OrdinalType* IPIV, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GETRI"); } - void LATRS (const char UPLO, const char TRANS, const char DIAG, const char NORMIN, const OrdinalType N, ScalarType* A, const OrdinalType LDA, ScalarType* X, MagnitudeType* SCALE, MagnitudeType* CNORM, OrdinalType* INFO) const { throw_error("LATRS"); } - void GECON(const char NORM, const OrdinalType n, const ScalarType* A, const OrdinalType lda, const ScalarType anorm, ScalarType* rcond, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GECON"); } - void GBCON(const char NORM, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const ScalarType* A, const OrdinalType lda, OrdinalType* IPIV, const ScalarType anorm, ScalarType* rcond, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GBCON"); } - typename ScalarTraits::magnitudeType LANGB(const char NORM, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const ScalarType* A, const OrdinalType lda, MagnitudeType* WORK) const { throw_error("LANGB"); return MagnitudeType(0); } - void GESV(const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, OrdinalType* IPIV, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("GESV"); } - /*IMPLEMENTED*/void GEEQU(const OrdinalType m, const OrdinalType n, const ScalarType* A, const OrdinalType lda, ScalarType* R, ScalarType* C, ScalarType* rowcond, ScalarType* colcond, ScalarType* amax, OrdinalType* info) const { throw_error("GEEQU"); } - void GERFS(const char TRANS, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const ScalarType* AF, const OrdinalType ldaf, const OrdinalType* IPIV, const ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GERFS"); } - /*IMPLEMENTED*/void GBEQU(const OrdinalType m, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const ScalarType* A, const OrdinalType lda, MagnitudeType* R, MagnitudeType* C, MagnitudeType* rowcond, MagnitudeType* colcond, MagnitudeType* amax, OrdinalType* info) const { throw_error("GBEQU"); } - void GBRFS(const char TRANS, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const ScalarType* AF, const OrdinalType ldaf, const OrdinalType* IPIV, const ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GBRFS"); } - void GESVX(const char FACT, const char TRANS, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* AF, const OrdinalType ldaf, OrdinalType* IPIV, char EQUED, ScalarType* R, ScalarType* C, ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* rcond, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GESVX"); } - void SYTRD(const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* D, ScalarType* E, ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("SYTRD"); } - void GEHRD(const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, ScalarType* A, const OrdinalType lda, ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GEHRD"); } - void TRTRS(const char UPLO, const char TRANS, const char DIAG, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("TRTRS"); } - void TRTRI(const char UPLO, const char DIAG, const OrdinalType n, const ScalarType* A, const OrdinalType lda, OrdinalType* info) const { throw_error("TRTRI"); } - void SPEV(const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* AP, ScalarType* W, ScalarType* Z, const OrdinalType ldz, ScalarType* WORK, OrdinalType* info) const { throw_error("SPEV"); } - void SYEV(const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* W, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("SYEV"); } - void SYGV(const OrdinalType itype, const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, ScalarType* W, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("SYGV"); } - void HEEV(const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, MagnitudeType* W, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info) const { throw_error("HEEV"); } - void HEGV(const OrdinalType itype, const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, MagnitudeType* W, ScalarType* WORK, const OrdinalType lwork, MagnitudeType *RWORK, OrdinalType* info) const { throw_error("HEGV"); } - void STEQR(const char COMPZ, const OrdinalType n, ScalarType* D, ScalarType* E, ScalarType* Z, const OrdinalType ldz, ScalarType* WORK, OrdinalType* info) const { throw_error("STEQR"); } - void PTEQR(const char COMPZ, const OrdinalType n, ScalarType* D, ScalarType* E, ScalarType* Z, const OrdinalType ldz, ScalarType* WORK, OrdinalType* info) const { throw_error("PTEQR"); } - void HSEQR(const char JOB, const char COMPZ, const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, ScalarType* H, const OrdinalType ldh, ScalarType* WR, ScalarType* WI, ScalarType* Z, const OrdinalType ldz, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("HSEQR"); } - void GEES(const char JOBVS, const char SORT, OrdinalType (*ptr2func)(ScalarType*, ScalarType*), const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* sdim, ScalarType* WR, ScalarType* WI, ScalarType* VS, const OrdinalType ldvs, ScalarType* WORK, const OrdinalType lwork, OrdinalType* BWORK, OrdinalType* info) const { throw_error("GEES"); } - void GEES(const char JOBVS, const char SORT, OrdinalType (*ptr2func)(ScalarType*), const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* sdim, ScalarType* W, ScalarType* VS, const OrdinalType ldvs, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* BWORK, OrdinalType* info) const { throw_error("GEES"); } - void GEES(const char JOBVS, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* sdim, MagnitudeType* WR, MagnitudeType* WI, ScalarType* VS, const OrdinalType ldvs, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* BWORK, OrdinalType* info) const { throw_error("GEES"); } - void GEEV(const char JOBVL, const char JOBVR, const OrdinalType n, ScalarType* A, const OrdinalType lda, MagnitudeType* WR, MagnitudeType* WI, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info) const { throw_error("GEEV"); } - void GEEVX(const char BALANC, const char JOBVL, const char JOBVR, const char SENSE, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* WR, ScalarType* WI, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, OrdinalType* ilo, OrdinalType* ihi, MagnitudeType* SCALE, MagnitudeType* abnrm, MagnitudeType* RCONDE, MagnitudeType* RCONDV, ScalarType* WORK, const OrdinalType lwork, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GEEVX"); } - void GGEVX(const char BALANC, const char JOBVL, const char JOBVR, const char SENSE, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, MagnitudeType* ALPHAR, MagnitudeType* ALPHAI, ScalarType* BETA, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, OrdinalType* ilo, OrdinalType* ihi, MagnitudeType* lscale, MagnitudeType* rscale, MagnitudeType* abnrm, MagnitudeType* bbnrm, MagnitudeType* RCONDE, MagnitudeType* RCONDV, ScalarType* WORK, const OrdinalType lwork, OrdinalType* IWORK, OrdinalType* BWORK, OrdinalType* info) const { throw_error("GGEVX"); } - void GGEV(const char JOBVL, const char JOBVR, const OrdinalType n, ScalarType *A, const OrdinalType lda, ScalarType *B, const OrdinalType ldb, MagnitudeType *ALPHAR, MagnitudeType *ALPHAI, ScalarType *BETA, ScalarType *VL, const OrdinalType ldvl, ScalarType *VR, const OrdinalType ldvr, ScalarType *WORK, const OrdinalType lwork, OrdinalType *info) const { throw_error("GGEV"); } - void TRSEN(const char JOB, const char COMPQ, const OrdinalType *SELECT, const OrdinalType n, ScalarType *T, const OrdinalType ldt, ScalarType *Q, const OrdinalType ldq, MagnitudeType *WR, MagnitudeType *WI, OrdinalType *M, ScalarType *S, MagnitudeType *SEP, ScalarType *WORK, const OrdinalType lwork, OrdinalType *IWORK, const OrdinalType liwork, OrdinalType *info ) const { throw_error("TRSEN"); } - void TGSEN(const OrdinalType ijob, const OrdinalType wantq, const OrdinalType wantz, const OrdinalType *SELECT, const OrdinalType n, ScalarType *A, const OrdinalType lda, ScalarType *B, const OrdinalType ldb, MagnitudeType *ALPHAR, MagnitudeType *ALPHAI, MagnitudeType *BETA, ScalarType *Q, const OrdinalType ldq, ScalarType *Z, const OrdinalType ldz, OrdinalType *M, MagnitudeType *PL, MagnitudeType *PR, MagnitudeType *DIF, ScalarType *WORK, const OrdinalType lwork, OrdinalType *IWORK, const OrdinalType liwork, OrdinalType *info ) const { throw_error("TGSEN"); } - void GGES(const char JOBVL, const char JOBVR, const char SORT, OrdinalType (*ptr2func)(ScalarType *, ScalarType *, ScalarType *), const OrdinalType n, ScalarType *A, const OrdinalType lda, ScalarType *B, const OrdinalType ldb, OrdinalType *sdim, MagnitudeType *ALPHAR, MagnitudeType *ALPHAI, MagnitudeType *BETA, ScalarType *VL, const OrdinalType ldvl, ScalarType *VR, const OrdinalType ldvr, ScalarType *WORK, const OrdinalType lwork, OrdinalType *BWORK, OrdinalType *info ) const { throw_error("GGES"); } - void GESVD(const char JOBU, const char JOBVT, const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, MagnitudeType* S, ScalarType* U, const OrdinalType ldu, ScalarType* V, const OrdinalType ldv, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info) const { throw_error("GESVD"); } - void ORMQR(const char SIDE, const char TRANS, const OrdinalType m, const OrdinalType n, const OrdinalType k, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* C, const OrdinalType ldc, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("ORMQR"); } - void UNMQR(const char SIDE, const char TRANS, const OrdinalType m, const OrdinalType n, const OrdinalType k, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* C, const OrdinalType ldc, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("UNMQR"); } - void ORGQR(const OrdinalType m, const OrdinalType n, const OrdinalType k, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("ORGQR"); } - void UNGQR(const OrdinalType m, const OrdinalType n, const OrdinalType k, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("UNGQR"); } - void ORGHR(const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("ORGHR"); } - void ORMHR(const char SIDE, const char TRANS, const OrdinalType m, const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, const ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* C, const OrdinalType ldc, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("ORMHR"); } - void TREVC(const char SIDE, const char HOWMNY, OrdinalType* select, const OrdinalType n, const ScalarType* T, const OrdinalType ldt, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, const OrdinalType mm, OrdinalType* m, ScalarType* WORK, OrdinalType* info) const { throw_error("TREVC"); } - void TREVC(const char SIDE, const OrdinalType n, const ScalarType* T, const OrdinalType ldt, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, const OrdinalType mm, OrdinalType* m, ScalarType* WORK, MagnitudeType* RWORK, OrdinalType* info) const { throw_error("TREVC"); } - void TREXC(const char COMPQ, const OrdinalType n, ScalarType* T, const OrdinalType ldt, ScalarType* Q, const OrdinalType ldq, OrdinalType ifst, OrdinalType ilst, ScalarType* WORK, OrdinalType* info) const { throw_error("TREXC"); } - void TGEVC(const char SIDE, const char HOWMNY, const OrdinalType *SELECT, const OrdinalType n, ScalarType *S, const OrdinalType lds, ScalarType *P, const OrdinalType ldp, ScalarType *VL, const OrdinalType ldvl, ScalarType *VR, const OrdinalType ldvr, const OrdinalType mm, OrdinalType *M, ScalarType *WORK, OrdinalType *info) const { throw_error("TGEVC"); } - void LARTG( const ScalarType f, const ScalarType g, MagnitudeType* c, ScalarType* s, ScalarType* r ) const { throw_error("LARTG"); } - void LARFG( const OrdinalType n, ScalarType* alpha, ScalarType* x, const OrdinalType incx, ScalarType* tau ) const { throw_error("LARFG"); } - void GEBAL(const char JOBZ, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType ilo, OrdinalType ihi, MagnitudeType* scale, OrdinalType* info) const { throw_error("GEBAL"); } - void GEBAK(const char JOBZ, const char SIDE, const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, const MagnitudeType* scale , const OrdinalType m, ScalarType* V, const OrdinalType ldv, OrdinalType* info) const { throw_error("GEBAK"); } - ScalarType LARND( const OrdinalType idist, OrdinalType* seed ) const { throw_error("LARND"); return ScalarType(0); } - void LARNV( const OrdinalType idist, OrdinalType* seed, const OrdinalType n, ScalarType* v ) const { throw_error("LARNV"); } - ScalarType LAMCH(const char CMACH) const { throw_error("LAMCH"); return ScalarType(0); } - OrdinalType ILAENV( const OrdinalType ispec, const std::string& NAME, const std::string& OPTS, const OrdinalType N1 = -1, const OrdinalType N2 = -1, const OrdinalType N3 = -1, const OrdinalType N4 = -1 ) const { throw_error("ILAENV"); return OrdinalType(0); } - ScalarType LAPY2(const ScalarType x, const ScalarType y) const { throw_error("LAPY2"); return ScalarType(0); } - - private: - void throw_error(const char *func) const - { - TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error, func << ": Not implemented for Sfloat scalar type!"); - } - }; - - template class LAPACK - { - using ScalarType = Sdouble; - using MagnitudeType = Sdouble; - - public: - inline LAPACK(void) {} - inline LAPACK(const LAPACK& lapack) {} - inline virtual ~LAPACK(void) {} - - void PTTRF(const OrdinalType n, ScalarType* d, ScalarType* e, OrdinalType* info) const { throw_error("PTTRF"); } - void PTTRS(const OrdinalType n, const OrdinalType nrhs, const ScalarType* d, const ScalarType* e, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("PTTRS"); } - void POTRF(const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* info) const { throw_error("POTRF"); } - void POTRS(const char UPLO, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("POTRS"); } - void POTRI(const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* info) const { throw_error("POTRI"); } - void POCON(const char UPLO, const OrdinalType n, const ScalarType* A, const OrdinalType lda, const ScalarType anorm, ScalarType* rcond, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("POCON"); } - void POSV(const char UPLO, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("POSV"); } - /*IMPLEMENTED*/void POEQU(const OrdinalType n, const ScalarType* A, const OrdinalType lda, MagnitudeType* S, MagnitudeType* scond, MagnitudeType* amax, OrdinalType* info) const { throw_error("POEQU"); } - void PORFS(const char UPLO, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const ScalarType* AF, const OrdinalType ldaf, const ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("PORFS"); } - void POSVX(const char FACT, const char UPLO, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* AF, const OrdinalType ldaf, char EQUED, ScalarType* S, ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* rcond, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("POSVX"); } - void GELS(const char TRANS, const OrdinalType m, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GELS"); } - void GELSS(const OrdinalType m, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, MagnitudeType* S, const MagnitudeType rcond, OrdinalType* rank, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info) const { throw_error("GELSS"); } - void GELSS(const OrdinalType m, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, ScalarType* S, const ScalarType rcond, OrdinalType* rank, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GELSS"); } - void GGLSE(const OrdinalType m, const OrdinalType n, const OrdinalType p, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, ScalarType* C, ScalarType* D, ScalarType* X, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GGLSE"); } - void GEQRF( const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GEQRF"); } - void GETRF(const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* IPIV, OrdinalType* info) const { throw_error("GETRF"); } - void GETRS(const char TRANS, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const OrdinalType* IPIV, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("GETRS"); } - /*IMPLEMENTED*/void LASCL(const char TYPE, const OrdinalType kl, const OrdinalType ku, const MagnitudeType cfrom, const MagnitudeType cto, const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* info) const { throw_error("LASCL"); } - void GEQP3(const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType *jpvt, ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info ) const { throw_error("GEQP3"); } - void LASWP (const OrdinalType N, ScalarType A[], const OrdinalType LDA, const OrdinalType K1, const OrdinalType K2, const OrdinalType IPIV[], const OrdinalType INCX) const { throw_error("LASWP"); } - void GBTRF(const OrdinalType m, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, ScalarType* A, const OrdinalType lda, OrdinalType* IPIV, OrdinalType* info) const { throw_error("GBTRF"); } - void GBTRS(const char TRANS, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const OrdinalType* IPIV, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("GBTRS"); } - void GTTRF(const OrdinalType n, ScalarType* dl, ScalarType* d, ScalarType* du, ScalarType* du2, OrdinalType* IPIV, OrdinalType* info) const { throw_error("GTTRF"); } - void GTTRS(const char TRANS, const OrdinalType n, const OrdinalType nrhs, const ScalarType* dl, const ScalarType* d, const ScalarType* du, const ScalarType* du2, const OrdinalType* IPIV, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("GTTRS"); } - void GETRI(const OrdinalType n, ScalarType* A, const OrdinalType lda, const OrdinalType* IPIV, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GETRI"); } - void LATRS (const char UPLO, const char TRANS, const char DIAG, const char NORMIN, const OrdinalType N, ScalarType* A, const OrdinalType LDA, ScalarType* X, MagnitudeType* SCALE, MagnitudeType* CNORM, OrdinalType* INFO) const { throw_error("LATRS"); } - void GECON(const char NORM, const OrdinalType n, const ScalarType* A, const OrdinalType lda, const ScalarType anorm, ScalarType* rcond, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GECON"); } - void GBCON(const char NORM, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const ScalarType* A, const OrdinalType lda, OrdinalType* IPIV, const ScalarType anorm, ScalarType* rcond, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GBCON"); } - typename ScalarTraits::magnitudeType LANGB(const char NORM, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const ScalarType* A, const OrdinalType lda, MagnitudeType* WORK) const { throw_error("LANGB"); return MagnitudeType(0); } - void GESV(const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, OrdinalType* IPIV, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("GESV"); } - /*IMPLEMENTED*/void GEEQU(const OrdinalType m, const OrdinalType n, const ScalarType* A, const OrdinalType lda, ScalarType* R, ScalarType* C, ScalarType* rowcond, ScalarType* colcond, ScalarType* amax, OrdinalType* info) const { throw_error("GEEQU"); } - void GERFS(const char TRANS, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const ScalarType* AF, const OrdinalType ldaf, const OrdinalType* IPIV, const ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GERFS"); } - /*IMPLEMENTED*/void GBEQU(const OrdinalType m, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const ScalarType* A, const OrdinalType lda, MagnitudeType* R, MagnitudeType* C, MagnitudeType* rowcond, MagnitudeType* colcond, MagnitudeType* amax, OrdinalType* info) const { throw_error("GBEQU"); } - void GBRFS(const char TRANS, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const ScalarType* AF, const OrdinalType ldaf, const OrdinalType* IPIV, const ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GBRFS"); } - void GESVX(const char FACT, const char TRANS, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* AF, const OrdinalType ldaf, OrdinalType* IPIV, char EQUED, ScalarType* R, ScalarType* C, ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* rcond, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GESVX"); } - void SYTRD(const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* D, ScalarType* E, ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("SYTRD"); } - void GEHRD(const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, ScalarType* A, const OrdinalType lda, ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GEHRD"); } - void TRTRS(const char UPLO, const char TRANS, const char DIAG, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("TRTRS"); } - void TRTRI(const char UPLO, const char DIAG, const OrdinalType n, const ScalarType* A, const OrdinalType lda, OrdinalType* info) const { throw_error("TRTRI"); } - void SPEV(const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* AP, ScalarType* W, ScalarType* Z, const OrdinalType ldz, ScalarType* WORK, OrdinalType* info) const { throw_error("SPEV"); } - void SYEV(const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* W, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("SYEV"); } - void SYGV(const OrdinalType itype, const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, ScalarType* W, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("SYGV"); } - void HEEV(const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, MagnitudeType* W, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info) const { throw_error("HEEV"); } - void HEGV(const OrdinalType itype, const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, MagnitudeType* W, ScalarType* WORK, const OrdinalType lwork, MagnitudeType *RWORK, OrdinalType* info) const { throw_error("HEGV"); } - void STEQR(const char COMPZ, const OrdinalType n, ScalarType* D, ScalarType* E, ScalarType* Z, const OrdinalType ldz, ScalarType* WORK, OrdinalType* info) const { throw_error("STEQR"); } - void PTEQR(const char COMPZ, const OrdinalType n, ScalarType* D, ScalarType* E, ScalarType* Z, const OrdinalType ldz, ScalarType* WORK, OrdinalType* info) const { throw_error("PTEQR"); } - void HSEQR(const char JOB, const char COMPZ, const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, ScalarType* H, const OrdinalType ldh, ScalarType* WR, ScalarType* WI, ScalarType* Z, const OrdinalType ldz, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("HSEQR"); } - void GEES(const char JOBVS, const char SORT, OrdinalType (*ptr2func)(ScalarType*, ScalarType*), const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* sdim, ScalarType* WR, ScalarType* WI, ScalarType* VS, const OrdinalType ldvs, ScalarType* WORK, const OrdinalType lwork, OrdinalType* BWORK, OrdinalType* info) const { throw_error("GEES"); } - void GEES(const char JOBVS, const char SORT, OrdinalType (*ptr2func)(ScalarType*), const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* sdim, ScalarType* W, ScalarType* VS, const OrdinalType ldvs, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* BWORK, OrdinalType* info) const { throw_error("GEES"); } - void GEES(const char JOBVS, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* sdim, MagnitudeType* WR, MagnitudeType* WI, ScalarType* VS, const OrdinalType ldvs, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* BWORK, OrdinalType* info) const { throw_error("GEES"); } - void GEEV(const char JOBVL, const char JOBVR, const OrdinalType n, ScalarType* A, const OrdinalType lda, MagnitudeType* WR, MagnitudeType* WI, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info) const { throw_error("GEEV"); } - void GEEVX(const char BALANC, const char JOBVL, const char JOBVR, const char SENSE, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* WR, ScalarType* WI, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, OrdinalType* ilo, OrdinalType* ihi, MagnitudeType* SCALE, MagnitudeType* abnrm, MagnitudeType* RCONDE, MagnitudeType* RCONDV, ScalarType* WORK, const OrdinalType lwork, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GEEVX"); } - void GGEVX(const char BALANC, const char JOBVL, const char JOBVR, const char SENSE, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, MagnitudeType* ALPHAR, MagnitudeType* ALPHAI, ScalarType* BETA, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, OrdinalType* ilo, OrdinalType* ihi, MagnitudeType* lscale, MagnitudeType* rscale, MagnitudeType* abnrm, MagnitudeType* bbnrm, MagnitudeType* RCONDE, MagnitudeType* RCONDV, ScalarType* WORK, const OrdinalType lwork, OrdinalType* IWORK, OrdinalType* BWORK, OrdinalType* info) const { throw_error("GGEVX"); } - void GGEV(const char JOBVL, const char JOBVR, const OrdinalType n, ScalarType *A, const OrdinalType lda, ScalarType *B, const OrdinalType ldb, MagnitudeType *ALPHAR, MagnitudeType *ALPHAI, ScalarType *BETA, ScalarType *VL, const OrdinalType ldvl, ScalarType *VR, const OrdinalType ldvr, ScalarType *WORK, const OrdinalType lwork, OrdinalType *info) const { throw_error("GGEV"); } - void TRSEN(const char JOB, const char COMPQ, const OrdinalType *SELECT, const OrdinalType n, ScalarType *T, const OrdinalType ldt, ScalarType *Q, const OrdinalType ldq, MagnitudeType *WR, MagnitudeType *WI, OrdinalType *M, ScalarType *S, MagnitudeType *SEP, ScalarType *WORK, const OrdinalType lwork, OrdinalType *IWORK, const OrdinalType liwork, OrdinalType *info ) const { throw_error("TRSEN"); } - void TGSEN(const OrdinalType ijob, const OrdinalType wantq, const OrdinalType wantz, const OrdinalType *SELECT, const OrdinalType n, ScalarType *A, const OrdinalType lda, ScalarType *B, const OrdinalType ldb, MagnitudeType *ALPHAR, MagnitudeType *ALPHAI, MagnitudeType *BETA, ScalarType *Q, const OrdinalType ldq, ScalarType *Z, const OrdinalType ldz, OrdinalType *M, MagnitudeType *PL, MagnitudeType *PR, MagnitudeType *DIF, ScalarType *WORK, const OrdinalType lwork, OrdinalType *IWORK, const OrdinalType liwork, OrdinalType *info ) const { throw_error("TGSEN"); } - void GGES(const char JOBVL, const char JOBVR, const char SORT, OrdinalType (*ptr2func)(ScalarType *, ScalarType *, ScalarType *), const OrdinalType n, ScalarType *A, const OrdinalType lda, ScalarType *B, const OrdinalType ldb, OrdinalType *sdim, MagnitudeType *ALPHAR, MagnitudeType *ALPHAI, MagnitudeType *BETA, ScalarType *VL, const OrdinalType ldvl, ScalarType *VR, const OrdinalType ldvr, ScalarType *WORK, const OrdinalType lwork, OrdinalType *BWORK, OrdinalType *info ) const { throw_error("GGES"); } - void GESVD(const char JOBU, const char JOBVT, const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, MagnitudeType* S, ScalarType* U, const OrdinalType ldu, ScalarType* V, const OrdinalType ldv, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info) const { throw_error("GESVD"); } - void ORMQR(const char SIDE, const char TRANS, const OrdinalType m, const OrdinalType n, const OrdinalType k, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* C, const OrdinalType ldc, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("ORMQR"); } - void UNMQR(const char SIDE, const char TRANS, const OrdinalType m, const OrdinalType n, const OrdinalType k, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* C, const OrdinalType ldc, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("UNMQR"); } - void ORGQR(const OrdinalType m, const OrdinalType n, const OrdinalType k, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("ORGQR"); } - void UNGQR(const OrdinalType m, const OrdinalType n, const OrdinalType k, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("UNGQR"); } - void ORGHR(const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("ORGHR"); } - void ORMHR(const char SIDE, const char TRANS, const OrdinalType m, const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, const ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* C, const OrdinalType ldc, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("ORMHR"); } - void TREVC(const char SIDE, const char HOWMNY, OrdinalType* select, const OrdinalType n, const ScalarType* T, const OrdinalType ldt, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, const OrdinalType mm, OrdinalType* m, ScalarType* WORK, OrdinalType* info) const { throw_error("TREVC"); } - void TREVC(const char SIDE, const OrdinalType n, const ScalarType* T, const OrdinalType ldt, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, const OrdinalType mm, OrdinalType* m, ScalarType* WORK, MagnitudeType* RWORK, OrdinalType* info) const { throw_error("TREVC"); } - void TREXC(const char COMPQ, const OrdinalType n, ScalarType* T, const OrdinalType ldt, ScalarType* Q, const OrdinalType ldq, OrdinalType ifst, OrdinalType ilst, ScalarType* WORK, OrdinalType* info) const { throw_error("TREXC"); } - void TGEVC(const char SIDE, const char HOWMNY, const OrdinalType *SELECT, const OrdinalType n, ScalarType *S, const OrdinalType lds, ScalarType *P, const OrdinalType ldp, ScalarType *VL, const OrdinalType ldvl, ScalarType *VR, const OrdinalType ldvr, const OrdinalType mm, OrdinalType *M, ScalarType *WORK, OrdinalType *info) const { throw_error("TGEVC"); } - void LARTG( const ScalarType f, const ScalarType g, MagnitudeType* c, ScalarType* s, ScalarType* r ) const { throw_error("LARTG"); } - void LARFG( const OrdinalType n, ScalarType* alpha, ScalarType* x, const OrdinalType incx, ScalarType* tau ) const { throw_error("LARFG"); } - void GEBAL(const char JOBZ, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType ilo, OrdinalType ihi, MagnitudeType* scale, OrdinalType* info) const { throw_error("GEBAL"); } - void GEBAK(const char JOBZ, const char SIDE, const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, const MagnitudeType* scale , const OrdinalType m, ScalarType* V, const OrdinalType ldv, OrdinalType* info) const { throw_error("GEBAK"); } - ScalarType LARND( const OrdinalType idist, OrdinalType* seed ) const { throw_error("LARND"); return ScalarType(0); } - void LARNV( const OrdinalType idist, OrdinalType* seed, const OrdinalType n, ScalarType* v ) const { throw_error("LARNV"); } - ScalarType LAMCH(const char CMACH) const { throw_error("LAMCH"); return ScalarType(0); } - OrdinalType ILAENV( const OrdinalType ispec, const std::string& NAME, const std::string& OPTS, const OrdinalType N1 = -1, const OrdinalType N2 = -1, const OrdinalType N3 = -1, const OrdinalType N4 = -1 ) const { throw_error("ILAENV"); return OrdinalType(0); } - ScalarType LAPY2(const ScalarType x, const ScalarType y) const { throw_error("LAPY2"); return ScalarType(0); } - - private: - void throw_error(const char *func) const - { - TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error, func << ": Not implemented for Sdouble scalar type!"); - } - }; - - template class LAPACK - { - using ScalarType = Slong_double; - using MagnitudeType = Slong_double; - - public: - inline LAPACK(void) {} - inline LAPACK(const LAPACK& lapack) {} - inline virtual ~LAPACK(void) {} - - void PTTRF(const OrdinalType n, ScalarType* d, ScalarType* e, OrdinalType* info) const { throw_error("PTTRF"); } - void PTTRS(const OrdinalType n, const OrdinalType nrhs, const ScalarType* d, const ScalarType* e, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("PTTRS"); } - void POTRF(const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* info) const { throw_error("POTRF"); } - void POTRS(const char UPLO, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("POTRS"); } - void POTRI(const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* info) const { throw_error("POTRI"); } - void POCON(const char UPLO, const OrdinalType n, const ScalarType* A, const OrdinalType lda, const ScalarType anorm, ScalarType* rcond, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("POCON"); } - void POSV(const char UPLO, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("POSV"); } - /*IMPLEMENTED*/void POEQU(const OrdinalType n, const ScalarType* A, const OrdinalType lda, MagnitudeType* S, MagnitudeType* scond, MagnitudeType* amax, OrdinalType* info) const { throw_error("POEQU"); } - void PORFS(const char UPLO, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const ScalarType* AF, const OrdinalType ldaf, const ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("PORFS"); } - void POSVX(const char FACT, const char UPLO, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* AF, const OrdinalType ldaf, char EQUED, ScalarType* S, ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* rcond, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("POSVX"); } - void GELS(const char TRANS, const OrdinalType m, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GELS"); } - void GELSS(const OrdinalType m, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, MagnitudeType* S, const MagnitudeType rcond, OrdinalType* rank, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info) const { throw_error("GELSS"); } - void GELSS(const OrdinalType m, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, ScalarType* S, const ScalarType rcond, OrdinalType* rank, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GELSS"); } - void GGLSE(const OrdinalType m, const OrdinalType n, const OrdinalType p, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, ScalarType* C, ScalarType* D, ScalarType* X, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GGLSE"); } - void GEQRF( const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GEQRF"); } - void GETRF(const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* IPIV, OrdinalType* info) const { throw_error("GETRF"); } - void GETRS(const char TRANS, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const OrdinalType* IPIV, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("GETRS"); } - /*IMPLEMENTED*/void LASCL(const char TYPE, const OrdinalType kl, const OrdinalType ku, const MagnitudeType cfrom, const MagnitudeType cto, const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* info) const { throw_error("LASCL"); } - void GEQP3(const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType *jpvt, ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info ) const { throw_error("GEQP3"); } - void LASWP (const OrdinalType N, ScalarType A[], const OrdinalType LDA, const OrdinalType K1, const OrdinalType K2, const OrdinalType IPIV[], const OrdinalType INCX) const { throw_error("LASWP"); } - void GBTRF(const OrdinalType m, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, ScalarType* A, const OrdinalType lda, OrdinalType* IPIV, OrdinalType* info) const { throw_error("GBTRF"); } - void GBTRS(const char TRANS, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const OrdinalType* IPIV, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("GBTRS"); } - void GTTRF(const OrdinalType n, ScalarType* dl, ScalarType* d, ScalarType* du, ScalarType* du2, OrdinalType* IPIV, OrdinalType* info) const { throw_error("GTTRF"); } - void GTTRS(const char TRANS, const OrdinalType n, const OrdinalType nrhs, const ScalarType* dl, const ScalarType* d, const ScalarType* du, const ScalarType* du2, const OrdinalType* IPIV, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("GTTRS"); } - void GETRI(const OrdinalType n, ScalarType* A, const OrdinalType lda, const OrdinalType* IPIV, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GETRI"); } - void LATRS (const char UPLO, const char TRANS, const char DIAG, const char NORMIN, const OrdinalType N, ScalarType* A, const OrdinalType LDA, ScalarType* X, MagnitudeType* SCALE, MagnitudeType* CNORM, OrdinalType* INFO) const { throw_error("LATRS"); } - void GECON(const char NORM, const OrdinalType n, const ScalarType* A, const OrdinalType lda, const ScalarType anorm, ScalarType* rcond, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GECON"); } - void GBCON(const char NORM, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const ScalarType* A, const OrdinalType lda, OrdinalType* IPIV, const ScalarType anorm, ScalarType* rcond, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GBCON"); } - typename ScalarTraits::magnitudeType LANGB(const char NORM, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const ScalarType* A, const OrdinalType lda, MagnitudeType* WORK) const { throw_error("LANGB"); return MagnitudeType(0); } - void GESV(const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, OrdinalType* IPIV, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("GESV"); } - /*IMPLEMENTED*/void GEEQU(const OrdinalType m, const OrdinalType n, const ScalarType* A, const OrdinalType lda, ScalarType* R, ScalarType* C, ScalarType* rowcond, ScalarType* colcond, ScalarType* amax, OrdinalType* info) const { throw_error("GEEQU"); } - void GERFS(const char TRANS, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const ScalarType* AF, const OrdinalType ldaf, const OrdinalType* IPIV, const ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GERFS"); } - /*IMPLEMENTED*/void GBEQU(const OrdinalType m, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const ScalarType* A, const OrdinalType lda, MagnitudeType* R, MagnitudeType* C, MagnitudeType* rowcond, MagnitudeType* colcond, MagnitudeType* amax, OrdinalType* info) const { throw_error("GBEQU"); } - void GBRFS(const char TRANS, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const ScalarType* AF, const OrdinalType ldaf, const OrdinalType* IPIV, const ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GBRFS"); } - void GESVX(const char FACT, const char TRANS, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* AF, const OrdinalType ldaf, OrdinalType* IPIV, char EQUED, ScalarType* R, ScalarType* C, ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* rcond, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GESVX"); } - void SYTRD(const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* D, ScalarType* E, ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("SYTRD"); } - void GEHRD(const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, ScalarType* A, const OrdinalType lda, ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("GEHRD"); } - void TRTRS(const char UPLO, const char TRANS, const char DIAG, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const { throw_error("TRTRS"); } - void TRTRI(const char UPLO, const char DIAG, const OrdinalType n, const ScalarType* A, const OrdinalType lda, OrdinalType* info) const { throw_error("TRTRI"); } - void SPEV(const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* AP, ScalarType* W, ScalarType* Z, const OrdinalType ldz, ScalarType* WORK, OrdinalType* info) const { throw_error("SPEV"); } - void SYEV(const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* W, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("SYEV"); } - void SYGV(const OrdinalType itype, const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, ScalarType* W, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("SYGV"); } - void HEEV(const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, MagnitudeType* W, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info) const { throw_error("HEEV"); } - void HEGV(const OrdinalType itype, const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, MagnitudeType* W, ScalarType* WORK, const OrdinalType lwork, MagnitudeType *RWORK, OrdinalType* info) const { throw_error("HEGV"); } - void STEQR(const char COMPZ, const OrdinalType n, ScalarType* D, ScalarType* E, ScalarType* Z, const OrdinalType ldz, ScalarType* WORK, OrdinalType* info) const { throw_error("STEQR"); } - void PTEQR(const char COMPZ, const OrdinalType n, ScalarType* D, ScalarType* E, ScalarType* Z, const OrdinalType ldz, ScalarType* WORK, OrdinalType* info) const { throw_error("PTEQR"); } - void HSEQR(const char JOB, const char COMPZ, const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, ScalarType* H, const OrdinalType ldh, ScalarType* WR, ScalarType* WI, ScalarType* Z, const OrdinalType ldz, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("HSEQR"); } - void GEES(const char JOBVS, const char SORT, OrdinalType (*ptr2func)(ScalarType*, ScalarType*), const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* sdim, ScalarType* WR, ScalarType* WI, ScalarType* VS, const OrdinalType ldvs, ScalarType* WORK, const OrdinalType lwork, OrdinalType* BWORK, OrdinalType* info) const { throw_error("GEES"); } - void GEES(const char JOBVS, const char SORT, OrdinalType (*ptr2func)(ScalarType*), const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* sdim, ScalarType* W, ScalarType* VS, const OrdinalType ldvs, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* BWORK, OrdinalType* info) const { throw_error("GEES"); } - void GEES(const char JOBVS, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* sdim, MagnitudeType* WR, MagnitudeType* WI, ScalarType* VS, const OrdinalType ldvs, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* BWORK, OrdinalType* info) const { throw_error("GEES"); } - void GEEV(const char JOBVL, const char JOBVR, const OrdinalType n, ScalarType* A, const OrdinalType lda, MagnitudeType* WR, MagnitudeType* WI, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info) const { throw_error("GEEV"); } - void GEEVX(const char BALANC, const char JOBVL, const char JOBVR, const char SENSE, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* WR, ScalarType* WI, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, OrdinalType* ilo, OrdinalType* ihi, MagnitudeType* SCALE, MagnitudeType* abnrm, MagnitudeType* RCONDE, MagnitudeType* RCONDV, ScalarType* WORK, const OrdinalType lwork, OrdinalType* IWORK, OrdinalType* info) const { throw_error("GEEVX"); } - void GGEVX(const char BALANC, const char JOBVL, const char JOBVR, const char SENSE, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, MagnitudeType* ALPHAR, MagnitudeType* ALPHAI, ScalarType* BETA, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, OrdinalType* ilo, OrdinalType* ihi, MagnitudeType* lscale, MagnitudeType* rscale, MagnitudeType* abnrm, MagnitudeType* bbnrm, MagnitudeType* RCONDE, MagnitudeType* RCONDV, ScalarType* WORK, const OrdinalType lwork, OrdinalType* IWORK, OrdinalType* BWORK, OrdinalType* info) const { throw_error("GGEVX"); } - void GGEV(const char JOBVL, const char JOBVR, const OrdinalType n, ScalarType *A, const OrdinalType lda, ScalarType *B, const OrdinalType ldb, MagnitudeType *ALPHAR, MagnitudeType *ALPHAI, ScalarType *BETA, ScalarType *VL, const OrdinalType ldvl, ScalarType *VR, const OrdinalType ldvr, ScalarType *WORK, const OrdinalType lwork, OrdinalType *info) const { throw_error("GGEV"); } - void TRSEN(const char JOB, const char COMPQ, const OrdinalType *SELECT, const OrdinalType n, ScalarType *T, const OrdinalType ldt, ScalarType *Q, const OrdinalType ldq, MagnitudeType *WR, MagnitudeType *WI, OrdinalType *M, ScalarType *S, MagnitudeType *SEP, ScalarType *WORK, const OrdinalType lwork, OrdinalType *IWORK, const OrdinalType liwork, OrdinalType *info ) const { throw_error("TRSEN"); } - void TGSEN(const OrdinalType ijob, const OrdinalType wantq, const OrdinalType wantz, const OrdinalType *SELECT, const OrdinalType n, ScalarType *A, const OrdinalType lda, ScalarType *B, const OrdinalType ldb, MagnitudeType *ALPHAR, MagnitudeType *ALPHAI, MagnitudeType *BETA, ScalarType *Q, const OrdinalType ldq, ScalarType *Z, const OrdinalType ldz, OrdinalType *M, MagnitudeType *PL, MagnitudeType *PR, MagnitudeType *DIF, ScalarType *WORK, const OrdinalType lwork, OrdinalType *IWORK, const OrdinalType liwork, OrdinalType *info ) const { throw_error("TGSEN"); } - void GGES(const char JOBVL, const char JOBVR, const char SORT, OrdinalType (*ptr2func)(ScalarType *, ScalarType *, ScalarType *), const OrdinalType n, ScalarType *A, const OrdinalType lda, ScalarType *B, const OrdinalType ldb, OrdinalType *sdim, MagnitudeType *ALPHAR, MagnitudeType *ALPHAI, MagnitudeType *BETA, ScalarType *VL, const OrdinalType ldvl, ScalarType *VR, const OrdinalType ldvr, ScalarType *WORK, const OrdinalType lwork, OrdinalType *BWORK, OrdinalType *info ) const { throw_error("GGES"); } - void GESVD(const char JOBU, const char JOBVT, const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, MagnitudeType* S, ScalarType* U, const OrdinalType ldu, ScalarType* V, const OrdinalType ldv, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info) const { throw_error("GESVD"); } - void ORMQR(const char SIDE, const char TRANS, const OrdinalType m, const OrdinalType n, const OrdinalType k, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* C, const OrdinalType ldc, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("ORMQR"); } - void UNMQR(const char SIDE, const char TRANS, const OrdinalType m, const OrdinalType n, const OrdinalType k, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* C, const OrdinalType ldc, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("UNMQR"); } - void ORGQR(const OrdinalType m, const OrdinalType n, const OrdinalType k, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("ORGQR"); } - void UNGQR(const OrdinalType m, const OrdinalType n, const OrdinalType k, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("UNGQR"); } - void ORGHR(const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("ORGHR"); } - void ORMHR(const char SIDE, const char TRANS, const OrdinalType m, const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, const ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* C, const OrdinalType ldc, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const { throw_error("ORMHR"); } - void TREVC(const char SIDE, const char HOWMNY, OrdinalType* select, const OrdinalType n, const ScalarType* T, const OrdinalType ldt, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, const OrdinalType mm, OrdinalType* m, ScalarType* WORK, OrdinalType* info) const { throw_error("TREVC"); } - void TREVC(const char SIDE, const OrdinalType n, const ScalarType* T, const OrdinalType ldt, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, const OrdinalType mm, OrdinalType* m, ScalarType* WORK, MagnitudeType* RWORK, OrdinalType* info) const { throw_error("TREVC"); } - void TREXC(const char COMPQ, const OrdinalType n, ScalarType* T, const OrdinalType ldt, ScalarType* Q, const OrdinalType ldq, OrdinalType ifst, OrdinalType ilst, ScalarType* WORK, OrdinalType* info) const { throw_error("TREXC"); } - void TGEVC(const char SIDE, const char HOWMNY, const OrdinalType *SELECT, const OrdinalType n, ScalarType *S, const OrdinalType lds, ScalarType *P, const OrdinalType ldp, ScalarType *VL, const OrdinalType ldvl, ScalarType *VR, const OrdinalType ldvr, const OrdinalType mm, OrdinalType *M, ScalarType *WORK, OrdinalType *info) const { throw_error("TGEVC"); } - void LARTG( const ScalarType f, const ScalarType g, MagnitudeType* c, ScalarType* s, ScalarType* r ) const { throw_error("LARTG"); } - void LARFG( const OrdinalType n, ScalarType* alpha, ScalarType* x, const OrdinalType incx, ScalarType* tau ) const { throw_error("LARFG"); } - void GEBAL(const char JOBZ, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType ilo, OrdinalType ihi, MagnitudeType* scale, OrdinalType* info) const { throw_error("GEBAL"); } - void GEBAK(const char JOBZ, const char SIDE, const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, const MagnitudeType* scale , const OrdinalType m, ScalarType* V, const OrdinalType ldv, OrdinalType* info) const { throw_error("GEBAK"); } - ScalarType LARND( const OrdinalType idist, OrdinalType* seed ) const { throw_error("LARND"); return ScalarType(0); } - void LARNV( const OrdinalType idist, OrdinalType* seed, const OrdinalType n, ScalarType* v ) const { throw_error("LARNV"); } - ScalarType LAMCH(const char CMACH) const { throw_error("LAMCH"); return ScalarType(0); } - OrdinalType ILAENV( const OrdinalType ispec, const std::string& NAME, const std::string& OPTS, const OrdinalType N1 = -1, const OrdinalType N2 = -1, const OrdinalType N3 = -1, const OrdinalType N4 = -1 ) const { throw_error("ILAENV"); return OrdinalType(0); } - ScalarType LAPY2(const ScalarType x, const ScalarType y) const { throw_error("LAPY2"); return ScalarType(0); } - - private: - void throw_error(const char *func) const - { - TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error, func << ": Not implemented for Slong_double scalar type!"); - } - }; -} - diff --git a/src/shaman/helpers/trilinos/reductionTraits_kokkos.h b/src/shaman/helpers/trilinos/reductionTraits_kokkos.h deleted file mode 100644 index 6b89dae..0000000 --- a/src/shaman/helpers/trilinos/reductionTraits_kokkos.h +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once - -#include - -/* - * used for parallel reduce - */ -namespace Kokkos -{ - template<> - struct reduction_identity { - KOKKOS_FORCEINLINE_FUNCTION static Sfloat sum() {return static_cast(0.0f);} - KOKKOS_FORCEINLINE_FUNCTION static Sfloat prod() {return static_cast(1.0f);} - KOKKOS_FORCEINLINE_FUNCTION static Sfloat max() {return -FLT_MAX;} - KOKKOS_FORCEINLINE_FUNCTION static Sfloat min() {return FLT_MAX;} - }; - - template<> - struct reduction_identity { - KOKKOS_FORCEINLINE_FUNCTION static Sdouble sum() {return static_cast(0.0);} - KOKKOS_FORCEINLINE_FUNCTION static Sdouble prod() {return static_cast(1.0);} - KOKKOS_FORCEINLINE_FUNCTION static Sdouble max() {return -DBL_MAX;} - KOKKOS_FORCEINLINE_FUNCTION static Sdouble min() {return DBL_MAX;} - }; - - template<> - struct reduction_identity { - KOKKOS_FORCEINLINE_FUNCTION static Slong_double sum() {return static_cast(0.0L);} - KOKKOS_FORCEINLINE_FUNCTION static Slong_double prod() {return static_cast(1.0L);} - KOKKOS_FORCEINLINE_FUNCTION static Slong_double max() {return -LDBL_MAX;} - KOKKOS_FORCEINLINE_FUNCTION static Slong_double min() {return LDBL_MAX;} - }; -} - diff --git a/src/shaman/helpers/trilinos/scalarTraits_teuchos.h b/src/shaman/helpers/trilinos/scalarTraits_teuchos.h deleted file mode 100644 index d7996d9..0000000 --- a/src/shaman/helpers/trilinos/scalarTraits_teuchos.h +++ /dev/null @@ -1,157 +0,0 @@ -#pragma once - -#include - -/* - * defines traits needed by Tpetra to do computations with a user-defined type - * see Teuchos_ScalarTraits.hpp for examples - */ -namespace Teuchos -{ - template<> - struct ScalarTraits - { - typedef Sfloat magnitudeType; - typedef Sfloat halfPrecision; // no half float - typedef Sdouble doublePrecision; - typedef Sfloat coordinateType; - - static const bool isComplex = false; - static const bool isOrdinal = false; - static const bool isComparable = true; - static const bool hasMachineParameters = true; - - static inline Sfloat eps() { return std::numeric_limits::epsilon(); } - static inline Sfloat sfmin() { return std::numeric_limits::min(); } - static inline Sfloat base() { return static_cast(std::numeric_limits::radix); } - static inline Sfloat prec() { return eps()*base(); } - static inline Sfloat t() { return static_cast(std::numeric_limits::digits); } - static inline Sfloat rnd() { return one(); } - static inline Sfloat emin() { return static_cast(std::numeric_limits::min_exponent); } - static inline Sfloat rmin() { return std::numeric_limits::min(); } - static inline Sfloat emax() { return static_cast(std::numeric_limits::max_exponent); } - static inline Sfloat rmax() { return std::numeric_limits::max(); } - static inline magnitudeType magnitude(Sfloat a) { return Sstd::abs(a); } - static inline Sfloat zero() { return 0.0f; } - static inline Sfloat one() { return 1.0f; } - static inline Sfloat conjugate(Sfloat x) { return(x); } - static inline Sfloat real(Sfloat x) { return x; } - static inline Sfloat imag(Sfloat) { return zero(); } - static inline Sfloat nan() { return std::numeric_limits::quiet_NaN(); } - static inline bool isnaninf(Sfloat x) { return Sstd::isnan(x) || Sstd::isinf(x); } - static inline std::string name() { return "Sfloat"; } - static inline Sfloat squareroot(Sfloat x) { return Sstd::sqrt(x); } - static inline Sfloat pow(Sfloat x, Sfloat y) { return Sstd::pow(x,y); } - static inline Sfloat pi() { return 3.14159265358979323846f; } - static inline Sfloat log(Sfloat x) { return Sstd::log(x); } - static inline Sfloat log10(Sfloat x) { return Sstd::log10(x); } - static inline Sfloat random() { float rnd = (float) std::rand() / RAND_MAX; return -1.0f + 2.0f * rnd; } - static inline void seedrandom(unsigned int s) { - std::srand(s); - #ifdef __APPLE__ - // throw away first random number to address bug 3655 - // http://software.sandia.gov/bugzilla/show_bug.cgi?id=3655 - random(); - #endif - } - }; - - template<> struct ScalarTraits - { - typedef Sdouble magnitudeType; - typedef Sdouble coordinateType; - typedef Sfloat halfPrecision; - #if defined(HAVE_TEUCHOS_DOUBLE_TO_QD) || defined(HAVE_TEUCHOS_DOUBLE_TO_ARPREC) - typedef Slong_double doublePrecision; // using Slong_double instead of dd_real or mp_real - #else - typedef Sdouble doublePrecision; - #endif - - static const bool isComplex = false; - static const bool isOrdinal = false; - static const bool isComparable = true; - static const bool hasMachineParameters = true; - - static inline Sdouble eps() { return std::numeric_limits::epsilon(); } - static inline Sdouble sfmin() { return std::numeric_limits::min(); } - static inline Sdouble base() { return std::numeric_limits::radix; } - static inline Sdouble prec() { return eps()*base(); } - static inline Sdouble t() { return std::numeric_limits::digits; } - static inline Sdouble rnd() { return one(); } - static inline Sdouble emin() { return std::numeric_limits::min_exponent; } - static inline Sdouble rmin() { return std::numeric_limits::min(); } - static inline Sdouble emax() { return std::numeric_limits::max_exponent; } - static inline Sdouble rmax() { return std::numeric_limits::max(); } - static inline magnitudeType magnitude(Sdouble a) { return Sstd::abs(a); } - static inline Sdouble zero() { return 0.0; } - static inline Sdouble one() { return 1.0; } - static inline Sdouble conjugate(Sdouble x) { return(x); } - static inline Sdouble real(Sdouble x) { return(x); } - static inline Sdouble imag(Sdouble) { return zero(); } - static inline Sdouble nan() { return std::numeric_limits::quiet_NaN(); } - static inline bool isnaninf(Sdouble x) { return Sstd::isnan(x) || Sstd::isinf(x); } - static inline std::string name() { return "Sdouble"; } - static inline Sdouble squareroot(Sdouble x) { return Sstd::sqrt(x); } - static inline Sdouble pow(Sdouble x, Sdouble y) { return Sstd::pow(x,y); } - static inline Sdouble pi() { return 3.14159265358979323846; } - static inline Sdouble log(Sdouble x) { return Sstd::log(x); } - static inline Sdouble log10(Sdouble x) { return Sstd::log10(x); } - static inline Sdouble random() { double rnd = (double) std::rand() / RAND_MAX; return -1.0 + 2.0 * rnd; } - static inline void seedrandom(unsigned int s) { - std::srand(s); - #ifdef __APPLE__ - // throw away first random number to address bug 3655 - // http://software.sandia.gov/bugzilla/show_bug.cgi?id=3655 - random(); - #endif - } - }; - - template<> struct ScalarTraits - { - typedef Slong_double magnitudeType; - typedef Slong_double coordinateType; - typedef Sdouble halfPrecision; - typedef Slong_double doublePrecision; // no long long double - - static const bool isComplex = false; - static const bool isOrdinal = false; - static const bool isComparable = true; - static const bool hasMachineParameters = true; - - static inline Slong_double eps() { return std::numeric_limits::epsilon(); } - static inline Slong_double sfmin() { return std::numeric_limits::min(); } - static inline Slong_double base() { return std::numeric_limits::radix; } - static inline Slong_double prec() { return eps()*base(); } - static inline Slong_double t() { return std::numeric_limits::digits; } - static inline Slong_double rnd() { return one(); } - static inline Slong_double emin() { return std::numeric_limits::min_exponent; } - static inline Slong_double rmin() { return std::numeric_limits::min(); } - static inline Slong_double emax() { return std::numeric_limits::max_exponent; } - static inline Slong_double rmax() { return std::numeric_limits::max(); } - static inline magnitudeType magnitude(Slong_double a) { return Sstd::abs(a); } - static inline Slong_double zero() { return 0.0L; } - static inline Slong_double one() { return 1.0L; } - static inline Slong_double conjugate(Slong_double x) { return(x); } - static inline Slong_double real(Slong_double x) { return(x); } - static inline Slong_double imag(Slong_double) { return zero(); } - static inline Slong_double nan() { return std::numeric_limits::quiet_NaN(); } - static inline bool isnaninf(Slong_double x) { return Sstd::isnan(x) || Sstd::isinf(x); } - static inline std::string name() { return "Slong_double"; } - static inline Slong_double squareroot(Slong_double x) { return Sstd::sqrt(x); } - static inline Slong_double pow(Slong_double x, Slong_double y) { return Sstd::pow(x,y); } - static inline Slong_double pi() { return 3.14159265358979323846L; } - static inline Slong_double log(Slong_double x) { return Sstd::log(x); } - static inline Slong_double log10(Slong_double x) { return Sstd::log10(x); } - static inline Slong_double random() { long double rnd = (long double) std::rand() / RAND_MAX; return -1.0L + 2.0L * rnd; } - static inline void seedrandom(unsigned int s) { - std::srand(s); - #ifdef __APPLE__ - // throw away first random number to address bug 3655 - // http://software.sandia.gov/bugzilla/show_bug.cgi?id=3655 - random(); - #endif - } - }; -} - diff --git a/src/shaman/helpers/trilinos/serializationTraits_teuchos.h b/src/shaman/helpers/trilinos/serializationTraits_teuchos.h deleted file mode 100644 index 53b1827..0000000 --- a/src/shaman/helpers/trilinos/serializationTraits_teuchos.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include - -/* - * defines traits needed by Tpetra to serialize a user-defined type - * see Teuchos_SerializationTraits.hpp - * TODO probably invalid - */ -namespace Teuchos -{ - template - class SerializationTraits : public DirectSerializationTraits - {}; - - template - class SerializationTraits : public DirectSerializationTraits - {}; - - template - class SerializationTraits : public DirectSerializationTraits - {}; -} -