src/nlcg.c
/* Helper function to compute search direction as: d' = g + beta*d
   possibly with the constraint that beta > 0. */
Helper function to compute search direction as: d' = g + beta*d
possibly with the constraint that beta > 0.
Helper function to compute search direction as : d ' = g + beta * d possibly with the constraint that beta > 0 .
static int
update1(opk_nlcg_t* opt,
        const opk_vector_t* g,
        double beta)
{
  if ((opt->flags & OPK_NLCG_POWELL) == OPK_NLCG_POWELL && beta < 0) {
    beta = 0;
  }
  if ((opt->beta = beta) == 0) {
    return UPDATE_FAILURE;
  }
  opk_vaxpby(opt->d, 1, g, beta, opt->d);
  return UPDATE_SUCCESS;
}
static int update1 ( opk_nlcg_t * opt , const opk_vector_t * g , double beta ) { if ( ( opt -> flags & OPK_NLCG_POWELL ) == OPK_NLCG_POWELL && beta < 0 ) { beta = 0 ; } if ( ( opt -> beta = beta ) == 0 ) { return UPDATE_FAILURE ; } opk_vaxpby ( opt -> d , 1 , g , beta , opt -> d ) ; return UPDATE_SUCCESS ; }
Helper function to compute search direction as: d' = g + beta*d
possibly with the constraint that beta > 0.
Helper function to compute search direction as : d ' = g + beta * d possibly with the constraint that beta > 0 .