Go to the documentation of this file.
26 if (algorithm_in < 0)
throw std::runtime_error(
"Error in mango::Problem::set_algorithm. Algorithm cannot be negative.");
27 if (algorithm_in >=
NUM_ALGORITHMS)
throw std::runtime_error(
"Error in mango::Problem::set_algorithm. Algorithm is too large.");
31 if (
solver->
verbose > 0) std::cout <<
"Algorithm set (by integer) to " << algorithm_in <<
", a.k.a. " <<
algorithms[algorithm_in].
name << std::endl;
40 std::cerr <<
"Error in mango::Problem::set_algorithm. The following algorithm name was requested but not found: " << str << std::endl;
41 throw std::runtime_error(
"Error in mango::Problem::set_algorithm: The requested algorithm name was not found.");
43 solver->algorithm = algorithm;
44 if (solver->verbose > 0) std::cout <<
"Algorithm set (by string) to " << algorithm <<
", a.k.a. " <<
algorithms[algorithm].
name << std::endl;
53 bool found_match =
false;
bool get_algorithm(std::string name, algorithm_type *algorithm_int)
Returns the integer (enum) for an optimization algorithm associated with its string name.
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...
algorithm_type
A list of the algorithms that MANGO can potentially use.
const algorithm_properties algorithms[NUM_ALGORITHMS]
A database of the algorithms that MANGO is aware of, including various properties of each algorithm.
void set_algorithm(algorithm_type algorithm)
Sets the optimization algorithm.
std::string name
A short string with the algorithm's name, e.g. 'petsc_pounders' or 'hopspack'.
@ NUM_ALGORITHMS
Not an actual algorithm, just counting.