newProgress.cc
Go to the documentation of this file.
00001 #include "osl/progress/ml/newProgress.h"
00002 #include "osl/eval/ml/weights.h"
00003 #include "osl/eval/ml/midgame.h"
00004 #include "osl/eval/ml/minorPiece.h"
00005 #include "osl/pieceStand.h"
00006 #include "osl/oslConfig.h"
00007 #include <boost/foreach.hpp>
00008 #include <iostream>
00009 #include <fstream>
00010 
00011 bool osl::progress::ml::
00012 operator==(const NewProgressData& l, const NewProgressData& r)
00013 {
00014   return l.progresses == r.progresses
00015     && l.attack5x5_progresses == r.attack5x5_progresses
00016     && l.stand_progresses == r.stand_progresses
00017     && l.effect_progresses == r.effect_progresses
00018     && l.defenses == r.defenses
00019     && l.rook == r.rook && l.bishop == r.bishop && l.gold == r.gold
00020     && l.silver == r.silver && l.promoted == r.promoted
00021     && l.king_relative_attack == r.king_relative_attack
00022     && l.king_relative_defense == r.king_relative_defense
00023     && l.non_pawn_ptype_attacked_pair == r.non_pawn_ptype_attacked_pair
00024     && l.non_pawn_ptype_attacked_pair_eval == r.non_pawn_ptype_attacked_pair_eval;
00025 }
00026 
00027 osl::misc::CArray<int, 81*15*10>
00028 osl::progress::ml::NewProgress::attack_relative;
00029 osl::misc::CArray<int, 81*15*10>
00030 osl::progress::ml::NewProgress::defense_relative;
00031 osl::misc::CArray<int, osl::Piece::SIZE>
00032 osl::progress::ml::NewProgress::stand_weight;
00033 osl::misc::CArray<int, 1125>
00034 osl::progress::ml::NewProgress::attack5x5_weight;
00035 osl::misc::CArray<int, 5625>
00036 osl::progress::ml::NewProgress::attack5x5_x_weight;
00037 osl::misc::CArray<int, 10125>
00038 osl::progress::ml::NewProgress::attack5x5_y_weight;
00039 osl::misc::CArray<int, 75>
00040 osl::progress::ml::NewProgress::effectstate_weight;
00041 osl::misc::CArray<int, 4284>
00042 osl::progress::ml::NewProgress::king_relative_weight;
00043 osl::CArray<int, 262144> 
00044 osl::progress::ml::NewProgress::attacked_ptype_pair_weight;
00045 int osl::progress::ml::NewProgress::max_progress;
00046 bool osl::progress::ml::NewProgress::initialized_flag;
00047 
00048 bool osl::progress::ml::NewProgress::setUp(const char *filename)
00049 {
00050   if (initialized_flag)
00051     return true;
00052 
00053   static CArray<int, 25> effect_weight;
00054   static CArray<int, 225> effect_x_weight, effect_y_weight;
00055   static CArray<int, 25> effect_defense_weight;
00056   static CArray<int, 225> effect_per_effect;
00057   static CArray<int, 225> effect_per_effect_defense;
00058   static CArray<int, 2025> effect_per_effect_y, effect_per_effect_x;
00059   std::ifstream is(filename);
00060   int read_count = 0;
00061 
00062   osl::eval::ml::Weights weights(25);
00063   for (size_t i = 0; i < weights.dimension(); ++i)
00064   {
00065     int val;
00066     is >> val;
00067     effect_weight[i] = val;
00068     ++read_count;
00069   }
00070   for (size_t i = 0; i < 225; ++i)
00071   {
00072     int val;
00073     is >> val;
00074     effect_x_weight[i] = val;
00075     ++read_count;
00076   }
00077   for (size_t i = 0; i < 225; ++i)
00078   {
00079     int val;
00080     is >> val;
00081     effect_y_weight[i] = val;
00082     ++read_count;
00083   }
00084   weights.resetDimension(25);
00085   for (size_t i = 0; i < weights.dimension(); ++i)
00086   {
00087     int val;
00088     is >> val;
00089     effect_defense_weight[i] = val;
00090     ++read_count;
00091   }
00092   weights.resetDimension(225);
00093   for (size_t i = 0; i < weights.dimension(); ++i)
00094   {
00095     int val;
00096     is >> val;
00097     effect_per_effect[i] = val;
00098     ++read_count;
00099   }
00100   weights.resetDimension(225);
00101   for (size_t i = 0; i < weights.dimension(); ++i)
00102   {
00103     int val;
00104     is >> val;
00105     effect_per_effect_defense[i] = val;
00106     ++read_count;
00107   }
00108 
00109   weights.resetDimension(2025);
00110   for (size_t i = 0; i < weights.dimension(); ++i)
00111   {
00112     int val;
00113     is >> val;
00114     effect_per_effect_y[i] = val;
00115     ++read_count;
00116   }
00117   weights.resetDimension(2025);
00118   for (size_t i = 0; i < weights.dimension(); ++i)
00119   {
00120     int val;
00121     is >> val;
00122     effect_per_effect_x[i] = val;
00123     ++read_count;
00124   }
00125   weights.resetDimension(Piece::SIZE);
00126   for (size_t i = 0; i < weights.dimension(); ++i)
00127   {
00128     int val;
00129     is >> val;
00130     stand_weight[i] = val;
00131     ++read_count;
00132   }
00133   weights.resetDimension(1125);
00134   for (size_t i = 0; i < weights.dimension(); ++i)
00135   {
00136     int val;
00137     is >> val;
00138     attack5x5_weight[i] = val;
00139     ++read_count;
00140   }
00141   weights.resetDimension(75);
00142   for (size_t i = 0; i < weights.dimension(); ++i)
00143   {
00144     int val;
00145     is >> val;
00146     effectstate_weight[i] = val;
00147     ++read_count;
00148   }
00149   weights.resetDimension(5625);
00150   for (size_t i = 0; i < weights.dimension(); ++i)
00151   {
00152     int val;
00153     is >> val;
00154     attack5x5_x_weight[i] = val;
00155     ++read_count;
00156   }
00157   weights.resetDimension(10125);
00158   for (size_t i = 0; i < weights.dimension(); ++i)
00159   {
00160     int val;
00161     is >> val;
00162     attack5x5_y_weight[i] = val;
00163     ++read_count;
00164   }
00165   weights.resetDimension(4284);
00166   for (size_t i = 0; i < weights.dimension(); ++i)
00167   {
00168     int val;
00169     is >> val;
00170     king_relative_weight[i] = val;
00171     ++read_count;
00172   }
00173   weights.resetDimension(262144);
00174   for (size_t i = 0; i < weights.dimension(); ++i)
00175   {
00176     int val;
00177     is >> val;
00178     attacked_ptype_pair_weight[i] = val;
00179     ++read_count;
00180   }
00181   {
00182     int val;
00183     is >> val;
00184     max_progress = val;
00185     ++read_count;
00186 #ifdef EVAL_QUAD
00187     while (((max_progress/ProgressScale) % 3) && max_progress > 0)
00188       --max_progress;
00189 #endif
00190   }
00191   for(int king_x=1;king_x<=9;king_x++){
00192     for(int king_y=1;king_y<=9;king_y++){
00193       Square king(king_x,king_y);
00194       int king_index=(king_x-1)*9+king_y-1;
00195       const Square center = Centering5x3::adjustCenter(king);
00196       const int min_x = center.x() - 2;
00197       const int min_y = center.y() - 1;
00198       int i=0;
00199       for (int dx=0; dx<5; ++dx)
00200       {
00201         for (int dy=0; dy<3; ++dy,++i)
00202         {
00203           const Square target(min_x+dx,min_y+dy);
00204           int index0=king_index*15+i;
00205           int index_a=index0*10;
00206           int index_d=index0*10;
00207           attack_relative[index_a]=
00208             effect_weight[index<BLACK>(king, target)] +
00209             effect_x_weight[indexX<BLACK>(king, target)] +
00210             effect_y_weight[indexY<BLACK>(king, target)];
00211           defense_relative[index_d]=
00212             effect_defense_weight[index<BLACK>(king, target)];
00213           for(int count=0;count<=8;count++){
00214             attack_relative[index_a+count+1]=
00215               effect_per_effect[indexPerEffect<BLACK>(king, target, count)] +
00216               effect_per_effect_y[indexPerEffectY<BLACK>(king, target, count)] +
00217               effect_per_effect_x[indexPerEffectX<BLACK>(king, target, count)];
00218             defense_relative[index_d+count+1]=
00219               effect_per_effect_defense[indexPerEffect<BLACK>(king, target, count)];
00220           }
00221         }
00222       }
00223     }
00224   }
00225   for(int king_x=1;king_x<=5;king_x++)
00226     for(int promoted=0;promoted<=4;promoted++)
00227       for(int silver=0;silver<=4;silver++)
00228         for(int gold=0;gold<=4;gold++)
00229           for(int bishop=0;bishop<=2;bishop++)
00230             for(int rook=0;rook<=2;rook++){
00231               int index0=promoted + 5 * (silver + 5 * (gold + 5 * (bishop + 3 * rook)));
00232               int index1=king_x - 1 + 5 * (promoted + 5 * (silver + 5 * (gold + 5 * (bishop + 3 * rook))));
00233               attack5x5_x_weight[index1]+=attack5x5_weight[index0];
00234             }
00235   for (int i=0; i<PTYPE_SIZE*2*PTYPE_SIZE; ++i)
00236     for (int j=i+1; j<PTYPE_SIZE*2*PTYPE_SIZE; ++j) {
00237       attacked_ptype_pair_weight[eval::ml::NonPawnAttackedPtypePair::index2(j,i)]
00238         = attacked_ptype_pair_weight[eval::ml::NonPawnAttackedPtypePair::index2(i,j)];
00239     }
00240               
00241 
00242   initialized_flag = is;
00243   if (!initialized_flag)
00244   {
00245     std::cerr << "Failed to load NewProgress data " << read_count << std::endl;
00246   }
00247   return initialized_flag;
00248 }
00249 
00250 bool osl::progress::ml::NewProgress::setUp()
00251 {
00252   std::string filename = OslConfig::home();
00253   filename += "/data/progress.txt";
00254   return setUp(filename.c_str());  
00255 }
00256 
00257 template <osl::Player P>
00258 void osl::progress::ml::NewProgress::progressOne(
00259   const NumEffectState &state, int &attack, int &defense)
00260 {
00261   const Square king = state.kingSquare<P>();
00262   const Square center = Centering5x3::adjustCenter(king);
00263   const int min_x = center.x() - 2;
00264   const int min_y = center.y() - 1;
00265 
00266   attack = defense = 0;
00267   Square kingRel=king;
00268   if(P==WHITE){
00269     kingRel=kingRel.rotate180();
00270   }
00271   int index0=((kingRel.x()-1)*9+kingRel.y()-1)*15;
00272   int index_a=index0*10 + (P==WHITE ? 10*14 : 0);
00273   for (int dx=0; dx<5; ++dx)
00274   {
00275     for (int dy=0; dy<3; ++dy)
00276     {
00277       const Square target(min_x+dx,min_y+dy);
00278       const int attack_count =
00279         state.countEffect(alt(P), target);
00280       const int defense_count =
00281         state.countEffect(P, target);
00282       attack += attack_count *attack_relative[index_a]+
00283         attack_relative[index_a+std::min(attack_count,8)+1];
00284       defense +=
00285         defense_count * defense_relative[index_a]+
00286         defense_relative[index_a+std::min(defense_count,8)+1];
00287       if(P==BLACK){
00288         index_a+=10;
00289       }
00290       else{
00291         index_a-=10;
00292       }
00293     }
00294   }
00295 }
00296 
00297 template <osl::Player P>
00298 void osl::progress::ml::NewProgress::updateAttack5x5PiecesAndState(
00299   const NumEffectState &state)
00300 {
00301   const Square king = state.kingSquare<P>();
00302   const int min_x = std::max(1, king.x() - 2);
00303   const int max_x = std::min(9, king.x() + 2);
00304   const int min_y = std::max(1, king.y() - 2);
00305   const int max_y = std::min(9, king.y() + 2);
00306   effect_progresses[P] = 0;
00307 
00308   PieceMask mask;
00309   for (int y = min_y; y <= max_y; ++y)
00310   {
00311     for (int x = min_x; x <= max_x; ++x)
00312     {
00313       const Square target(x, y);
00314       const NumBitmapEffect effect = state.effectSetAt(target);
00315       const int effect_diff =
00316         effect.countEffect(alt(P)) - effect.countEffect(P);
00317       const int x_diff = std::abs(x - king.x());
00318       const int y_diff = (P == WHITE ? king.y() - y : y - king.y());
00319       int index = std::max(std::min(effect_diff, 2), -2) + 2 + 5 * x_diff +
00320         5 * 3 * (y_diff + 2);
00321       effect_progresses[P] += effectstate_weight[index];
00322       mask |= effect;
00323     }
00324   }
00325   updateAttack5x5Pieces<P>(mask, state);
00326 }
00327 
00328 template <osl::Player P>
00329 void osl::progress::ml::NewProgress::updateAttack5x5Pieces(
00330   PieceMask mask, const NumEffectState& state)
00331 {
00332   const Player attack = PlayerTraits<P>::opponent;
00333   mask &= state.piecesOnBoard(attack);
00334 
00335   rook[attack] = mask.selectBit<ROOK>().countBit();
00336   bishop[attack] = mask.selectBit<BISHOP>().countBit();
00337   gold[attack] = mask.selectBit<GOLD>().countBit();
00338   silver[attack] =
00339     (mask & ~state.promotedPieces()).selectBit<SILVER>().countBit();
00340   PieceMask promoted_pieces = mask & state.promotedPieces();
00341   promoted_pieces.clearBit<ROOK>();
00342   promoted_pieces.clearBit<BISHOP>();
00343   promoted[attack] =
00344     std::min(promoted_pieces.countBit(), 4);
00345 }
00346 
00347 template <osl::Player P>
00348 int osl::progress::ml::NewProgress::attack5x5Value(
00349   const NumEffectState &state) const
00350 {
00351   const Player attack = PlayerTraits<P>::opponent;
00352   int king_x = state.kingSquare<P>().x();
00353   if (king_x > 5)
00354     king_x = 10 - king_x;
00355   const int king_y = (P == BLACK ? state.kingSquare<P>().y() :
00356                       10 - state.kingSquare<P>().y());
00357   return (attack5x5_x_weight[index5x5x(
00358               rook[attack] + state.countPiecesOnStand<ROOK>(attack),
00359               bishop[attack] + state.countPiecesOnStand<BISHOP>(attack),
00360               gold[attack] + state.countPiecesOnStand<GOLD>(attack),
00361               silver[attack] + state.countPiecesOnStand<SILVER>(attack),
00362               promoted[attack], king_x)] +
00363           attack5x5_y_weight[index5x5y(
00364               rook[attack] + state.countPiecesOnStand<ROOK>(attack),
00365               bishop[attack] + state.countPiecesOnStand<BISHOP>(attack),
00366               gold[attack] + state.countPiecesOnStand<GOLD>(attack),
00367               silver[attack] + state.countPiecesOnStand<SILVER>(attack),
00368               promoted[attack], king_y)]);
00369 }
00370 
00371 void
00372 osl::progress::ml::NewProgress::updatePieceKingRelativeBonus(
00373   const NumEffectState &state)
00374 {
00375   const CArray<Square,2> kings = {{ 
00376       state.kingSquare(BLACK),
00377       state.kingSquare(WHITE),
00378     }};
00379   king_relative_attack.fill(0);
00380   king_relative_defense.fill(0);
00381   for (int i = 0; i < Piece::SIZE; ++i)
00382   {
00383     const Piece piece = state.pieceOf(i);
00384     if (piece.ptype() == osl::KING || !piece.isOnBoard())
00385       continue;
00386     Player pl = piece.owner();
00387     const int index_attack = indexRelative(piece.owner(), kings[alt(pl)],
00388                                            piece);
00389     const int index_defense = indexRelative(piece.owner(), kings[pl],
00390                                             piece) + 2142;
00391     king_relative_attack[pl] += king_relative_weight[index_attack];
00392     king_relative_defense[pl] += king_relative_weight[index_defense];
00393   }
00394 }
00395 
00396 template <osl::Player Owner>
00397 void osl::progress::ml::NewProgress::
00398 updateNonPawnAttackedPtypePairOne(const NumEffectState& state)
00399 {
00400   PieceMask attacked = state.effectedMask(alt(Owner)) & state.piecesOnBoard(Owner);
00401   attacked.reset(state.kingPiece<Owner>().number());
00402   mask_t ppawn = state.promotedPieces().getMask<PAWN>() & attacked.selectBit<PAWN>();
00403   attacked.clearBit<PAWN>();
00404   attacked.orMask(PtypeFuns<PAWN>::indexNum, ppawn);
00405   PieceVector pieces;
00406   while (attacked.any())
00407   {
00408     const Piece piece = state.pieceOf(attacked.takeOneBit());
00409     pieces.push_back(piece);
00410   }
00411   typedef eval::ml::NonPawnAttackedPtypePair feature_t;
00412   int result = 0;
00413   MultiInt result_eval;
00414   for (size_t i=0; i+1<pieces.size(); ++i) {
00415     const int i0 = feature_t::index1(state, pieces[i]);
00416     for (size_t j=i+1; j<pieces.size(); ++j) {
00417       const int i1 = feature_t::index1(state, pieces[j]);
00418       result += attacked_ptype_pair_weight[feature_t::index2(i0,i1)];
00419       if (Owner == BLACK)
00420         result_eval += feature_t::table[feature_t::index2(i0, i1)];
00421       else
00422         result_eval -= feature_t::table[feature_t::index2(i0, i1)];
00423     }
00424   }
00425   non_pawn_ptype_attacked_pair[Owner] = result;
00426   non_pawn_ptype_attacked_pair_eval[Owner] = result_eval;
00427 }
00428 
00429 void osl::progress::ml::NewProgress::
00430 updateNonPawnAttackedPtypePair(const NumEffectState& state)
00431 {
00432   updateNonPawnAttackedPtypePairOne<BLACK>(state);
00433   updateNonPawnAttackedPtypePairOne<WHITE>(state);
00434 }
00435 
00436 osl::progress::ml::NewProgress::NewProgress(
00437   const NumEffectState &state)
00438 {
00439   assert(initialized_flag);
00440   
00441   progressOne<BLACK>(state,
00442                      progresses[BLACK],
00443                      defenses[WHITE]);
00444   progressOne<WHITE>(state,
00445                      progresses[WHITE],
00446                      defenses[BLACK]);
00447   updateAttack5x5PiecesAndState<BLACK>(state);
00448   updateAttack5x5PiecesAndState<WHITE>(state);
00449   attack5x5_progresses[BLACK] =
00450     attack5x5Value<BLACK>(state);
00451   attack5x5_progresses[WHITE] =
00452     attack5x5Value<WHITE>(state);
00453   stand_progresses.fill(0);
00454   BOOST_FOREACH(Ptype ptype, PieceStand::order)
00455   {
00456     const int black_count =
00457       state.countPiecesOnStand(BLACK, ptype);
00458     const int white_count =
00459       state.countPiecesOnStand(WHITE, ptype);
00460     for (int j = 0; j < black_count; ++j)
00461     {
00462       stand_progresses[WHITE] +=
00463         stand_weight[Ptype_Table.getIndexMin(ptype) + j];
00464     }
00465     for (int j = 0; j < white_count; ++j)
00466     {
00467       stand_progresses[BLACK] +=
00468         stand_weight[Ptype_Table.getIndexMin(ptype) + j];
00469     }
00470   }
00471   updatePieceKingRelativeBonus(state);
00472   updateNonPawnAttackedPtypePair(state);
00473 }
00474 
00475 template<osl::Player P>
00476 inline
00477 void osl::progress::ml::NewProgress::updateMain(
00478   const NumEffectState &new_state,
00479   Move last_move)
00480 {
00481   const Player altP=PlayerTraits<P>::opponent;
00482   assert(new_state.turn()==altP);
00483   assert(last_move.player()==P);
00484   const Square kb = new_state.kingSquare<BLACK>(), kw = new_state.kingSquare<WHITE>();
00485   const BoardMask mb = new_state.changedEffects(BLACK), mw = new_state.changedEffects(WHITE);
00486   const bool king_move = last_move.ptype() == KING;
00487   if ((king_move && altP == BLACK) || mb.anyInRange(Board_Mask_Table5x3_Center.mask(kw)) || mw.anyInRange(Board_Mask_Table5x3_Center.mask(kw)))
00488   {
00489     progressOne<WHITE>(new_state,progresses[WHITE],defenses[BLACK]);
00490   }
00491   if ((king_move && altP == WHITE) || mw.anyInRange(Board_Mask_Table5x3_Center.mask(kb)) || mb.anyInRange(Board_Mask_Table5x3_Center.mask(kb)))
00492   {
00493     progressOne<BLACK>(new_state,progresses[BLACK],defenses[WHITE]);
00494   }
00495 
00496   const Ptype captured = last_move.capturePtype();
00497 
00498   if (last_move.isDrop())
00499   {
00500     const int count =
00501       new_state.countPiecesOnStand(P, last_move.ptype()) + 1;
00502     const int value =
00503       stand_weight[Ptype_Table.getIndexMin(last_move.ptype()) + count - 1];
00504     stand_progresses[altP] -= value;
00505   }
00506   else if (captured != PTYPE_EMPTY)
00507   {
00508     Ptype ptype = unpromote(captured);
00509     const int count = new_state.countPiecesOnStand(P, ptype);
00510     const int value =
00511       stand_weight[(Ptype_Table.getIndexMin(ptype) + count - 1)];
00512     stand_progresses[altP] += value;
00513   }
00514   
00515   if (king_move)
00516   {
00517     updatePieceKingRelativeBonus(new_state);
00518   }
00519   else
00520   {
00521     const CArray<Square,2> kings = {{ 
00522         new_state.kingSquare(BLACK),
00523         new_state.kingSquare(WHITE),
00524       }};
00525     if (!last_move.isDrop())
00526     {
00527       const int index_attack =
00528         indexRelative<P>(kings[altP],
00529                          last_move.oldPtype(), last_move.from());
00530       const int index_defense =
00531         indexRelative<P>(kings[P],
00532                          last_move.oldPtype(), last_move.from()) + 2142;
00533       king_relative_attack[P] -=
00534         king_relative_weight[index_attack];
00535       king_relative_defense[P] -=
00536         king_relative_weight[index_defense];
00537     }
00538     {
00539       const int index_attack =
00540         indexRelative<P>(kings[altP],
00541                          last_move.ptype(), last_move.to());
00542       const int index_defense =
00543         indexRelative<P>(kings[P],
00544                          last_move.ptype(), last_move.to()) + 2142;
00545       king_relative_attack[P] +=
00546         king_relative_weight[index_attack];
00547       king_relative_defense[P] +=
00548         king_relative_weight[index_defense];
00549     }
00550     if (captured != PTYPE_EMPTY)
00551     {
00552       const int index_attack =
00553         indexRelative<altP>(kings[P],
00554                             captured, last_move.to());
00555       const int index_defense =
00556         indexRelative<altP>(kings[altP],
00557                             captured, last_move.to()) + 2142;
00558       king_relative_attack[altP] -=
00559         king_relative_weight[index_attack];
00560       king_relative_defense[altP] -=
00561         king_relative_weight[index_defense];
00562     }
00563   }
00564   updateNonPawnAttackedPtypePair(new_state);
00565 }
00566 
00567 template<osl::Player P>
00568 void osl::progress::ml::NewProgress::updateSub(
00569   const NumEffectState &new_state,
00570   Move last_move)
00571 {
00572   const Player altP=PlayerTraits<P>::opponent;
00573   assert(new_state.turn()==altP);
00574   if (last_move.isPass())
00575     return;
00576   const Square kb = new_state.kingSquare<BLACK>(), kw = new_state.kingSquare<WHITE>();
00577   const BoardMask mb = new_state.changedEffects(BLACK), mw = new_state.changedEffects(WHITE);
00578   const bool king_move = last_move.ptype() == KING;
00579   const Ptype captured = last_move.capturePtype();
00580 
00581   if ((king_move && altP == BLACK) ||
00582       mb.anyInRange(Board_Mask_Table5x5.mask(kw)) ||
00583       mw.anyInRange(Board_Mask_Table5x5.mask(kw)))
00584   {
00585     updateAttack5x5PiecesAndState<WHITE>(new_state);
00586     attack5x5_progresses[WHITE] =
00587       attack5x5Value<WHITE>(new_state);
00588   }
00589   else if (altP == WHITE &&(last_move.isDrop() || captured != PTYPE_EMPTY))
00590   {
00591     attack5x5_progresses[WHITE] =
00592       attack5x5Value<WHITE>(new_state);
00593   }
00594   if ((king_move && altP == WHITE) ||
00595       mw.anyInRange(Board_Mask_Table5x5.mask(kb)) ||
00596       mb.anyInRange(Board_Mask_Table5x5.mask(kb)))
00597   {
00598     updateAttack5x5PiecesAndState<BLACK>(new_state);
00599     attack5x5_progresses[BLACK] =
00600       attack5x5Value<BLACK>(new_state);
00601   }
00602   else if (altP == BLACK && (last_move.isDrop() || captured != PTYPE_EMPTY))
00603   {
00604     attack5x5_progresses[BLACK] =
00605       attack5x5Value<BLACK>(new_state);
00606   }
00607   updateMain<P>(new_state, last_move);
00608 }
00609 
00610 namespace osl
00611 {
00612   namespace progress
00613   {
00614     namespace ml
00615     {
00616       template void osl::progress::ml::NewProgress::updateSub<osl::BLACK>(const NumEffectState &new_state,Move last_move);
00617       template void osl::progress::ml::NewProgress::updateSub<osl::WHITE>(const NumEffectState &new_state,Move last_move);
00618     }
00619   }
00620 }
00621 
00622 // ;;; Local Variables:
00623 // ;;; mode:c++
00624 // ;;; c-basic-offset:2
00625 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines