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:

NM_LS_DISABLE
NM_LS_MAX
NM_LS_MEAN
NM_LS_ZHANG_HAGER
enum LSA_ALGO

Values:

SICONOS_LSA_ARMIJO
SICONOS_LSA_GOLDSTEIN
enum SEARCH_TYPE

Values:

LINESEARCH
ARCSEARCH
BACKWARD_PATHSEARCH

Functions

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 free_ls_data(search_data *ls_data)

free the allocated memory for the linesearch method

Parameters
  • ls_data: the struct

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 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: on input the current value of the merit function; on output, the new reference value

static int get_nonmonotone_type(void *nm_ref_data)

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

Return
the type for the update
Parameters
  • nm_ref_data: the struct containing the data relative to the reference value used in the line search

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

Return
the value of tau, NAN if the search failed
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

static 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

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 zero_nm_data(nm_ref_struct *nm_ref_data)

Reset the storage for the non-monotone search.

Parameters
  • nm_ref_data: the structure

struct nm_ref_struct
#include <line_search.h>

Struct used for the non-monotone search.

Public Members

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

int type

0 if false, otherwise use a nonmonotone search.

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

struct search_data
#include <line_search.h>

Struct to hold together the data needed by the search.

Public Members

double alpha0

starting value for alpha

double alpha_min

minimum value of alpha

compute_F_ptr compute_F

function to compute F(z)

compute_F_merit_ptr compute_F_merit

function to compute F_merit(z)

void *data

opaque pointer for extra data (needed for function call)

double *desc_dir

descent direction

void *extra_params

extra parameters for some line search algorithm

double *F

value of F(z)

double *F_merit

value of F_merit(z)

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

double *z

z vector

double *zc

candidate z vector