00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00048 #ifndef __HER_JAG_2D_H__
00049 #define __HER_JAG_2D_H__
00050 
00051 #include <util/prefix_sum_tools.hpp>
00052 #include <util/rect_list.hpp>
00053 #include <twod/part_base.hpp>
00054 #include <oned/nicol_plus.hpp>
00055 #include <util/transpose2d.hpp>
00056 
00057 namespace twod
00058 {
00079   template <typename T, typename Pr, 
00080             T (*onedalgoY) (int procCount, const util::Aggreg2Dto1D<T, Pr, false>& prefixSumArray, int length, int *cutIndexes, T) = oned::NicolPlus<T, util::Aggreg2Dto1D<T, Pr, false> >::nicol_plus,
00081             T (*onedalgoX) (int procCount, const util::Aggreg2Dto1D<T, Pr, true>& prefixSumArray, int length, int *cutIndexes, T) = oned::NicolPlus<T, util::Aggreg2Dto1D<T, Pr,  true> >::nicol_plus >
00082   class JagPQHeurHor : public PartBase<T,Pr>
00083   {
00084     int P; 
00085   public: 
00086     JagPQHeurHor();
00087     static T her_jag_2d_internal(int procX, int procY, const Pr& prefixSumArray, util::RectList<T,Pr> &parts);
00088 
00098     virtual T part(int procCount, const Pr& prefixSumArray, util::RectList<T,Pr> &parts);
00099 
00107     void setP(int P);
00108     
00109     virtual ~JagPQHeurHor();
00110   };
00111 
00112 
00113 
00114   
00125   template <typename T, typename Pr,
00126             T (*onedalgoY) (int procCount, const util::Aggreg2Dto1D<T, util::TransposePrefix2D<T, Pr>, false>& prefixSumArray, int length, int *cutIndexes, T) = oned::NicolPlus<T, util::Aggreg2Dto1D<T, util::TransposePrefix2D<T, Pr>, false> >::nicol_plus,
00127             T (*onedalgoX) (int procCount, const util::Aggreg2Dto1D<T, util::TransposePrefix2D<T, Pr>, true>& prefixSumArray, int length, int *cutIndexes, T) = oned::NicolPlus<T, util::Aggreg2Dto1D<T, util::TransposePrefix2D<T, Pr>,  true> >::nicol_plus 
00128             >
00129   class JagPQHeurVer : public PartBase<T,Pr>
00130   {
00131     int P;
00132   public: 
00133     JagPQHeurVer();
00134     virtual ~JagPQHeurVer();
00135     
00143     void setP(int P);
00155     virtual T part(int procCount, const Pr& prefixSumArray, util::RectList<T,Pr> &parts);  
00156   };
00157 
00158 
00159 
00170   template <typename T, typename Pr>
00171   class JagPQHeurBest : public PartBase<T,Pr>
00172   {
00173   public: 
00174     
00175     virtual ~JagPQHeurBest();
00186     virtual T part(int procCount, const Pr& prefixSumArray, util::RectList<T,Pr> &parts);  
00187   };
00188 
00189 }
00190 
00191 #include <twod/her_jag_2d_impl.hpp>
00192 
00193 #endif