ptypeOSquareVector.cc
Go to the documentation of this file.
00001 #include "osl/container/ptypeOSquareVector.h"
00002 #include "osl/eval/pieceEval.h"
00003 #include <algorithm>
00004 
00005 namespace osl
00006 {
00007   struct PtypeOSquareLessThan
00008   {
00009     bool operator()(const std::pair<PtypeO,Square>& l,
00010                     const std::pair<PtypeO,Square>& r)
00011     {
00012       const int vall = abs(eval::Ptype_Eval_Table.captureValue(l.first));
00013       const int valr = abs(eval::Ptype_Eval_Table.captureValue(r.first));
00014       if (vall != valr)
00015         return vall < valr;
00016       return l.second.uintValue() < r.second.uintValue();
00017     }
00018   };
00019 
00020   void container::PtypeOSquareVector::sort()
00021   {
00022     std::sort(begin(),end(),PtypeOSquareLessThan());
00023   }
00024 
00025 }
00026 // ;;; Local Variables:
00027 // ;;; mode:c++
00028 // ;;; c-basic-offset:2
00029 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines