Esempio n. 1
0
 void transaction::rollback()
 {
    check_current_transaction();
    try {
       v_rollback();
    }
    // LCOV_EXCL_START
    catch( ... ) {
       v_reset();
       throw;
    }
    // LCOV_EXCL_STOP
    v_reset();
 }
Esempio n. 2
0
void Minimizer_reset (Minimizer me, const double guess[]) {
	if (guess) {
		for (long i = 1; i <= my nParameters; i++) {
			my p[i] = guess[i];
		}
	} else {
		for (long i = 1; i <= my nParameters; i++) {
			my p[i] = NUMrandomUniform (-1.0, 1.0);
		}
	}

	NUMvector_free<double> (my history, 1);
	my history = nullptr;
	my maxNumOfIterations = my success = my funcCalls = my iteration = 0;
	my minimum = 1.0e38;
	my v_reset ();
}
Esempio n. 3
0
void Minimizer_reset (Minimizer me, const double guess[]) {
	if (guess) {
		for (long i = 1; i <= my nParameters; i++) {
			my p[i] = guess[i];
		}
	} else {
		for (long i = 1; i <= my nParameters; i++) {
			my p[i] = NUMrandomUniform (-1, 1);
		}
	}
	/*
		Don't use NUMdvector_free: realloc in Minimizer_minimize
	*/
	if (my history != 0) {
		my history++;
		Melder_free (my history);
	}
	my maxNumOfIterations = my success = my funcCalls = my iteration = 0;
	my minimum = 1.0e38;
	my v_reset ();
}