File numerics/src/tools/line_search.h#

Go to the source code of this file

Basic structures for line-search (and arcsearch) methods.

Typedefs

typedef double (*sn_ls_fn)(int n, double *theta, double preRHS, search_data *ls_data)#

Enums

enum [anonymous]#

Values:

enumerator NM_LS_DISABLE#
enumerator NM_LS_MAX#
enumerator NM_LS_MEAN#
enumerator NM_LS_ZHANG_HAGER#
enum SEARCH_TYPE#

Values:

enumerator LINESEARCH#
enumerator ARCSEARCH#
enumerator BACKWARD_PATHSEARCH#
enum LSA_ALGO#

Values:

enumerator SICONOS_LSA_ARMIJO#
enumerator SICONOS_LSA_GOLDSTEIN#

Functions

static inline void set_nonmonotone_type(void *nm_ref_data, int type)#

Set the update type for the non-monotone line search.

Parameters:
  • nm_ref_data – the struct containing the data relative to the reference value used in the line search

  • type – for the update

static inline int get_nonmonotone_type(void *nm_ref_data)#

Get the update type for the non-monotone line search.

Parameters:

nm_ref_data – the struct containing the data relative to the reference value used in the line search

Returns:

the type for the update

double line_search_generic(int n, double theta, double preRHS, search_data *ls_data, unsigned searchtype, sn_ls_fn ls_fn)#

Generic call for a linesearch (or arcsearch).

Handles the update of the update of the non-monotone data

Parameters:
  • n – size of the variable

  • theta – current value of the merit function

  • preRHS – value used for the comparison

  • ls_data – line search data

  • searchtype – type of search: linesearch or arcsearch

  • ls_fn – function to call

Returns:

the value of tau, NAN if the search failed

void update_non_monotone_ref(void *nm_ref_data, double cur_merit)#

update the reference value for the non-monotone line search

Parameters:
  • nm_ref_data – the struct containing the data for the update

  • cur_merit – new value of the merit function for the update

void get_non_monotone_ref(void *nm_ref_data, double *theta_ref)#

compute the reference value

Parameters:
  • nm_ref_data – the struct containing the data relative to the reference value used in the line search

  • theta_ref[inout] on input the current value of the merit function; on output, the new reference value

void fill_nm_data(nm_ref_struct *nm_ref_data, int *iparam)#

fill the data struct for non-monotone search

Parameters:
  • nm_ref_data – the structure to fill

  • iparam – the set of parameter from the SolverOption struct

void zero_nm_data(nm_ref_struct *nm_ref_data)#

Reset the storage for the non-monotone search.

Parameters:

nm_ref_data – the structure

void free_nm_data(nm_ref_struct *nm_ref_data)#

free the allocated memory for the non-monotone search

Parameters:

nm_ref_data – the structure holding the allocated memory

void free_ls_data(search_data *ls_data)#

free the allocated memory for the linesearch method

Parameters:

ls_data – the struct

struct search_data#
#include <line_search.h>

Struct to hold together the data needed by the search.

Public Members

compute_F_ptr compute_F#

function to compute F(z)

compute_F_merit_ptr compute_F_merit#

function to compute F_merit(z)

double *z#

z vector

double *zc#

candidate z vector

double *F#

value of F(z)

double *F_merit#

value of F_merit(z)

double *desc_dir#

descent direction

double alpha0#

starting value for alpha

double alpha_min#

minimum value of alpha

void *data#

opaque pointer for extra data (needed for function call)

void *nm_ref_data#

data for the update rule

unsigned searchtype#

type of search: LINESEARCH or ARCSEARCH

void *set#

set on which the solution has to belong; only used for arcsearch

double sigma#

sigma value, used only for ARCSEARCH

void *extra_params#

extra parameters for some line search algorithm

struct nm_ref_struct#
#include <line_search.h>

Struct used for the non-monotone search.

Public Members

int type#

0 if false, otherwise use a nonmonotone search.

The integer value gives the update rule for the merit value `threshold’

int M#

maximum number of previous values of the merit function stored

int m#

number of previous values of the merit function stored

double *previous_thetas#

set of previous values of the merit function