MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / test_update

Function test_update

tests/checkasm/lls.c:34–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32} while(0);
33
34static void test_update(LLSModel *lls, const double *var)
35{
36 double refcovar[MAX_VARS][MAX_VARS];
37 declare_func(void, LLSModel *, const double *);
38
39 call_ref(lls, var);
40
41 for (size_t i = 0; i < MAX_VARS; i++)
42 for (size_t j = 0; j < MAX_VARS; j++)
43 refcovar[i][j] = lls->covariance[i][j];
44
45 memset(lls->covariance, 0, sizeof (lls->covariance));
46 call_new(lls, var);
47
48 for (size_t i = 0; i < lls->indep_count; i++)
49 for (size_t j = i; j < lls->indep_count; j++) {
50 double eps = FFMAX(2 * DBL_EPSILON * fabs(refcovar[i][j]),
51 8 * DBL_EPSILON);
52 if (!double_near_abs_eps(refcovar[i][j], lls->covariance[i][j],
53 eps)) {
54 fprintf(stderr, "%zu, %zu: %- .12f - %- .12f = % .12g\n", i, j,
55 refcovar[i][j], lls->covariance[i][j],
56 refcovar[i][j] - lls->covariance[i][j]);
57 fail();
58 }
59 }
60
61 bench_new(lls, var);
62}
63
64static void test_evaluate(LLSModel *lls, const double *param, int order)
65{

Callers 1

checkasm_check_llsFunction · 0.85

Calls 2

fabsFunction · 0.85
double_near_abs_epsFunction · 0.85

Tested by

no test coverage detected