src/ffs/ffs_branched.c
int ffs_branched_results(ffs_trial_arg_t * trial) {

  int ntrial, nlambda;
  int n, nstates, ntry, nprune;
  int nsum_trial = 0, nsum_prune = 0, nsum_success = 0;
  double tsum, f1, wt, lambda;

  dbg_return_if(trial == NULL, -1);

  mpilog(trial->log, "\n");
  mpilog(trial->log, "Conditional probabilities\n");
  mpilog(trial->log, "-------------------------\n");

  ffs_init_ntrials(trial->init, &ntrial);
  ffs_param_nlambda(trial->param, &nlambda);

  mpilog(trial->log,
	 "index      lambda    trials   states   pruned   wt/ntrial\n");
  mpilog(trial->log,
	 "---------------------------------------------------------\n");

  for (n = 1; n <= nlambda; n++) {
    ffs_param_lambda(trial->param, n, &lambda);
    ffs_result_weight(trial->result, n, &wt);
    ffs_result_trial_success(trial->result, n, &nstates);
    ffs_result_prune(trial->result, n, &nprune);
    ffs_param_ntrial(trial->param, n, &ntry);

    mpilog(trial->log, "  %3d %11.4e  %8d %8d %8d %11.4e\n", n, lambda,
	   nstates*ntry, nstates, nprune, wt/ntrial);

    nsum_trial += nstates*ntry;
    if (n > 1) nsum_success += nstates;
    nsum_prune += nprune;
  }

  mpilog(trial->log,
	 "----------------------------------------------------------\n");
  mpilog(trial->log, "(sum/success/fail) %8d %8d %8d\n", nsum_trial,
	 nsum_success, nsum_prune);

  ffs_result_aflux_tsum_final(trial->flux, &tsum);
  ffs_result_aflux_ncross_final(trial->flux, &n);
  f1 = n/tsum;
  ffs_result_summary_stat_set(trial->summary, f1, wt/ntrial);

  mpilog(trial->log, "\n");
  mpilog(trial->log, "Probability P(B|A):     %12.6e\n", wt/ntrial);
  mpilog(trial->log, "Flux * P(B|A):          %12.6e\n", f1*wt/ntrial);

  return 0;
}
/*****************************************************************************
 *
 *  ffs_branched_results
 *
 *  Display the results in a human-readable format
 *
 *****************************************************************************/
ffs_branched_results
Display the results in a human-readable format
ffs_branched_results Display the results in a human - readable format
int ffs_branched_results(ffs_trial_arg_t * trial) {
  int ntrial, nlambda;
  int n, nstates, ntry, nprune;
  int nsum_trial = 0, nsum_prune = 0, nsum_success = 0;
  double tsum, f1, wt, lambda;
  dbg_return_if(trial == NULL, -1);
  mpilog(trial->log, "\n");
  mpilog(trial->log, "Conditional probabilities\n");
  mpilog(trial->log, "-------------------------\n");
  ffs_init_ntrials(trial->init, &ntrial);
  ffs_param_nlambda(trial->param, &nlambda);
  mpilog(trial->log,
	 "index      lambda    trials   states   pruned   wt/ntrial\n");
  mpilog(trial->log,
	 "---------------------------------------------------------\n");
  for (n = 1; n <= nlambda; n++) {
    ffs_param_lambda(trial->param, n, &lambda);
    ffs_result_weight(trial->result, n, &wt);
    ffs_result_trial_success(trial->result, n, &nstates);
    ffs_result_prune(trial->result, n, &nprune);
    ffs_param_ntrial(trial->param, n, &ntry);
    mpilog(trial->log, "  %3d %11.4e  %8d %8d %8d %11.4e\n", n, lambda,
	   nstates*ntry, nstates, nprune, wt/ntrial);
    nsum_trial += nstates*ntry;
    if (n > 1) nsum_success += nstates;
    nsum_prune += nprune;
  }
  mpilog(trial->log,
	 "----------------------------------------------------------\n");
  mpilog(trial->log, "(sum/success/fail) %8d %8d %8d\n", nsum_trial,
	 nsum_success, nsum_prune);
  ffs_result_aflux_tsum_final(trial->flux, &tsum);
  ffs_result_aflux_ncross_final(trial->flux, &n);
  f1 = n/tsum;
  ffs_result_summary_stat_set(trial->summary, f1, wt/ntrial);
  mpilog(trial->log, "\n");
  mpilog(trial->log, "Probability P(B|A):     %12.6e\n", wt/ntrial);
  mpilog(trial->log, "Flux * P(B|A):          %12.6e\n", f1*wt/ntrial);
  return 0;
}
int ffs_branched_results ( ffs_trial_arg_t * trial ) { int ntrial , nlambda ; int n , nstates , ntry , nprune ; int nsum_trial = 0 , nsum_prune = 0 , nsum_success = 0 ; double tsum , f1 , wt , lambda ; dbg_return_if ( trial == NULL , -1 ) ; mpilog ( trial -> log , " \n " ) ; mpilog ( trial -> log , " \n " ) ; mpilog ( trial -> log , " \n " ) ; ffs_init_ntrials ( trial -> init , & ntrial ) ; ffs_param_nlambda ( trial -> param , & nlambda ) ; mpilog ( trial -> log , " \n " ) ; mpilog ( trial -> log , " \n " ) ; for ( n = 1 ; n <= nlambda ; n ++ ) { ffs_param_lambda ( trial -> param , n , & lambda ) ; ffs_result_weight ( trial -> result , n , & wt ) ; ffs_result_trial_success ( trial -> result , n , & nstates ) ; ffs_result_prune ( trial -> result , n , & nprune ) ; ffs_param_ntrial ( trial -> param , n , & ntry ) ; mpilog ( trial -> log , " \n " , n , lambda , nstates * ntry , nstates , nprune , wt / ntrial ) ; nsum_trial += nstates * ntry ; if ( n > 1 ) nsum_success += nstates ; nsum_prune += nprune ; } mpilog ( trial -> log , " \n " ) ; mpilog ( trial -> log , " \n " , nsum_trial , nsum_success , nsum_prune ) ; ffs_result_aflux_tsum_final ( trial -> flux , & tsum ) ; ffs_result_aflux_ncross_final ( trial -> flux , & n ) ; f1 = n / tsum ; ffs_result_summary_stat_set ( trial -> summary , f1 , wt / ntrial ) ; mpilog ( trial -> log , " \n " ) ; mpilog ( trial -> log , " \n " , wt / ntrial ) ; mpilog ( trial -> log , " \n " , f1 * wt / ntrial ) ; return 0 ; }
ffs_branched_results
  Display the results in a human-readable format
ffs_branched_results Display the results in a human - readable format