Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allowed the Gaussian Process Regression example to behave gracefully
in the event NLOPT is not present.
  • Loading branch information
puffin444 committed Jun 27, 2012
1 parent 9d3c1a1 commit f4b4c8f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions examples/undocumented/libshogun/regression_gaussian_process.cpp
Expand Up @@ -132,10 +132,14 @@ int main(int argc, char **argv)

CParameterCombination* best_combination=grad_search->select_model(true);

SG_SPRINT("best parameter(s):\n");
best_combination->print_tree();
if (best_combination)
{
SG_SPRINT("best parameter(s):\n");
best_combination->print_tree();

best_combination->apply_to_machine(gp);
}

best_combination->apply_to_machine(gp);
CGradientResult* result=(CGradientResult*)grad->evaluate();

if(result->get_result_type() != GRADIENTEVALUATION_RESULT)
Expand Down

0 comments on commit f4b4c8f

Please sign in to comment.