mango Namespace Reference

This C++ namespace contains everything related to MANGO. More...

Classes

class  Algorithm
 
struct  algorithm_properties
 Some properties of each algorithm that MANGO is aware of. More...
 
class  Imfil
 
class  Least_squares_problem
 
class  Least_squares_solver
 
class  LeastSquaresAlgorithm
 
class  Levenberg_marquardt
 
class  MPI_Partition
 A class for dividing the set of MPI processes into worker groups. More...
 
class  Package
 
class  Package_gsl
 
class  Package_hopspack
 
class  Package_mango
 
class  Package_nlopt
 
class  Package_petsc
 
class  Problem
 
class  Recorder
 
class  Recorder_least_squares
 
class  Recorder_standard
 
class  Solver
 

Typedefs

typedef void(* objective_function_type) (int *N_parameters, const double *state_vector, double *objective_value, int *failed, mango::Problem *problem, void *user_data)
 Format for the user-supplied subroutine that computes the objective function for a general (non least-squares) optimization problem. More...
 
typedef void(* vector_function_type) (int *N_parameters, const double *state_vector, int *N_terms, double *residuals, int *failed, mango::Problem *problem, void *user_data)
 Format for the user-supplied subroutine that computes the residuals for a least-squares optimization problem. More...
 

Enumerations

enum  package_type {
  PACKAGE_HOPSPACK, PACKAGE_MANGO, PACKAGE_NLOPT, PACKAGE_GSL,
  PACKAGE_PETSC, NUM_PACKAGES
}
 The list of packages, i.e. libraries that MANGO can call to perform optimization. More...
 
enum  algorithm_type {
  MANGO_LEVENBERG_MARQUARDT, MANGO_IMFIL, PETSC_NM, PETSC_POUNDERS,
  PETSC_BRGN, NLOPT_GN_DIRECT, NLOPT_GN_DIRECT_L, NLOPT_GN_DIRECT_L_RAND,
  NLOPT_GN_DIRECT_NOSCAL, NLOPT_GN_DIRECT_L_NOSCAL, NLOPT_GN_DIRECT_L_RAND_NOSCAL, NLOPT_GN_ORIG_DIRECT,
  NLOPT_GN_ORIG_DIRECT_L, NLOPT_GN_CRS2_LM, NLOPT_LN_COBYLA, NLOPT_LN_BOBYQA,
  NLOPT_LN_PRAXIS, NLOPT_LN_NELDERMEAD, NLOPT_LN_SBPLX, NLOPT_LD_MMA,
  NLOPT_LD_CCSAQ, NLOPT_LD_SLSQP, NLOPT_LD_LBFGS, NLOPT_LD_TNEWTON_PRECOND_RESTART,
  NLOPT_LD_TNEWTON_PRECOND, NLOPT_LD_TNEWTON_RESTART, NLOPT_LD_TNEWTON, NLOPT_LD_VAR1,
  NLOPT_LD_VAR2, HOPSPACK, GSL_LM, GSL_DOGLEG,
  GSL_DDOGLEG, GSL_SUBSPACE2D, GSL_CONJUGATE_FR, GSL_CONJUGATE_PR,
  GSL_BFGS, GSL_NM, NUM_ALGORITHMS
}
 A list of the algorithms that MANGO can potentially use. More...
 

Functions

bool does_algorithm_exist (std::string algorithm_name)
 Checks whether or not a string corresponds to the name of one of the optimization algorithms known by MANGO. More...
 
bool get_algorithm (std::string name, algorithm_type *algorithm_int)
 Returns the integer (enum) for an optimization algorithm associated with its string name. More...
 

Variables

const double NUMBER_FOR_FAILED = 1.0e+12
 A large finite number. More...
 
const algorithm_properties algorithms [NUM_ALGORITHMS]
 A database of the algorithms that MANGO is aware of, including various properties of each algorithm. More...
 

Detailed Description

This C++ namespace contains everything related to MANGO.

Typedef Documentation

◆ objective_function_type

typedef void(* mango::objective_function_type) (int *N_parameters, const double *state_vector, double *objective_value, int *failed, mango::Problem *problem, void *user_data)

Format for the user-supplied subroutine that computes the objective function for a general (non least-squares) optimization problem.

Parameters
[in]N_parametersThe number of independent variables, i.e. the dimension of the search space.
[in]state_vectorAn array of size N_parameters containing the values of the indpendent variables.
[out]objective_valueThe subroutine must set this variable to the value of the objective function.
[out]failedSet the value pointed to by this variable to 1 if the calculation of the objective function fails for some reason. Otherwise the value should be 0.
[in]problemA pointer to the class representing this optimization problem. This pointer can be useful for getting information about the MPI communicators.
[in]user_dataPointer to user-supplied data, which can be set by mango::Problem::set_user_data().

Definition at line 424 of file mango.hpp.

◆ vector_function_type

typedef void(* mango::vector_function_type) (int *N_parameters, const double *state_vector, int *N_terms, double *residuals, int *failed, mango::Problem *problem, void *user_data)

