text: //==============================================================================
  //         Copyright 2003 - 2011 LASMEA UMR 6602 CNRS/Univ. Clermont II
  //         Copyright 2009 - 2011 LRI    UMR 8623 CNRS/Univ Paris Sud XI
  //
  //          Distributed under the Boost Software License, Version 1.0.
  //                 See accompanying file LICENSE.txt or copy at
  //                     http://www.boost.org/LICENSE_1_0.txt
  //==============================================================================
  #ifndef BOOST_SIMD_ARITHMETIC_FUNCTIONS_SCALAR_MINMOD_HPP_INCLUDED
  #define BOOST_SIMD_ARITHMETIC_FUNCTIONS_SCALAR_MINMOD_HPP_INCLUDED
  
  #include <boost/simd/arithmetic/functions/minmod.hpp>
  #include <boost/simd/include/functions/scalar/min.hpp>
  #include <boost/simd/include/functions/scalar/is_gez.hpp>
  #include <boost/simd/include/functions/scalar/is_nltz.hpp>
  #include <boost/simd/include/functions/scalar/bitwise_xor.hpp>
  #include <boost/simd/include/constants/zero.hpp>
  #include <boost/dispatch/attributes.hpp>
  
  namespace boost { namespace simd { namespace ext
  {
    BOOST_DISPATCH_IMPLEMENT          ( minmod_, tag::cpu_
                                      , (A0)
                                      , (scalar_< int_<A0> >)
                                        (scalar_< int_<A0> >)
                                      )
    {
      typedef A0 result_type;
  
      BOOST_FORCEINLINE BOOST_SIMD_FUNCTOR_CALL_REPEAT(2)
      {
        return is_gez(b_xor(a0, a1)) ? boost::simd::min(a0, a1): Zero<A0>();
      }
    };
  
    BOOST_DISPATCH_IMPLEMENT          ( minmod_, tag::cpu_
                                      , (A0)
                                      , (scalar_< uint_<A0> >)
                                        (scalar_< uint_<A0> >)
                                      )
    {
      typedef A0 result_type;
  
      BOOST_FORCEINLINE BOOST_SIMD_FUNCTOR_CALL_REPEAT(2)
      {
        return boost::simd::min(a0,a1);
      }
    };
  
    BOOST_DISPATCH_IMPLEMENT          ( minmod_, tag::cpu_
                                      , (A0)
                                      , (scalar_< floating_<A0> >)
                                        (scalar_< floating_<A0> >)
                                      )
    {
      typedef A0 result_type;
  
      BOOST_FORCEINLINE BOOST_SIMD_FUNCTOR_CALL_REPEAT(2)
      {
        return is_nltz(a0*a1) ? boost::simd::min(a0,a1) : Zero<A0>();
      }
    };
  } } }
  
  #endif
  