当前位置: 首页>>代码示例>>C++>>正文


C++ pipe_solve_delegate函数代码示例

本文整理汇总了C++中pipe_solve_delegate函数的典型用法代码示例。如果您正苦于以下问题:C++ pipe_solve_delegate函数的具体用法?C++ pipe_solve_delegate怎么用?C++ pipe_solve_delegate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pipe_solve_delegate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: marscirce_move_to_rebirth_square_solve

/* Try to solve in solve_nr_remaining half-moves.
 * @param si slice index
 * @note assigns solve_result the length of solution found and written, i.e.:
 *            previous_move_is_illegal the move just played is illegal
 *            this_move_is_illegal     the move being played is illegal
 *            immobility_on_next_move  the moves just played led to an
 *                                     unintended immobility on the next move
 *            <=n+1 length of shortest solution found (n+1 only if in next
 *                                     branch)
 *            n+2 no solution found in this branch
 *            n+3 no solution found in next branch
 *            (with n denominating solve_nr_remaining)
 */
void marscirce_move_to_rebirth_square_solve(slice_index si)
{
  numecoup const curr = CURRMOVE_OF_PLY(nbply);
  move_generation_elmt * const move_gen_top = move_generation_stack+curr;
  numecoup const id = move_gen_top->id;
  square const sq_capture = move_gen_top->capture;

  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  if (marscirce_rebirth_square[id]==initsquare
      /* marscirce_rebirth_square isn't set when castlings are generated */
      || (min_castling<=sq_capture && sq_capture<=max_castling))
  {
    move_effect_journal_do_null_effect();
    pipe_solve_delegate(si);
  }
  else
  {
    square const sq_departure = move_gen_top->departure;

    move_effect_journal_do_piece_movement(move_effect_reason_phantom_movement,
                                          sq_departure,marscirce_rebirth_square[id]);

    move_gen_top->departure = marscirce_rebirth_square[id];
    pipe_solve_delegate(si);
    move_gen_top->departure = sq_departure;
  }

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
开发者ID:thomas-maeder,项目名称:popeye,代码行数:46,代码来源:marscirce.c

示例2: singlebox_type2_latent_pawn_promoter_solve

/* Try to solve in solve_nr_remaining half-moves.
 * @param si slice index
 * @note assigns solve_result the length of solution found and written, i.e.:
 *            previous_move_is_illegal the move just played is illegal
 *            this_move_is_illegal     the move being played is illegal
 *            immobility_on_next_move  the moves just played led to an
 *                                     unintended immobility on the next move
 *            <=n+1 length of shortest solution found (n+1 only if in next
 *                                     branch)
 *            n+2 no solution found in this branch
 *            n+3 no solution found in next branch
 *            (with n denominating solve_nr_remaining)
 */
void singlebox_type2_latent_pawn_promoter_solve(slice_index si)
{
  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  if (post_move_iteration_id[nbply]!=prev_post_move_iteration_id_promotion[nbply])
    init_latent_pawn_promotion();

  if (singlebox_type2_latent_pawn_promotions[nbply].promotion.promotee==Empty)
    pipe_solve_delegate(si);
  else
  {
    move_effect_journal_do_walk_change(move_effect_reason_singlebox_promotion,
                                        singlebox_type2_latent_pawn_promotions[nbply].where,
                                        singlebox_type2_latent_pawn_promotions[nbply].promotion.promotee);
    pipe_solve_delegate(si);

    if (!post_move_iteration_locked[nbply])
    {
      advance_latent_pawn_promotion();
      if (singlebox_type2_latent_pawn_promotions[nbply].promotion.promotee!=Empty)
        lock_post_move_iterations();
    }
  }

  prev_post_move_iteration_id_promotion[nbply] = post_move_iteration_id[nbply];

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
开发者ID:Die9teWoge,项目名称:popeye,代码行数:44,代码来源:type2.c

示例3: exclusive_chess_legality_tester_solve

/* Try to solve in solve_nr_remaining half-moves.
 * @param si slice index
 * @note assigns solve_result the length of solution found and written, i.e.:
 *            previous_move_is_illegal the move just played is illegal
 *            this_move_is_illegal     the move being played is illegal
 *            immobility_on_next_move  the moves just played led to an
 *                                     unintended immobility on the next move
 *            <=n+1 length of shortest solution found (n+1 only if in next
 *                                     branch)
 *            n+2 no solution found in this branch
 *            n+3 no solution found in next branch
 *            (with n denominating solve_nr_remaining)
 */
void exclusive_chess_legality_tester_solve(slice_index si)
{
  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  if ((table_length(exclusive_chess_undecidable_continuations[parent_ply[nbply]])
       +exclusive_chess_nr_continuations_reaching_goal[parent_ply[nbply]])
      >1)
  {
    if (is_current_move_in_table(exclusive_chess_undecidable_continuations[parent_ply[nbply]]))
      solve_result = this_move_is_illegal;
    else
      switch (conditional_pipe_solve_delegate(temporary_hack_mate_tester[advers(trait[nbply])]))
      {
        case this_move_is_illegal:
          solve_result = this_move_is_illegal;
          break;

        case previous_move_has_not_solved:
          pipe_solve_delegate(si);
          break;

        default:
          solve_result = previous_move_has_solved;
          break;
      }
  }
  else
    pipe_solve_delegate(si);

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
开发者ID:Die9teWoge,项目名称:popeye,代码行数:47,代码来源:exclusive.c

示例4: threat_enforcer_solve

/* Try to solve in solve_nr_remaining half-moves.
 * @param si slice index
 * @note assigns solve_result the length of solution found and written, i.e.:
 *            previous_move_is_illegal the move just played is illegal
 *            this_move_is_illegal     the move being played is illegal
 *            immobility_on_next_move  the moves just played led to an
 *                                     unintended immobility on the next move
 *            <=n+1 length of shortest solution found (n+1 only if in next
 *                                     branch)
 *            n+2 no solution found in this branch
 *            n+3 no solution found in next branch
 *            (with n denominating solve_nr_remaining)
 */
void threat_enforcer_solve(slice_index si)
{
  ply const threats_ply = parent_ply[nbply];
  stip_length_type const len_threat = threat_lengths[threats_ply];

  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  TraceValue("%u",len_threat);
  TraceEOL();

  if (len_threat<=slack_length)
    /* the move has something stronger than threats (typically, it
     * delivers check)
     */
    pipe_solve_delegate(si);
  else if (len_threat<=MOVE_HAS_SOLVED_LENGTH())
  {
    /* there are >=1 threats - don't report variations shorter than
     * the threats or variations that don't refute any threat
     */
    table const threats_table = threats[threats_ply];
    stip_length_type len_test_threats;

    nr_threats_to_be_confirmed = table_length(threats_table);

    len_test_threats = testing_pipe_solve_delegate(si,len_threat);

    if (len_test_threats>len_threat)
      /* variation is longer than threat */
      pipe_solve_delegate(si);
    else if (len_test_threats>len_threat-2 && nr_threats_to_be_confirmed>0)
      /* variation has same length as the threat(s), but it has
       * defeated at least one threat
       */
      pipe_solve_delegate(si);
    else
      /* variation is shorter than threat */
      solve_result = len_test_threats;
  }
  else
    /* zugzwang, or we haven't looked for threats yet */
    pipe_solve_delegate(si);

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
开发者ID:thomas-maeder,项目名称:popeye,代码行数:61,代码来源:threat.c

示例5: singlebox_type2_latent_pawn_selector_solve

/* Try to solve in solve_nr_remaining half-moves.
 * @param si slice index
 * @note assigns solve_result the length of solution found and written, i.e.:
 *            previous_move_is_illegal the move just played is illegal
 *            this_move_is_illegal     the move being played is illegal
 *            immobility_on_next_move  the moves just played led to an
 *                                     unintended immobility on the next move
 *            <=n+1 length of shortest solution found (n+1 only if in next
 *                                     branch)
 *            n+2 no solution found in this branch
 *            n+3 no solution found in next branch
 *            (with n denominating solve_nr_remaining)
 */
void singlebox_type2_latent_pawn_selector_solve(slice_index si)
{
  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  if (post_move_iteration_id[nbply]!=prev_post_move_iteration_id_selection[nbply])
    init_latent_pawn_selection(SLICE_STARTER(si));

  pipe_solve_delegate(si);

  if (singlebox_type2_latent_pawn_promotions[nbply].where!=initsquare)
  {
    if (!post_move_iteration_locked[nbply])
    {
      advance_latent_pawn_selection(SLICE_STARTER(si));

      if (singlebox_type2_latent_pawn_promotions[nbply].where!=initsquare)
        lock_post_move_iterations();
    }
  }

  prev_post_move_iteration_id_selection[nbply] = post_move_iteration_id[nbply];

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
开发者ID:Die9teWoge,项目名称:popeye,代码行数:40,代码来源:type2.c

示例6: by_knight

static void by_knight(slice_index si,
                      unsigned int index_of_checker,
                      square const check_from)
{
  int const diff = being_solved.king_square[Black]-check_from;
  int const dir = CheckDir[Knight][diff];

  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",index_of_checker);
  TraceSquare(check_from);
  TraceFunctionParamListEnd();

  if (dir!=0
      && intelligent_reserve_white_officer_moves_from_to_checking(white[index_of_checker].diagram_square,
                                                                  Knight,
                                                                  check_from))
  {
    occupy_square(check_from,Knight,white[index_of_checker].flags);
    init_disturb_mate_dir(check_from,being_solved.king_square[Black]-check_from);
    pipe_solve_delegate(si);
    fini_disturb_mate_dir();
    intelligent_unreserve();
  }

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
开发者ID:Die9teWoge,项目名称:popeye,代码行数:27,代码来源:generate_checking_moves.c

示例7: by_rider

static void by_rider(slice_index si,
                     unsigned int index_of_checker,
                     square const check_from)
{
  piece_walk_type const checker_type = white[index_of_checker].type;
  Flags const checker_flags = white[index_of_checker].flags;
  int const diff = being_solved.king_square[Black]-check_from;
  int const dir = CheckDir[checker_type][diff];

  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",index_of_checker);
  TraceSquare(check_from);
  TraceFunctionParamListEnd();

  if (dir!=0
      && intelligent_reserve_white_officer_moves_from_to_checking(white[index_of_checker].diagram_square,
                                                                  checker_type,
                                                                  check_from))
  {
    occupy_square(check_from,checker_type,checker_flags);
    remember_mating_line(checker_type,check_from,+1);
    pipe_solve_delegate(si);
    remember_mating_line(checker_type,check_from,-1);
    intelligent_unreserve();
  }

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
开发者ID:Die9teWoge,项目名称:popeye,代码行数:29,代码来源:generate_checking_moves.c

示例8: by_unpromoted_pawn

static void by_unpromoted_pawn(slice_index si,
                               unsigned int index_of_checker,
                               square const check_from)
{
  square const checker_from = white[index_of_checker].diagram_square;
  Flags const checker_flags = white[index_of_checker].flags;
  SquareFlags const prom_square = BIT(WhPromSq)|BIT(BlPromSq);

  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",index_of_checker);
  TraceSquare(check_from);
  TraceFunctionParamListEnd();

  if (!TSTFLAGMASK(sq_spec[check_from],prom_square)
      && GuardDir[Pawn-Pawn][check_from].dir==guard_dir_check_uninterceptable
      && intelligent_reserve_white_pawn_moves_from_to_checking(checker_from,check_from))
  {
    occupy_square(check_from,Pawn,checker_flags);
    init_disturb_mate_dir(check_from,being_solved.king_square[Black]-check_from);
    pipe_solve_delegate(si);
    fini_disturb_mate_dir();
    empty_square(check_from);
    intelligent_unreserve();
  }

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
开发者ID:Die9teWoge,项目名称:popeye,代码行数:28,代码来源:generate_checking_moves.c

示例9: output_plaintext_instrument_solving

/*
 *  Instrument the solving machinery with slices that write the solution in
 * plain text
 */
void output_plaintext_instrument_solving(slice_index si)
{
  stip_structure_traversal st;

  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  TraceStipulation(si);

  stip_structure_traversal_init(&st,0);
  stip_structure_traversal_override_single(&st,
                                           STOutputModeSelector,
                                           &visit_output_mode_selector);
  stip_traverse_structure(si,&st);

  {
    slice_index const prototypes[] =
    {
        alloc_output_plaintext_end_of_phase_writer_slice()
    };
    enum
    {
      nr_prototypes = sizeof prototypes / sizeof prototypes[0]
    };
    slice_insertion_insert(si,prototypes,nr_prototypes);
  }

  solving_insert_move_inversion_counter_slices(si);

  pipe_solve_delegate(si);

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
开发者ID:Die9teWoge,项目名称:popeye,代码行数:39,代码来源:plaintext.c

示例10: en_passant_redo_multistep

/* Try to solve in solve_nr_remaining half-moves.
 * @param si slice index
 * @note assigns solve_result the length of solution found and written, i.e.:
 *            previous_move_is_illegal the move just played is illegal
 *            this_move_is_illegal     the move being played is illegal
 *            immobility_on_next_move  the moves just played led to an
 *                                     unintended immobility on the next move
 *            <=n+1 length of shortest solution found (n+1 only if in next
 *                                     branch)
 *            n+2 no solution found in this branch
 *            n+3 no solution found in next branch
 *            (with n denominating solve_nr_remaining)
 */
void en_passant_redo_multistep(slice_index si)
{
  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  assert(en_passant_nr_retro_squares>2);

  move_effect_journal_do_no_piece_removal();

  {
    unsigned int i;

    move_effect_journal_do_piece_movement(move_effect_reason_moving_piece_movement,
                                          en_passant_retro_squares[0],
                                          en_passant_retro_squares[en_passant_nr_retro_squares-1]);

    for (i = 1; i<en_passant_nr_retro_squares-1; ++i)
      en_passant_remember_multistep_over(en_passant_retro_squares[i]);
  }

  pipe_solve_delegate(si);

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
开发者ID:thomas-maeder,项目名称:popeye,代码行数:39,代码来源:en_passant.c

示例11: mummer_orchestrator_solve

/* Try to solve in solve_nr_remaining half-moves.
 * @param si slice index
 * @note assigns solve_result the length of solution found and written, i.e.:
 *            previous_move_is_illegal the move just played is illegal
 *            this_move_is_illegal     the move being played is illegal
 *            immobility_on_next_move  the moves just played led to an
 *                                     unintended immobility on the next move
 *            <=n+1 length of shortest solution found (n+1 only if in next
 *                                     branch)
 *            n+2 no solution found in this branch
 *            n+3 no solution found in next branch
 *            (with n denominating solve_nr_remaining)
 */
void mummer_orchestrator_solve(slice_index si)
{
  ply const save_nbply = nbply;

  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  mum_length[parent_ply[nbply]] = INT_MIN;
  reset_accepted_moves(nbply);

  copyply();
  move_generator_invert_move_order(nbply);
  fork_solve_delegate(si);
  finply();

  /* in some very obscure situations (cf. bug #142), we would continue with
   * e.g. knight promotion if queen promotion was played while measuring lengths
   */
  ++post_move_iteration_id[nbply];

  nbply = save_nbply;
  SET_CURRMOVE(nbply,last_candidate[nbply]);

  pipe_solve_delegate(si);

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
开发者ID:Die9teWoge,项目名称:popeye,代码行数:42,代码来源:mummer.c

示例12: hashtable_dimensioner_solve

void hashtable_dimensioner_solve(slice_index si)
{
  if (dimensionHashtable())
    pipe_solve_delegate(si);
  else
    fputs("Couldn't allocate the requested amount of memory\n",stdout);
}
开发者ID:ralphwaldo,项目名称:popeye,代码行数:7,代码来源:maxmem.c

示例13: delegate_solve

/* Delegate finding a solution to the next1 slice, gradually increasing
 * the number of allowed half-moves
 * @param si slice index of slice being solved
 * @param n maximum number of half moves until end state has to be reached
 * @param n_min minimum number of half-moves to try
 * @return length of solution found and written, i.e.:
 *            previous_move_is_illegal the move just played or being played is illegal
 *            <=n length of shortest solution found
 *            n+2 no solution found
 */
static stip_length_type delegate_solve(slice_index si,
                                        stip_length_type n,
                                        stip_length_type n_min)
{
  stip_length_type result = n+2;
  stip_length_type const save_solve_nr_remaining = MOVE_HAS_SOLVED_LENGTH();

  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParam("%u",n_min);
  TraceFunctionParamListEnd();

  for (solve_nr_remaining = n_min+(n-n_min)%2; solve_nr_remaining<=n; solve_nr_remaining += 2)
  {
    pipe_solve_delegate(si);

  result = solve_result;
    if (result<=MOVE_HAS_SOLVED_LENGTH())
      break;
  }

  solve_nr_remaining = save_solve_nr_remaining;

  TraceFunctionExit(__func__);
  TraceFunctionResult("%u",result);
  TraceFunctionResultEnd();
  return result;
}
开发者ID:Die9teWoge,项目名称:popeye,代码行数:38,代码来源:degenerate_tree.c

示例14: opponent_moves_counter_solve

/* Try to solve in solve_nr_remaining half-moves.
 * @param si slice index
 * @note assigns solve_result the length of solution found and written, i.e.:
 *            previous_move_is_illegal the move just played is illegal
 *            this_move_is_illegal     the move being played is illegal
 *            immobility_on_next_move  the moves just played led to an
 *                                     unintended immobility on the next move
 *            <=n+1 length of shortest solution found (n+1 only if in next
 *                                     branch)
 *            n+2 no solution found in this branch
 *            n+3 no solution found in next branch
 *            (with n denominating solve_nr_remaining)
 */
void opponent_moves_counter_solve(slice_index si)
{
  numecoup const move_id = move_generation_stack[CURRMOVE_OF_PLY(nbply)].id;

  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  legal_move_count_init(UINT_MAX);

  pipe_solve_delegate(si);

  if (solve_result==this_move_is_illegal)
    /* Defenses leading to self check get a big count.
     * But still make sure that we can correctly compute the difference of two
     * counts.
     */
    opponent_moves_few_moves_prioriser_table[move_id] = INT_MAX/2;
  else
    opponent_moves_few_moves_prioriser_table[move_id] = legal_move_counter_count[nbply];

  legal_move_count_fini();

  solve_result = MOVE_HAS_SOLVED_LENGTH();

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
开发者ID:thomas-maeder,项目名称:popeye,代码行数:41,代码来源:opponent_moves_counter.c

示例15: continuation_solver_solve

/* Try to solve in solve_nr_remaining half-moves.
 * @param si slice index
 * @note assigns solve_result the length of solution found and written, i.e.:
 *            previous_move_is_illegal the move just played is illegal
 *            this_move_is_illegal     the move being played is illegal
 *            immobility_on_next_move  the moves just played led to an
 *                                     unintended immobility on the next move
 *            <=n+1 length of shortest solution found (n+1 only if in next
 *                                     branch)
 *            n+2 no solution found in this branch
 *            n+3 no solution found in next branch
 *            (with n denominating solve_nr_remaining)
 */
void continuation_solver_solve(slice_index si)
{
  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  fork_solve_delegate(si);

  if (move_has_solved())
  {
#if !defined(NDEBUG)
    stip_length_type const test_result = solve_result;
#endif
    stip_length_type const save_solve_nr_remaining = solve_nr_remaining;

    if (solve_nr_remaining>solve_result)
      solve_nr_remaining = solve_result;
    pipe_solve_delegate(si);
    solve_nr_remaining = save_solve_nr_remaining;

    assert(solve_result==test_result);
  }

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
开发者ID:Die9teWoge,项目名称:popeye,代码行数:39,代码来源:continuation.c


注:本文中的pipe_solve_delegate函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。