///////////////////////////////////////////////////////////////////// // = NMatrix // // A linear algebra library for scientific computation in Ruby. // NMatrix is part of SciRuby. // // NMatrix was originally inspired by and derived from NArray, by // Masahiro Tanaka: http://narray.rubyforge.org // // == Copyright Information // // SciRuby is Copyright (c) 2010 - present, Ruby Science Foundation // NMatrix is Copyright (c) 2012 - present, John Woods and the Ruby Science Foundation // // Please see LICENSE.txt for additional copyright notices. // // == Contributing // // By contributing source code to SciRuby, you agree to be bound by // our Contributor Agreement: // // * https://github.com/SciRuby/sciruby/wiki/Contributor-Agreement // // == long_dtype.h // // Declarations necessary for the native versions of GEMM and GEMV, // as well as for IMAX. // #ifndef LONG_DTYPE_H #define LONG_DTYPE_H namespace nm { namespace math { // These allow an increase in precision for intermediate values of gemm and gemv. // See also: http://stackoverflow.com/questions/11873694/how-does-one-increase-precision-in-c-templates-in-a-template-typename-dependen template struct LongDType; template <> struct LongDType { typedef int16_t type; }; template <> struct LongDType { typedef int16_t type; }; template <> struct LongDType { typedef int32_t type; }; template <> struct LongDType { typedef int64_t type; }; template <> struct LongDType { typedef int64_t type; }; template <> struct LongDType { typedef double type; }; template <> struct LongDType { typedef double type; }; template <> struct LongDType { typedef Complex128 type; }; template <> struct LongDType { typedef Complex128 type; }; template <> struct LongDType { typedef RubyObject type; }; template struct MagnitudeDType; template <> struct MagnitudeDType { typedef uint8_t type; }; template <> struct MagnitudeDType { typedef int8_t type; }; template <> struct MagnitudeDType { typedef int16_t type; }; template <> struct MagnitudeDType { typedef int32_t type; }; template <> struct MagnitudeDType { typedef int64_t type; }; template <> struct MagnitudeDType { typedef float type; }; template <> struct MagnitudeDType { typedef double type; }; template <> struct MagnitudeDType { typedef float type; }; template <> struct MagnitudeDType { typedef double type; }; template <> struct MagnitudeDType { typedef RubyObject type; }; }} // end of namespace nm::math #endif