00001 #ifndef Impala_Core_Array_Trait_BpoMinimum_h 00002 #define Impala_Core_Array_Trait_BpoMinimum_h 00003 00004 #include "Core/Array/Pattern/Categories.h" 00005 #include "Core/Array/Element/E1Cast.h" 00006 #include "Core/Array/Element/E0LargeVal.h" 00007 00008 namespace Impala 00009 { 00010 namespace Core 00011 { 00012 namespace Array 00013 { 00014 namespace Trait 00015 { 00016 00017 00020 template<class DstArrayT, class Src1ArrayT, class Src2ArrayT> 00021 class BpoMinimum 00022 { 00023 public: 00025 typedef Pattern::TagTransInVar TransVarianceCategory; 00026 00028 typedef Pattern::TagCallValue CallCategory; 00029 00030 typedef typename DstArrayT::ArithType DstArithT; 00031 typedef typename Src1ArrayT::ArithType Src1ArithT; 00032 typedef typename Src2ArrayT::ArithType Src2ArithT; 00033 00035 BpoMinimum() 00036 { 00037 } 00038 00040 DstArithT 00041 DoIt(const Src1ArithT& x, const Src2ArithT& y) 00042 { 00043 return Element::E1Cast(Impala::Min(x,y), DstArithT()); 00044 } 00045 00046 static DstArithT 00047 NeutralElement() 00048 { 00049 return Element::E0LargeVal<DstArithT>(DstArithT()); 00050 } 00051 }; 00052 00053 } // namespace Trait 00054 } // namespace Array 00055 } // namespace Core 00056 } // namespace Impala 00057 00058 #endif