Last active
December 19, 2017 18:38
-
-
Save zoq/4d8bce934d96240bb6fee4419f3bddf7 to your computer and use it in GitHub Desktop.
termination.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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