Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 2741ed28 authored by hhakim's avatar hhakim
Browse files

Add a new constructor to Faust::StoppingCriterion.

Useful for wrappers which need to set all attributes even if using them together doesn't make sense in normal cases.
parent bb7699d1
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,8 @@ namespace Faust
StoppingCriterion(bool isCriterionError_);
StoppingCriterion(int nb_it, bool isCriterionError, T errorThreshold, int maxIteration=10000);
~StoppingCriterion(){}
bool do_continue(int current_ite, T error=-2.0)const;
......
......@@ -60,6 +60,14 @@ Faust::StoppingCriterion<T>::StoppingCriterion(bool isCriterionError_) : isCrite
nb_it = 500;
}
template<typename T>
Faust::StoppingCriterion<T>::StoppingCriterion(int nb_it, bool isCriterionError, T errorThreshold, int maxIteration /* default 10000 */):
nb_it(nb_it), isCriterionError(isCriterionError), errorThreshold(errorThreshold), maxIteration(maxIteration)
{
check_validity();
}
template<typename T>
void Faust::StoppingCriterion<T>::check_validity()const
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment