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