Skip to content

Instantly share code, notes, and snippets.

@zoq
Last active December 19, 2017 18:38
Show Gist options
  • Save zoq/4d8bce934d96240bb6fee4419f3bddf7 to your computer and use it in GitHub Desktop.
Save zoq/4d8bce934d96240bb6fee4419f3bddf7 to your computer and use it in GitHub Desktop.
termination.cpp
class TerminationPolicy
{
template<typename FunctionType>
bool Converged(FunctionType& function)
{
}
}
template<..., TerminationPolicy>
class Optimizer
{
Optimizer(TerminationPolicy& terminationPolicy)
{
}
double Optimize(DecomposableFunctionType& function, arma::mat& iterate)
{
for(;;)
{
if (terminationPolicy.Converged(function))
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment