00001 /* probTable.cc 00002 */ 00003 #include "osl/category/probTable.h" 00004 #include "osl/category/probTable.tcc" 00005 #include "osl/eval/ptypeEvalTraits.h" 00006 00007 template class osl::category::ProbTable<172>; 00008 template class osl::category::ProbTable<1>; 00009 #ifdef NEED_EXTRA_TEMPLATE_INSTANTIATION 00010 template class osl::category::ProbTable<86>; 00011 template class osl::category::ProbTable<44032>; 00012 #endif 00013 00014 /* ------------------------------------------------------------------------- */ 00015 osl::category:: 00016 FixedValueTable::FixedValueTable(const char *home, const char *name) 00017 : base_t(home, name) 00018 { 00019 assert(initialized()); 00020 assert(min == prob[0]); 00021 } 00022 osl::category:: 00023 FixedValueTable::FixedValueTable(size_t val) 00024 { 00025 prob[0] = val; 00026 min = val; 00027 filename[0] = 'f'; 00028 assert(initialized()); 00029 } 00030 00031 /* ------------------------------------------------------------------------- */ 00032 osl::category::PieceValueTable:: 00033 PieceValueTable(const char *home, const char *name) 00034 : base_t(home, name) 00035 { 00036 } 00037 00038 osl::category::PieceValueTable:: 00039 ~PieceValueTable() 00040 { 00041 } 00042 00043 void osl::category::PieceValueTable:: 00044 interpolate() 00045 { 00046 const size_t capture_bonus_index = getIndex(eval::PtypeEvalTraits<LANCE>::val*2); 00047 int lastVal = CategoryTraits::maxProb(); 00048 for (size_t i=0; i<indexMax(); ++i) 00049 { 00050 if (i >= capture_bonus_index) 00051 prob[i] = std::min(300, prob[i]); 00052 if (prob[i] == 0) 00053 { 00054 prob[i] = lastVal; // 0 ä(갭֤)Ƥ 00055 } 00056 else 00057 { 00058 lastVal = prob[i]; 00059 } 00060 } 00061 } 00062 00063 /* ------------------------------------------------------------------------- */ 00064 // ;;; Local Variables: 00065 // ;;; mode:c++ 00066 // ;;; c-basic-offset:2 00067 // ;;; End: