// Copyright 2016, Tobias Hermann. // https://github.com/Dobiasd/frugally-deep // Distributed under the MIT License. // (See accompanying LICENSE file or at // https://opensource.org/licenses/MIT) #pragma once #if defined(__GNUC__) || defined(__GNUG__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wctor-dtor-privacy" #pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wsign-conversion" #pragma GCC diagnostic ignored "-Weffc++" #pragma GCC diagnostic ignored "-Wconversion" #pragma GCC diagnostic ignored "-Wshadow" #endif #if defined _MSC_VER #pragma warning(push) #pragma warning(disable : 4706) #pragma warning(disable : 4996) #endif #include #if defined _MSC_VER #pragma warning(pop) #endif #if defined(__GNUC__) || defined(__GNUG__) #pragma GCC diagnostic pop #endif #include #include #include #include #include #include #if defined(__GNUC__) || defined(__GNUG__) #define FDEEP_FORCE_INLINE __attribute__((always_inline)) inline #elif defined(_MSC_VER) #define FDEEP_FORCE_INLINE __forceinline #else #define FDEEP_FORCE_INLINE inline #endif namespace fdeep { namespace internal { inline std::runtime_error error(const std::string& error) { return std::runtime_error(error); } inline void raise_error(const std::string& msg) { throw error(msg); } inline void assertion(bool cond, const std::string& error) { if (!cond) { raise_error(error); } } #ifdef FDEEP_FLOAT_TYPE typedef FDEEP_FLOAT_TYPE float_type; #else typedef float float_type; #endif #if EIGEN_VERSION_AT_LEAST(3,3,0) typedef Eigen::Index EigenIndex; #else typedef Eigen::DenseIndex EigenIndex; #endif typedef std::vector float_vec; typedef fplus::shared_ref shared_float_vec; using ColMajorMatrixXf = Eigen::Matrix; using RowMajorMatrixXf = Eigen::Matrix; } } // namespace fdeep, namespace internal