Go to the documentation of this file.
128 {
"mango_levenberg_marquardt",
PACKAGE_MANGO,
true,
true,
true,
false,
false},
129 {
"mango_imfil",
PACKAGE_MANGO,
false,
false,
true,
true,
true },
130 {
"petsc_nm",
PACKAGE_PETSC,
false,
false,
false,
false,
false},
131 {
"petsc_pounders",
PACKAGE_PETSC,
true,
false,
false,
true,
false},
132 {
"petsc_brgn",
PACKAGE_PETSC,
true,
true,
true,
true,
false},
133 {
"nlopt_gn_direct",
PACKAGE_NLOPT,
false,
false,
false,
true,
true },
134 {
"nlopt_gn_direct_l",
PACKAGE_NLOPT,
false,
false,
false,
true,
true },
135 {
"nlopt_gn_direct_l_rand",
PACKAGE_NLOPT,
false,
false,
false,
true,
true },
136 {
"nlopt_gn_direct_noscal",
PACKAGE_NLOPT,
false,
false,
false,
true,
true },
137 {
"nlopt_gn_direct_l_noscal",
PACKAGE_NLOPT,
false,
false,
false,
true,
true },
138 {
"nlopt_gn_direct_l_rand_noscal",
PACKAGE_NLOPT,
false,
false,
false,
true,
true },
139 {
"nlopt_gn_orig_direct",
PACKAGE_NLOPT,
false,
false,
false,
true,
true },
140 {
"nlopt_gn_orig_direct_l",
PACKAGE_NLOPT,
false,
false,
false,
true,
true },
141 {
"nlopt_gn_crs2_lm",
PACKAGE_NLOPT,
false,
false,
false,
true,
true },
142 {
"nlopt_ln_cobyla",
PACKAGE_NLOPT,
false,
false,
false,
true,
false},
143 {
"nlopt_ln_bobyqa",
PACKAGE_NLOPT,
false,
false,
false,
true,
false},
144 {
"nlopt_ln_praxis",
PACKAGE_NLOPT,
false,
false,
false,
true,
false},
145 {
"nlopt_ln_neldermead",
PACKAGE_NLOPT,
false,
false,
false,
true,
false},
146 {
"nlopt_ln_sbplx",
PACKAGE_NLOPT,
false,
false,
false,
true,
false},
147 {
"nlopt_ld_mma",
PACKAGE_NLOPT,
false,
true,
true,
true,
false},
148 {
"nlopt_ld_ccsaq",
PACKAGE_NLOPT,
false,
true,
true,
true,
false},
149 {
"nlopt_ld_slsqp",
PACKAGE_NLOPT,
false,
true,
true,
true,
false},
150 {
"nlopt_ld_lbfgs",
PACKAGE_NLOPT,
false,
true,
true,
true,
false},
151 {
"nlopt_ld_tnewton_precond_restart",
PACKAGE_NLOPT,
false,
true,
true,
true,
false},
152 {
"nlopt_ld_tnewton_precond",
PACKAGE_NLOPT,
false,
true,
true,
true,
false},
153 {
"nlopt_ld_tnewton_restart",
PACKAGE_NLOPT,
false,
true,
true,
true,
false},
154 {
"nlopt_ld_tnewton",
PACKAGE_NLOPT,
false,
true,
true,
true,
false},
155 {
"nlopt_ld_var1",
PACKAGE_NLOPT,
false,
true,
true,
true,
false},
156 {
"nlopt_ld_var2",
PACKAGE_NLOPT,
false,
true,
true,
true,
false},
158 {
"gsl_lm",
PACKAGE_GSL,
true,
true,
true,
false,
false},
159 {
"gsl_dogleg",
PACKAGE_GSL,
true,
true,
true,
false,
false},
160 {
"gsl_ddogleg",
PACKAGE_GSL,
true,
true,
true,
false,
false},
161 {
"gsl_subspace2d",
PACKAGE_GSL,
true,
true,
true,
false,
false},
162 {
"gsl_conjugate_fr",
PACKAGE_GSL,
false,
true,
true,
false,
false},
163 {
"gsl_conjugate_pr",
PACKAGE_GSL,
false,
true,
true,
false,
false},
164 {
"gsl_bfgs",
PACKAGE_GSL,
false,
true,
true,
false,
false},
165 {
"gsl_nm",
PACKAGE_GSL,
false,
false,
false,
false,
false}
198 MPI_Comm comm_worker_groups;
199 MPI_Comm comm_group_leaders;
202 int N_procs_worker_groups;
203 int rank_worker_groups;
204 int N_procs_group_leaders;
205 int rank_group_leaders;
208 bool proc0_worker_groups;
212 void verify_initialized();
214 void write_line(std::ofstream&,
int, std::string[],
int[]);
236 void init(MPI_Comm comm_world);
247 void set_custom(MPI_Comm comm_world, MPI_Comm comm_group_leaders, MPI_Comm comm_worker_groups);
377 void write(std::string filename);
677 Least_squares_problem(
int N_parameters,
double* state_vector,
int N_terms,
double* targets,
double* sigmas,
double* best_residual_function,
vector_function_type residual_function,
int argc,
char** argv);
@ NUM_PACKAGES
Not an actual package, just counting.
void set_N_worker_groups(int N_worker_groups)
Set the number of worker groups to the given integer.
Some properties of each algorithm that MANGO is aware of.
package_type
The list of packages, i.e. libraries that MANGO can call to perform optimization.
@ NLOPT_GN_DIRECT_L_NOSCAL
void set_N_line_search(int N_line_search)
Sets the number of points considered as a set for parallel line searches.
void stop_workers()
Tell the worker MPI processes (i.e. those that are not group leaders) that the optimization problem i...
void set_print_residuals_in_output_file(bool print)
Determine whether or not to print each individual residual in the MANGO output file.
bool parallel
Whether the algorithm can support concurrent evaluations of the objective function....
MPI_Comm get_comm_world()
Get the MPI communicator for MANGO's world communicator.
bool get_proc0_worker_groups()
Determine whether this MPI processor has rank 0 in MANGO's "worker groups" communicator.
bool get_algorithm(std::string name, algorithm_type *algorithm_int)
Returns the integer (enum) for an optimization algorithm associated with its string name.
~MPI_Partition()
Destructor.
MPI_Comm get_comm_group_leaders()
Get the MPI communicator for MANGO's "group leaders" communicator.
int get_N_parameters()
Get the number of independent variables for an optimization problem.
void set_user_data(void *user_data)
Pass the prescribed pointer to the objective function whenever it is called.
@ NLOPT_LD_TNEWTON_RESTART
package_type package
The optimization library that the algorithm belongs to.
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...
MPI_Partition mpi_partition
algorithm_type
A list of the algorithms that MANGO can potentially use.
int get_worker_group()
Returns an integer indicating the worker group to which this MPI process belongs.
const algorithm_properties algorithms[NUM_ALGORITHMS]
A database of the algorithms that MANGO is aware of, including various properties of each algorithm.
void set_max_function_evaluations(int N)
Set the maximum number of evaluations of the objective function that will be allowed before the optim...
void set_verbose(int verbose)
Control how much diagnostic information is printed by MANGO.
void set_custom(MPI_Comm comm_world, MPI_Comm comm_group_leaders, MPI_Comm comm_worker_groups)
Use a user-supplied partitioning of the MPI processes into worker groups.
int get_best_function_evaluation()
For an optimization problem that has already been solved, return the index of the function evaluation...
MPI_Partition()
Constructor.
void set_algorithm(algorithm_type algorithm)
Sets the optimization algorithm.
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 ...
void set_output_filename(std::string filename)
Sets the name of the output file that will record values of the objective function at each evaluation...
bool requires_bound_constraints
Whether the algorithm requires maximum and minimum values (a.k.a. box constraints) to be imposed on t...
double * get_state_vector()
Get the vector of independent variables.
void set_centered_differences(bool centered_differences)
Control whether 1-sided or centered finite differences will be used to compute derivatives of the obj...
Least_squares_problem(int N_parameters, double *state_vector, int N_terms, double *targets, double *sigmas, double *best_residual_function, vector_function_type residual_function, int argc, char **argv)
Constructor for a least-squares optimization problem.
bool allows_bound_constraints
Whether the algorithm allows maximum and minimum values (a.k.a. box constraints) to be imposed on the...
int get_rank_group_leaders()
Get the MPI rank of this processor in MANGO's "group leaders" communicator.
void set_finite_difference_step_size(double finite_difference_step_size)
Set an absolute step size for finite difference derivatives.
void init(MPI_Comm comm_world)
Divide up a given "world" communicator into worker groups.
@ MANGO_LEVENBERG_MARQUARDT
int get_N_procs_group_leaders()
Get the number of processors in MANGO's "group leaders" communicator.
int get_N_procs_worker_groups()
Get the number of processors in MANGO's "worker groups" communicator.
int get_rank_world()
Get the MPI rank of this processor in MANGO's world communicator.
Solver * get_solver()
Get the Solver object associated with the optimization problem.
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...
This C++ namespace contains everything related to MANGO.
const double NUMBER_FOR_FAILED
A large finite number.
@ NLOPT_LD_TNEWTON_PRECOND_RESTART
bool get_proc0_world()
Determine whether this MPI processor has rank 0 in MANGO's world communicator.
bool uses_derivatives
Whether the algorithm requires derivatives of the objective function or residuals to be supplied.
int get_N_worker_groups()
Returns the number of worker groups.
int get_rank_worker_groups()
Get the MPI rank of this processor in MANGO's "worker groups" communicator.
int verbose
If true, information is printed to stdout that may be useful for debugging.
@ NLOPT_GN_DIRECT_L_RAND_NOSCAL
Problem(int N_parameters, double *state_vector, objective_function_type objective_function, int argc, char **argv)
Constructor for a standard optimization problem.
std::string name
A short string with the algorithm's name, e.g. 'petsc_pounders' or 'hopspack'.
MPI_Comm get_comm_worker_groups()
Get the MPI communicator for MANGO's "worker groups" communicator.
void mpi_init(MPI_Comm mpi_comm)
Initialize MANGO's internal MPI data that describes the partitioning of the processes into worker gro...
bool least_squares
Whether or not the algorithm assumes the objective function has least-squares form.
~Least_squares_problem()
Destructor.
void set_relative_bound_constraints(double min_factor, double max_factor, double min_radius, bool preserve_sign)
Impose bound constraints on an optimization problem, with the bounds chosen as multiples of the initi...
int get_function_evaluations()
For an optimization problem that has already been solved, return the number of times the objective fu...
void mobilize_workers()
Tell the worker MPI processes (i.e. those that are not group leaders) to begin an evaluation of the o...
bool continue_worker_loop()
For an MPI worker, determine whether to carry out another evaluation of the objective function or exi...
int get_N_terms()
Return the number of least-squares terms that are summed to form the objective function.
void read_input_file(std::string filename)
Reads in the number of worker groups and algorithm from a file.
@ NLOPT_LD_TNEWTON_PRECOND
@ NUM_ALGORITHMS
Not an actual algorithm, just counting.
double optimize()
Solve the optimization problem that has been set up.
int get_N_procs_world()
Get the number of processors in MANGO's world communicator.
A class for dividing the set of MPI processes into worker groups.
void write(std::string filename)
Write a file with the given filename, showing the worker group assignments and rank of each process i...
void set_bound_constraints(double *lower, double *upper)
Sets bound constraints for the optimization problem.