Format for the user-supplied subroutine that computes the residuals for a least-squares optimization problem.

Parameters
[in]N_parametersThe number of independent variables, i.e. the dimension of the search space.
[in]state_vectorAn array of size N_parameters containing the values of the indpendent variables.
[in]N_termsThe number of least-squares terms that are summed in the total objective function, i.e. the number of residuals.
[in]residualsAn array of size N_terms which must be set to the residuals, denoted \( R_j \) on Core Concepts.
[out]failedSet the value pointed to by this variable to 1 if the calculation of the residuals fails for some reason. Otherwise the value should be 0.
[in]problemA pointer to the class representing this optimization problem. This pointer can be useful for getting information about the MPI communicators.
[in]user_dataPointer to user-supplied data, which can be set by mango::Problem::set_user_data().

Definition at line 439 of file mango.hpp.

Enumeration Type Documentation

◆ algorithm_type

A list of the algorithms that MANGO can potentially use.

Each algorithm in this list is only actually available if MANGO is built with the corresponding package. This list of packages is generated by the update_algorithms script from the master table of algorithms in algorithms.dat.

Enumerator
MANGO_LEVENBERG_MARQUARDT 
MANGO_IMFIL 
PETSC_NM 
PETSC_POUNDERS 
PETSC_BRGN 
NLOPT_GN_DIRECT 
NLOPT_GN_DIRECT_L 
NLOPT_GN_DIRECT_L_RAND 
NLOPT_GN_DIRECT_NOSCAL 
NLOPT_GN_DIRECT_L_NOSCAL 
NLOPT_GN_DIRECT_L_RAND_NOSCAL 
NLOPT_GN_ORIG_DIRECT 
NLOPT_GN_ORIG_DIRECT_L 
NLOPT_GN_CRS2_LM 
NLOPT_LN_COBYLA 
NLOPT_LN_BOBYQA 
NLOPT_LN_PRAXIS 
NLOPT_LN_NELDERMEAD 
NLOPT_LN_SBPLX 
NLOPT_LD_MMA 
NLOPT_LD_CCSAQ 
NLOPT_LD_SLSQP 
NLOPT_LD_LBFGS 
NLOPT_LD_TNEWTON_PRECOND_RESTART 
NLOPT_LD_TNEWTON_PRECOND 
NLOPT_LD_TNEWTON_RESTART 
NLOPT_LD_TNEWTON 
NLOPT_LD_VAR1 
NLOPT_LD_VAR2 
HOPSPACK 
GSL_LM 
GSL_DOGLEG 
GSL_DDOGLEG 
GSL_SUBSPACE2D 
GSL_CONJUGATE_FR 
GSL_CONJUGATE_PR 
GSL_BFGS 
GSL_NM 
NUM_ALGORITHMS 

Not an actual algorithm, just counting.

Definition at line 75 of file mango.hpp.

◆ package_type

The list of packages, i.e. libraries that MANGO can call to perform optimization.

Note that all packages are enumerated here even if MANGO is built without support for all of them. This list of packages is generated by the update_algorithms script from the master table of algorithms in algorithms.dat.

Enumerator
PACKAGE_HOPSPACK 
PACKAGE_MANGO 
PACKAGE_NLOPT 
PACKAGE_GSL 
PACKAGE_PETSC 
NUM_PACKAGES 

Not an actual package, just counting.

Definition at line 36 of file mango.hpp.

Function Documentation

◆ does_algorithm_exist()

bool mango::does_algorithm_exist ( std::string  algorithm_name)

Checks whether or not a string corresponds to the name of one of the optimization algorithms known by MANGO.

Parameters
[in]algorithm_nameA candidate name for an optimization algorithm. These names correspond to the name field of the algorithm_properties type.
Returns
true if an algorithm exists in MANGO's database with the corresponding name, false otherwise.

Definition at line 72 of file algorithms.cpp.

◆ get_algorithm()

bool mango::get_algorithm ( std::string  name,
algorithm_type algorithm_int 
)

Returns the integer (enum) for an optimization algorithm associated with its string name.

Parameters
[in]nameA name of an optimization algorithm, e.g. "petsc_pounders" or "nlopt_ln_neldermead"
[out]algorithm_intThe integer code for the algorithm with name specified by name. If no matching algorithm is found, the value pointed to by algorithm_int will not be changed from its input value.
Returns
true if an algorithm exists with a name equal to the specified name, false otherwise.

Definition at line 49 of file algorithms.cpp.

Variable Documentation

◆ algorithms

const algorithm_properties mango::algorithms[NUM_ALGORITHMS]

A database of the algorithms that MANGO is aware of, including various properties of each algorithm.

This databse is automatically generated from the master database algorithms.dat by the update_algorithms script.

Definition at line 124 of file mango.hpp.

◆ NUMBER_FOR_FAILED

const double mango::NUMBER_FOR_FAILED = 1.0e+12

A large finite number.

This number is not yet used in the code.

Definition at line 52 of file mango.hpp.